Skip to content

Commit

Permalink
[#1296] Removed references to Docker as a product. (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk authored May 2, 2024
1 parent 4adcb05 commit ddb80bf
Show file tree
Hide file tree
Showing 61 changed files with 764 additions and 683 deletions.
18 changes: 9 additions & 9 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,39 @@ commands:
|| echo "Not a supported OS or Sequel Ace is not installed."
# ----------------------------------------------------------------------------
# Docker commands.
# Container commands.
# ----------------------------------------------------------------------------

up:
usage: Build and start Docker containers.
usage: Build and start containers.
cmd: |
docker compose up -d "$@"
if docker compose logs | grep -q "\[Error\]"; then exit 1; fi
down:
usage: Stop Docker containers and remove container, images, volumes and networks.
usage: Stop and remove containers, images, volumes and networks.
cmd: |
ahoy confirm "Running this command will remove your current database. Are you sure?" &&
if [ -f "docker-compose.yml" ]; then docker compose down --remove-orphans --volumes > /dev/null 2>&1; fi
start:
usage: Start existing Docker containers.
usage: Start existing containers.
cmd: docker compose start "$@"

stop:
usage: Stop running Docker containers.
usage: Stop running containers.
cmd: docker compose stop "$@"

restart:
usage: Restart stopped or running Docker containers.
usage: Restart stopped or running containers.
cmd: docker compose restart "$@"

logs:
usage: Show Docker logs for services.
usage: Show container logs for services.
cmd: docker compose logs "$@"

pull:
usage: Pull latest Docker images.
usage: Pull latest container images.
cmd: if [ ! -z "$(docker image ls -q)" ]; then docker image ls --format \"{{.Repository}}:{{.Tag}}\" | grep uselagoon/ | grep -v none | xargs -n1 docker pull -q | cat; fi

cli:
Expand Down Expand Up @@ -226,7 +226,7 @@ commands:
deploy:
usage: Run remote deployment procedures.
cmd: |
ahoy confirm "Deployment usually runs in CI. Are you sure you want to proceed with manual deployment? (Run as ahoy deploy [type1,[type2..]], where [type] is 'code', 'docker', 'webhook')" &&
ahoy confirm "Deployment usually runs in CI. Are you sure you want to proceed with manual deployment? (Run as ahoy deploy [type1,[type2..]], where [type] is 'code', 'container_registry', 'webhook')" &&
./scripts/drevops/deploy.sh "$@"
github-labels:
Expand Down
54 changes: 27 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This configuration file uses the "docker" executor to run the Docker stack.
#
# A "runner" container, created from a specified Docker image, is used to
# A "runner" container, created from a specified container image, is used to
# checkout source code and run commands defined in this file. Application Docker
# containers defined in `docker-compose.yml` run on a *remote* Docker server
# controlled by CircleCI.
Expand Down Expand Up @@ -56,8 +56,8 @@ aliases:
# @see https://hub.docker.com/repository/docker/drevops/ci-runner/tags?page=1&ordering=last_updated
- image: drevops/ci-runner:24.4.0
auth:
username: ${DOCKER_USER}
password: ${DOCKER_PASS}
username: ${DREVOPS_CONTAINER_REGISTRY_USER}
password: ${DREVOPS_CONTAINER_REGISTRY_PASS}
environment:
# Set runner timezone to ensure that executed operations use correct timestamps.
# @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Expand Down Expand Up @@ -102,8 +102,8 @@ aliases:
docker_layer_caching: false
version: default

# Set up Docker network.
- &step_setup_docker_network
# Set up container network.
- &step_setup_container_network
run: docker network prune -f >/dev/null 2>&1 && docker network inspect amazeeio-network >/dev/null 2>&1 || docker network create amazeeio-network >/dev/null 2>&1 || true

# Process the codebase to be run in CI environment.
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- checkout
- *step_process_codebase_for_ci
- *step_setup_remote_docker
- *step_setup_docker_network
- *step_setup_container_network
- run:
name: Create cache keys for database caching as files
command: |
Expand All @@ -164,14 +164,14 @@ jobs:
# Execute commands after database download script finished: if the
# DB dump was downloaded - build the site (to ensure that the DB dump
# is valid) and export the DB using selected method (to support
# "file-to-Docker image" or "Docker image-to-file" conversions).
# "file-to-image" or "image-to-file" conversions).
# Note that configuration changes and the DB updates are not applied, so
# the database will be cached in the same state as downloaded.
- run:
name: Export DB after download
command: |
[ ! -f /tmp/download-db-success ] && echo "==> Database download semaphore file is missing. DB export will not proceed." && exit 0
./scripts/drevops/login-docker.sh
./scripts/drevops/login-container-registry.sh
docker compose up -d && sleep 15
docker compose exec cli mkdir -p .data && docker compose cp -L .data/db.sql cli:/app/.data/db.sql || true
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "DREVOPS_PROVISION_POST_OPERATIONS_SKIP=1 ./scripts/drevops/provision.sh"
Expand All @@ -197,8 +197,8 @@ jobs:
DREVOPS_CI_DB_CACHE_FALLBACK: 'no'
# Always use fresh base image for the database.
DREVOPS_DB_IMAGE_BASE: drevops/mariadb-drupal-data:24.4.0
# Deploy docker image (if DREVOPS_DB_EXPORT_DOCKER_IMAGE storage is used).
DREVOPS_EXPORT_DB_DOCKER_DEPLOY_PROCEED: 1
# Deploy container image (if database-in-image storage is used).
DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1
#;> !PROVISION_USE_PROFILE

# Build and test is a second step of the build. The testing is performed
Expand All @@ -212,7 +212,7 @@ jobs:
- checkout
- *step_process_codebase_for_ci
- *step_setup_remote_docker
- *step_setup_docker_network
- *step_setup_container_network
#;< !PROVISION_USE_PROFILE
- run:
name: Set cache keys for database caching
Expand All @@ -228,8 +228,8 @@ jobs:
- v1.19.0-db10-{{ checksum "/tmp/db_cache_branch" }}-{{ checksum "/tmp/db_cache_fallback_yes" }}-
#;> !PROVISION_USE_PROFILE
- run:
name: Login to Docker registry
command: ./scripts/drevops/login-docker.sh
name: Login to container registry
command: ./scripts/drevops/login-container-registry.sh
- run:
name: Build stack
command: docker compose up -d
Expand Down Expand Up @@ -391,7 +391,7 @@ jobs:
- checkout
- *step_process_codebase_for_ci
- *step_setup_remote_docker
- *step_setup_docker_network
- *step_setup_container_network
- run:
name: Run CircleCI tests (long)
command: SCAFFOLD_DEV_VOLUMES_MOUNTED=0 SCAFFOLD_DEV_TEST_COVERAGE_DIR=/tmp/artifacts/coverage .scaffold/tests/test.postbuild.sh
Expand All @@ -408,15 +408,15 @@ jobs:
#-----------------------------------------------------------------------------
#
# Switching between "database in file" (DIF, mounted data volume) and
# "database-in-Docker-image" (DIDI, data volume is a part of the image) is
# "database-in-image" (DIDI, data volume is a part of the image) is
# done by providing the value of DREVOPS_DB_IMAGE environment variable,
# which would be set in .env file for consumer projects.
#
# Also, the source of the database can be either file (downloaded from
# remote location) or a previous version of the data image.
#
# This means that there should be the following tests for Scaffold
# database-in-Docker-image workflow functionality:
# database-in-image workflow functionality:
# 1. DB is file -> create data image -> cache data image and push it to registry -> build and test site
# 2. DB is image -> create data image -> cache data image and push it to registry -> build and test site
#
Expand All @@ -431,7 +431,7 @@ jobs:
environment:
DREVOPS_DB_DOWNLOAD_SOURCE: curl
DREVOPS_DB_DOWNLOAD_FORCE: 1
# Use Docker database storage despite that the file is coming
# Use container image database storage despite that the file is coming
# from CURL - this is to make sure that image is exported into cache
# to be used between jobs. Note that in consumer project .env file would
# have DREVOPS_DB_IMAGE variable set and this environment variable
Expand All @@ -443,30 +443,30 @@ jobs:
DREVOPS_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x
# Use a separate tag to make sure that pushed image does not affect
# other tests (pushing broken image as 'latest' would fail other tests).
DREVOPS_DOCKER_IMAGE_TAG: scaffold-dev-didi-database-fi
# Also, use this job to test pushing of the DB image to the Docker
DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: scaffold-dev-didi-database-fi
# Also, use this job to test pushing of the DB image to the container
# registry to replicate what database-nightly job would do.
DREVOPS_EXPORT_DB_DOCKER_DEPLOY_PROCEED: 1
DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1
# Use custom cache key for this workflow to make sure that caches from
# the main workflow are separated from this one.
DREVOPS_CI_DB_CACHE_BRANCH: scaffold-dev-didi-fi
# Job to test creation of the image from the previous version of the image
# when using database-in-Docker-image workflow.
# when using database-in-image workflow.
scaffold-dev-database-ii:
<<: *job-database
environment:
DREVOPS_DB_DOWNLOAD_SOURCE: docker_registry
DREVOPS_DB_DOWNLOAD_SOURCE: DREVOPS_CONTAINER_REGISTRY
DREVOPS_DB_DOWNLOAD_FORCE: 1
DREVOPS_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x
DREVOPS_DOCKER_IMAGE_TAG: scaffold-dev-database-ii
# Also, use this job to test pushing of the DB image to the Docker
DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: scaffold-dev-database-ii
# Also, use this job to test pushing of the DB image to the container
# registry so replicate what database-nightly job would do.
DREVOPS_EXPORT_DB_DOCKER_DEPLOY_PROCEED: 1
DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1
# Use custom cache key for this workflow to make sure that caches from
# the main workflow are separated from this one.
DREVOPS_CI_DB_CACHE_BRANCH: scaffold-dev-didi-ii
# Job to test build of the image from the previous stage of the image when
# using database-in-Docker-image workflow. Overwriting just the DREVOPS_DB_IMAGE
# using database-in-image workflow. Overwriting just the DREVOPS_DB_IMAGE
# variable should change the storage mechanisms, but preserve application-level
# stack operation.
scaffold-dev-didi-build-fi:
Expand Down Expand Up @@ -563,7 +563,7 @@ workflows:
requires:
- scaffold-dev-didi-database-fi

# Test workflow to test DREVOPS_DB_IMAGE workflow for DB from docker registry.
# Test workflow to test DREVOPS_DB_IMAGE workflow for DB from the container registry.
scaffold-dev-didi-ii:
jobs:
- scaffold-dev-database-ii
Expand Down
2 changes: 1 addition & 1 deletion .docker/config/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This directory contains additional configuration for every Docker service.
This directory contains additional configuration for every container service.

Place your custom configuration into the directory with the service name.
4 changes: 2 additions & 2 deletions .docker/mariadb.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# @see https://hub.docker.com/r/uselagoon/mariadb-10.11-drupal/tags?page=1
# @see https://github.com/uselagoon/lagoon-images/tree/main/images/mariadb-drupal
#
# Use drevops/drevops-mariadb-drupal-data as a starting Docker image for your
# Database-in-Docker-image database.
# Use drevops/drevops-mariadb-drupal-data as a starting container image for your
# database-in-image database.
# @see https://github.com/drevops/mariadb-drupal-data
#
# The ARG value will be updated with a value passed from docker-compose.yml
Expand Down
2 changes: 1 addition & 1 deletion .docker/scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This directory contains custom scripts to run in the Docker services during
This directory contains custom scripts to run in the container services during
image build or container runtime.
2 changes: 1 addition & 1 deletion .docker/solr.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ RUN sed -i -e "s#<dataDir>\${solr.data.dir:}#<dataDir>/var/solr/\${solr.core.nam
&& sed -i -e "s#solr.autoSoftCommit.MaxTime=5000#solr.autoSoftCommit.MaxTime=-1#g" /solr-conf/conf/solrcore.properties

USER solr
# Solr-precreate is provided by the base solr docker image and is responsible
# Solr-precreate is provided by the base solr container image and is responsible
# for precreating the core and then starting solr in the foreground.
CMD ["solr-precreate", "drupal", "/solr-conf"]
26 changes: 12 additions & 14 deletions .env
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
##
# Project environment variables.
#
# This file is used by Docker and other scripts to set values.
#
# This is a single location where defined variables control how Scaffold operates
# and should be the primary place for modifications. Avoid overriding values in
# scripts or configuration files to simplify future updates and centralize
# changes.
# This is a single location where defined variables control how Scaffold
# operates and should be the primary place for modifications. Avoid overriding
# values in scripts or configuration files to simplify future updates and
# centralize changes.
#
# Values must be scalar and cannot reference another variable.
# Do not enclose values in double quotes unless they include spaces.
Expand Down Expand Up @@ -108,7 +106,7 @@ DREVOPS_PROVISION_USE_MAINTENANCE_MODE=1
# See settings.php for database credentials defaults.

# Database can be imported from a file dump into an empty database started from
# the database default image or can exist in a pre-built Docker image.
# the database default image or can exist in a pre-built container image.
# Defaults to importing from a file.
# @see https://docs.drevops.com/workflows/database

Expand All @@ -118,7 +116,7 @@ DREVOPS_DB_DIR=./.data
# Database dump file name.
DREVOPS_DB_FILE=db.sql

# Name of the pre-built Docker image.
# Name of the pre-built container image.
# Uncomment to use an image with a DB data loaded into it.
# @see https://github.com/drevops/mariadb-drupal-data to seed your DB image.
# DREVOPS_DB_IMAGE=your_org/your_site:latest
Expand All @@ -130,10 +128,10 @@ DREVOPS_DB_FILE=db.sql
# - `ftp` - directly from FTP as a file using CURL.
# - `acquia` - from the latest Acquia backup via Cloud API as a file.
# - `lagoon` - from Lagoon main environment as a file.
# - `docker_registry` - from the docker registry as a docker image.
# - `container_registry` - from the container registry as a container image.
# - `none` - not downloaded, site is freshly installed for every build.

# Note that "docker_registry" works only for database-in-Docker-image
# Note that "container_registry" works only for database-in-image
# database storage (when $DREVOPS_DB_IMAGE variable has a value).
DREVOPS_DB_DOWNLOAD_SOURCE=curl

Expand Down Expand Up @@ -184,7 +182,7 @@ LAGOON_PROJECT=your_site
# The type of deployment.
#
# Combination of comma-separated values to support multiple deployment targets:
# `artifact`,`docker`, `webhook`, `lagoon`.
# `artifact`,`container_registry`, `webhook`, `lagoon`.
#
# See https://docs.drevops.com/workflows/deploy
DREVOPS_DEPLOY_TYPES=artifact
Expand Down Expand Up @@ -243,9 +241,9 @@ DREVOPS_DB_DOWNLOAD_CURL_URL=https://github.com/drevops/scaffold/releases/downlo

#;< DREVOPS_DB_IMAGE
# The name of the demo database image used for demonstration only for
# database-in-Docker-image data storage.
#; The line below will be automatically uncommented for database-in-Docker-image
#; storage. It is commented out to allow running non-database-in-Docker-image
# database-in-image data storage.
#; The line below will be automatically uncommented for database-in-image
#; storage. It is commented out to allow running non-database-in-image
# workflow by default.
##### DREVOPS_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest
#;> DREVOPS_DB_IMAGE
Expand Down
14 changes: 7 additions & 7 deletions .env.local.default
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ DREVOPS_ACQUIA_SECRET=
#;> !PROVISION_USE_PROFILE

#;< !PROVISION_USE_PROFILE
#;< DREVOPS_DB_DOWNLOAD_SOURCE_DOCKER_REGISTRY
# Docker registry credentials to read and write Docker images.
#;< DREVOPS_DB_DOWNLOAD_SOURCE_CONTAINER_REGISTRY
# Container registry credentials to read and write images.

# The username to log into the Docker registry.
DOCKER_USER=
# The password (token) to log into the Docker registry.
DOCKER_PASS=
#;> DREVOPS_DB_DOWNLOAD_SOURCE_DOCKER_REGISTRY
# The username to log into the container registry.
DREVOPS_CONTAINER_REGISTRY_USER=$DOCKER_USER
# The password (token) to log into the container registry.
DREVOPS_CONTAINER_REGISTRY_PASS=$DOCKER_PASS
#;> DREVOPS_DB_DOWNLOAD_SOURCE_CONTAINER_REGISTRY
#;> !PROVISION_USE_PROFILE

# GitHub token used to overcome API rate limits or access private repositories.
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/scaffold-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
DOCKER_CONFIG: /root/.docker
DREVOPS_DOCTOR_CHECK_MINIMAL: 1
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
TEST_DOCKER_USER: ${{ secrets.TEST_DOCKER_USER }}
TEST_DOCKER_PASS: ${{ secrets.TEST_DOCKER_PASS }}
TEST_DREVOPS_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_USER }}
TEST_DREVOPS_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_PASS }}
SCAFFOLD_DEV_VOLUMES_MOUNTED: 0
SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html

Expand Down Expand Up @@ -93,8 +93,8 @@ jobs:
DOCKER_CONFIG: /root/.docker
DREVOPS_DOCTOR_CHECK_MINIMAL: 1
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
TEST_DOCKER_USER: ${{ secrets.TEST_DOCKER_USER }}
TEST_DOCKER_PASS: ${{ secrets.TEST_DOCKER_PASS }}
TEST_DREVOPS_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_USER }}
TEST_DREVOPS_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_PASS }}
SCAFFOLD_DEV_VOLUMES_MOUNTED: 0
SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}
Expand Down Expand Up @@ -144,8 +144,8 @@ jobs:
DOCKER_CONFIG: /root/.docker
DREVOPS_DOCTOR_CHECK_MINIMAL: 1
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
TEST_DOCKER_USER: ${{ secrets.TEST_DOCKER_USER }}
TEST_DOCKER_PASS: ${{ secrets.TEST_DOCKER_PASS }}
TEST_DREVOPS_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_USER }}
TEST_DREVOPS_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_PASS }}
SCAFFOLD_DEV_VOLUMES_MOUNTED: 0
SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}
Expand Down
7 changes: 4 additions & 3 deletions .lagoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ environment_variables:
# Uncomment to login into container registries if using private images.
# container-registries:
# dockerhub:
# # Environment variables DOCKER_USER and DOCKER_PASS needs to be set via Lagoon CLI.
# username: DOCKER_USER
# password: DOCKER_PASS
# # The `username` field must be set as a scalar value.
# # Environment variable DREVOPS_CONTAINER_REGISTRY_PASS needs to be set via Lagoon CLI.
# username: your_registry_username
# password: DREVOPS_CONTAINER_REGISTRY_PASS

tasks:
post-rollout:
Expand Down
Loading

1 comment on commit ddb80bf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.