From 3c34e6a75c1dd623c2c46c991b42bef579b32980 Mon Sep 17 00:00:00 2001 From: Roman Barbun Date: Fri, 29 Nov 2024 14:15:38 +1100 Subject: [PATCH 1/2] Moved dockerized install to CLI. --- .docker/Dockerfile.govcms | 8 ++++++++ .docker/Dockerfile.test | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.docker/Dockerfile.govcms b/.docker/Dockerfile.govcms index 2e05c085..c2cbf542 100644 --- a/.docker/Dockerfile.govcms +++ b/.docker/Dockerfile.govcms @@ -28,6 +28,14 @@ RUN --mount=type=secret,id=composer-auth,dst=/app/auth.json /usr/local/bin/compo RUN --mount=type=secret,id=composer-auth,dst=/app/auth.json /usr/local/bin/composer update --no-dev -d /app RUN --mount=type=secret,id=composer-auth,dst=/app/auth.json /usr/local/bin/composer clearcache +# Set an environment variable for Dockerize version +ENV DOCKERIZE_VERSION v0.6.1 + +# Download Dockerize, extract, and install it +RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz + # Add bash aliases to assist with full path executables. COPY .docker/images/govcms/entrypoints /lagoon/entrypoints/ diff --git a/.docker/Dockerfile.test b/.docker/Dockerfile.test index 5ee3f16c..e63c9924 100644 --- a/.docker/Dockerfile.test +++ b/.docker/Dockerfile.test @@ -8,14 +8,6 @@ FROM ${CLI_IMAGE} as cli # Second stage: Build on top of the CLI image FROM uselagoon/php-8.3-cli-drupal:${LAGOON_IMAGE_VERSION} -# Set an environment variable for Dockerize version -ENV DOCKERIZE_VERSION v0.6.1 - -# Download Dockerize, extract, and install it -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz - # Copy executable scripts to /usr/bin/ and make them executable COPY .docker/scripts/ /usr/bin/ RUN chmod +x /usr/bin/lint-govcms \ From cc9b1f9313bacab1dbb2ed5cdd1bc89209293cc2 Mon Sep 17 00:00:00 2001 From: Roman Barbun Date: Fri, 29 Nov 2024 15:06:15 +1100 Subject: [PATCH 2/2] Adjusted build commands. --- .ahoy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.ahoy.yml b/.ahoy.yml index d2bb5137..1e42a7a7 100644 --- a/.ahoy.yml +++ b/.ahoy.yml @@ -6,7 +6,7 @@ commands: usage: Build project. cmd: | docker compose up -d "$@" && - docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m; + docker compose exec -T cli dockerize -wait tcp://mariadb:3306 -timeout 2m; down: usage: Delete project. @@ -20,14 +20,14 @@ commands: env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --no-cache cli --load env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --load docker compose up -d - docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m + docker compose exec -T cli dockerize -wait tcp://mariadb:3306 -timeout 2m else ahoy confirm "Are you sure environment variables are correct? Update .env if not." && # Run this if confirm returns true env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --no-cache cli --load && env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --load && docker compose up -d "$@" && - docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m || + docker compose exec -T cli dockerize -wait tcp://mariadb:3306 -timeout 2m || # Run this if confirm returns false echo "OK, nothing to do." fi @@ -136,7 +136,7 @@ commands: cmd: | apk update && apk add --no-cache php php-phar php-json php-openssl php-mbstring php-dom php-tokenizer php-xml php-xmlwriter curl -sS https://getcomposer.org/installer -o composer-setup.php && php composer-setup.php --install-dir=/usr/local/bin --filename=composer && rm composer-setup.php - docker compose exec -T test dockerize -wait tcp://nginx:8080 -timeout 1m + docker compose exec -T cli dockerize -wait tcp://nginx:8080 -timeout 1m docker compose exec -T nginx nginx -t composer validate --strict -d .docker/images/nginx/tests composer install -d .docker/images/nginx/tests