Skip to content

Commit

Permalink
[TASK] Test image only if loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ochorocho committed Jun 8, 2024
1 parent db05b83 commit 4c77fb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

GITHUB_OWNER=ddev
PUSH=""
LOAD=""
IMAGE_NAME="ghcr.io/ochorocho/ddev-gitlab-ci"
DDEV_VERSION=""

Expand Down Expand Up @@ -73,6 +74,9 @@ done

loadVersionAndTags

# @todo: Add --load option
docker buildx build --platform linux/amd64,linux/arm64 --no-cache --pull . -f Dockerfile ${DOCKER_TAGS[@]} --build-arg ddev_version="$DDEV_VERSION" $PUSH $LOAD
#docker run --rm -it -v "$(pwd)/test.sh:/tmp/test.sh" --entrypoint "ash" "$IMAGE_NAME:$DDEV_VERSION" /tmp/test.sh
docker buildx build --platform linux/amd64,linux/arm64 --progress plain --no-cache --pull . -f Dockerfile ${DOCKER_TAGS[@]} --build-arg ddev_version="$DDEV_VERSION" $PUSH $LOAD

if [ $LOAD ]; then
docker run --rm -it -v "$(pwd)/test.sh:/tmp/test.sh" --entrypoint "ash" "$IMAGE_NAME:$DDEV_VERSION" /tmp/test.sh
fi

2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
docker --version | head -n 1 || exit 1
docker-compose --version | head -n 1 || exit 1
ddev --version | head -n 1 || exit 1
mkcert -version
echo "mkcert $(mkcert -version || exit 1)"
echo "Current user: $(whoami)"

0 comments on commit 4c77fb4

Please sign in to comment.