Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-301] Moved dockerized install to CLI. #445

Open
wants to merge 2 commits into
base: 3.x-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions .docker/Dockerfile.govcms
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
8 changes: 0 additions & 8 deletions .docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down