forked from LaconicNetwork/kompose
Merge pull request #665 from ashetty1/build_push
Fix OpenShift tests for build and push
This commit is contained in:
commit
d18828b0a4
@ -0,0 +1,3 @@
|
||||
FROM busybox:1.26.2
|
||||
|
||||
RUN touch /test
|
||||
@ -0,0 +1,6 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
foo:
|
||||
build: "./build"
|
||||
command: sleep 100
|
||||
@ -174,7 +174,7 @@ function convert::oc_cleanup () {
|
||||
function convert::oc_check_route () {
|
||||
local route_key=$1
|
||||
if [ $route_key == 'true' ]; then
|
||||
route_key='xip.io'
|
||||
route_key='nip.io'
|
||||
fi
|
||||
|
||||
if [ $(oc get route | grep ${route_key} | wc -l ) -gt 0 ]; then
|
||||
@ -201,7 +201,6 @@ function convert::kompose_up () {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function convert::kompose_down () {
|
||||
# Function for running 'kompose down'
|
||||
# Usage: convert::kompose_down <docker_compose_file>
|
||||
|
||||
@ -21,15 +21,26 @@ source $KOMPOSE_ROOT/script/test_in_openshift/lib.sh
|
||||
|
||||
convert::print_msg "Testing buildconfig on kompose"
|
||||
|
||||
docker_compose_file="${KOMPOSE_ROOT}/examples/buildconfig/docker-compose.yml"
|
||||
docker_compose_file="${KOMPOSE_ROOT}/script/test_in_openshift/compose-files/buildconfig/docker-compose.yml"
|
||||
|
||||
# Run kompose up
|
||||
convert::kompose_up $docker_compose_file
|
||||
convert::print_msg "Running kompose up ..."
|
||||
kompose up --provider=openshift --emptyvols -f $docker_compose_file --build build-config; exit_status=$?
|
||||
|
||||
if [ $exit_status -ne 0 ]; then
|
||||
convert::print_fail "kompose up has failed\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the pods are up.
|
||||
convert::kompose_up_check -p foo
|
||||
|
||||
# Kompose down for buildconfig fails being tracked at #382
|
||||
convert::kompose_down $docker_compose_file
|
||||
convert::print_msg "Running kompose down ..."
|
||||
kompose down --provider=openshift -f $docker_compose_file; exit_status=$?
|
||||
|
||||
if [ $exit_status -ne 0 ]; then
|
||||
convert::print_fail "kompose down has failed\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
convert::kompose_down_check 2
|
||||
|
||||
@ -24,12 +24,25 @@ convert::print_msg "Testing buildconfig dockerfile construct in kompose"
|
||||
docker_compose_file="${KOMPOSE_ROOT}/script/test_in_openshift/compose-files/docker-compose-bc-dockerfile.yml"
|
||||
|
||||
# Run kompose up
|
||||
convert::kompose_up $docker_compose_file
|
||||
convert::print_msg "Running kompose up ..."
|
||||
kompose up --provider=openshift --emptyvols -f $docker_compose_file --build build-config; exit_status=$?
|
||||
|
||||
if [ $exit_status -ne 0 ]; then
|
||||
convert::print_fail "kompose up has failed\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the pods are up.
|
||||
convert::kompose_up_check -p foo
|
||||
|
||||
# Kompose down for buildconfig fails being tracked at #382
|
||||
# convert::kompose_down $docker_compose_file
|
||||
convert::print_msg "Running kompose down ..."
|
||||
kompose down --provider=openshift -f $docker_compose_file; exit_status=$?
|
||||
|
||||
if [ $exit_status -ne 0 ]; then
|
||||
convert::print_fail "kompose down has failed\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# convert::kompose_down_check 2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user