diff --git a/development/build_images.sh b/development/build_images.sh index fe1fd2b9..fcfc1da9 100755 --- a/development/build_images.sh +++ b/development/build_images.sh @@ -4,6 +4,7 @@ set -xeu SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" INTEGRATION_TEST_DIR="$SCRIPT_DIR/../integration-tests/" +CONTAINER_REPOSITORY="aelsabbahy" LABEL_DATE=$(date -u +'%Y-%m-%dT%H:%M:%S.%3NZ') LABEL_URL="https://github.com/goss-org/goss" @@ -23,5 +24,5 @@ for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do --label "org.opencontainers.image.url=$LABEL_URL" \ --label "org.opencontainers.image.version=manual" \ --label "rocks.goss.dockerfile-md5"=$md5 \ - -t "aelsabbahy/goss_${os}:latest" - < "$docker_file" + -t "$CONTAINER_REPOSITORY/goss_${os}:latest" - < "$docker_file" done diff --git a/development/push_images.sh b/development/push_images.sh index fcbc4557..680f9605 100755 --- a/development/push_images.sh +++ b/development/push_images.sh @@ -3,7 +3,8 @@ set -xeu SCRIPT_DIR=$(readlink -f "$(dirname "$0")") -images=$(docker images | grep '^aelsabbahy/goss_.*latest' | awk '$0=$1') +CONTAINER_REPOSITORY="aelsabbahy" +images=$(docker images | grep "^$CONTAINER_REPOSITORY/goss_.*latest" | awk '$0=$1') # Use md5sum to determine if CI needs to do a docker build pushd "$SCRIPT_DIR/../integration-tests"; diff --git a/integration-tests/test.sh b/integration-tests/test.sh index 2b9936d1..e92d08b0 100755 --- a/integration-tests/test.sh +++ b/integration-tests/test.sh @@ -8,6 +8,7 @@ os="${1:?"Need OS as 1st arg. e.g. alpine arch centos7 rockylinux9 trusty wheezy arch="${2:?"Need arch as 2nd arg. e.g. amd64 386"}" vars_inline="{inline: bar, overwrite: bar}" +container_repository="aelsabbahy" # setup places us inside repo-root; this preserves current behaviour with least change. cd integration-tests @@ -15,10 +16,10 @@ cd integration-tests cp "../release/goss-linux-$arch" "goss/$os/" # Run build if Dockerfile has changed but hasn't been pushed to dockerhub if ! md5sum -c "Dockerfile_${os}.md5"; then - docker build -t "aelsabbahy/goss_${os}:latest" - < "Dockerfile_$os" + docker build -t "$container_repository/goss_${os}:latest" - < "Dockerfile_$os" # Pull if image doesn't exist locally -elif ! docker images | grep "aelsabbahy/goss_$os";then - docker pull "aelsabbahy/goss_$os" +elif ! docker images | grep "$container_repository/goss_$os";then + docker pull "$container_repository/goss_$os" fi container_name="goss_int_test_${os}_${arch}" @@ -37,7 +38,7 @@ network=goss-test docker network create --driver bridge --subnet '172.19.0.0/16' $network docker run -d --name httpbin --network $network kennethreitz/httpbin opts=(--env OS=$os --cap-add SYS_ADMIN -v "$PWD/goss:/goss" -d --name "$container_name" --security-opt seccomp:unconfined --security-opt label:disable --privileged) -id=$(docker run "${opts[@]}" --network $network "aelsabbahy/goss_$os" /sbin/init) +id=$(docker run "${opts[@]}" --network $network "$container_repository/goss_$os" /sbin/init) ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$id") trap "rv=\$?; docker rm -vf $id;docker rm -vf httpbin;docker network rm $network; exit \$rv" INT TERM EXIT # Give httpd time to start up, adding 1 second to see if it helps with intermittent CI failures