Skip to content

Commit

Permalink
fix(build) use correct base image for rhel8 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gszr committed Nov 3, 2020
1 parent 60f2c3b commit 1ee4f72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions test/build_container.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set -e

DOCKER_BUILD_ARGS=()

if [ "$RESTY_IMAGE_BASE" == "src" ]; then
exit 0
fi
Expand All @@ -26,18 +28,21 @@ if [ "$RESTY_IMAGE_TAG" == "stretch" ] || [ "$RESTY_IMAGE_TAG" == "jessie" ]; th
fi

if [ "$RESTY_IMAGE_BASE" == "rhel" ]; then
sed -i 's/rhel7/rhel'${RESTY_IMAGE_TAG}'/' docker-kong/rhel/Dockerfile
cp output/*.rhel${RESTY_IMAGE_TAG}.${ARCHITECTURE}.rpm docker-kong/rhel/kong.rpm
BUILD_DIR="rhel"
DOCKER_BUILD_ARGS+=(--build-arg RHEL_VERSION=$RESTY_IMAGE_TAG)
else
sed -i 's/^FROM .*/FROM '${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}'/' docker-kong/${BUILD_DIR}/Dockerfile
fi

pushd docker-kong/${BUILD_DIR}
docker build -t $KONG_TEST_IMAGE_NAME \
--no-cache \
--build-arg ASSET=local .
docker run -t $KONG_TEST_IMAGE_NAME kong version
DOCKER_BUILD_ARGS+=(--no-cache)
DOCKER_BUILD_ARGS+=(--build-arg ASSET=local .)

docker build -t $KONG_TEST_IMAGE_NAME \
"${DOCKER_BUILD_ARGS[@]}"

docker run -t $KONG_TEST_IMAGE_NAME kong version
popd

rm -rf docker-kong || true
2 changes: 1 addition & 1 deletion test/tests/01-package/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if [[ "$RESTY_IMAGE_BASE" != "alpine" ]]; then
docker exec ${USE_TTY} user-validation-tests /bin/bash -c "test -d /home/kong/"
docker exec ${USE_TTY} user-validation-tests /bin/bash -c "cat /etc/passwd | grep kong | grep -q /bin/sh"

if [[ "$RESTY_IMAGE_BASE" == "amazonlinux" ]]; then
if [[ "$RESTY_IMAGE_BASE" == "amazonlinux" || "$RESTY_IMAGE_BASE" == "rhel" ]]; then
# Needed to run `su`
docker exec ${USE_TTY} user-validation-tests /bin/bash -c "yum install -y util-linux"

Expand Down

0 comments on commit 1ee4f72

Please sign in to comment.