diff --git a/run b/run index b393d8e..29f45e9 100755 --- a/run +++ b/run @@ -80,6 +80,8 @@ function test:snapshots { local configs=( # TODO: add more configurations for different types and configurations. drupal + drupal-commerce-kickstart + drupal-localgov ) for config in "${configs[@]}"; do diff --git a/tests/snapshots/configs/drupal-commerce-kickstart.yaml b/tests/snapshots/configs/drupal-commerce-kickstart.yaml new file mode 100644 index 0000000..1780466 --- /dev/null +++ b/tests/snapshots/configs/drupal-commerce-kickstart.yaml @@ -0,0 +1,49 @@ +name: drupal-commerce-kickstart +language: php +type: drupal + +web: + type: nginx + +database: + type: mariadb + version: 10 + +php: + version: 8.1-fpm-bullseye + phpcs: false + phpstan: false + phpunit: false + +drupal: + docroot: web + +docker-compose: + services: + - database + - php + - web + +dockerfile: + stages: + build: + extra_directories: + - config + - patches + - scripts + commands: + - composer validate + - composer install + extensions: + install: + - bcmath + +git: + ignore: + - /bin/ + - /libraries/ + - /web/profiles/contrib/ + +experimental: + createGitHubActionsConfiguration: true + runGitHooksBeforePush: true diff --git a/tests/snapshots/configs/drupal-localgov.yaml b/tests/snapshots/configs/drupal-localgov.yaml new file mode 100644 index 0000000..f5ac074 --- /dev/null +++ b/tests/snapshots/configs/drupal-localgov.yaml @@ -0,0 +1,37 @@ +name: drupal-localgov +language: php +type: drupal + +web: + type: nginx + +database: + type: mariadb + version: 10 + +php: + version: 8.1-fpm-bullseye + phpcs: false + phpstan: false + phpunit: false + +drupal: + docroot: web + +docker-compose: + services: + - database + - php + - web + +dockerfile: + stages: + build: + commands: + - composer validate --strict + - composer install + extra_directories: + - assets + +experimental: + useNewDatabaseCredentials: true diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.dockerignore b/tests/snapshots/output/drupal-commerce-kickstart/.dockerignore new file mode 100644 index 0000000..61d63c0 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.dockerignore @@ -0,0 +1,2 @@ +/README.md +/.github/ \ No newline at end of file diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.env.example b/tests/snapshots/output/drupal-commerce-kickstart/.env.example new file mode 100644 index 0000000..7e18d4e --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.env.example @@ -0,0 +1,12 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +export DOCKER_UID=1000 + +export COMPOSE_PROJECT_NAME=drupal-commerce-kickstart +export COMPOSE_PROFILES=web,php,database + +export DOCKER_WEB_VOLUME=.:/app + +export MYSQL_DATABASE=app +export MYSQL_PASSWORD=app +export MYSQL_USER=app diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.githooks/pre-push b/tests/snapshots/output/drupal-commerce-kickstart/.githooks/pre-push new file mode 100755 index 0000000..54ac104 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.githooks/pre-push @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +set -o errexit + +export TTY="-T" + +./run test:commit diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.githooks/prepare-commit-msg b/tests/snapshots/output/drupal-commerce-kickstart/.githooks/prepare-commit-msg new file mode 100755 index 0000000..6ff8ea0 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.githooks/prepare-commit-msg @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +# Load the issue ID from an `.issue-id` file within the project and replace the +# `ISSUE_ID` placeholder within a Git commit message. +# +# For example, running `echo "OD-123" > .issue-id` will add `Refs: OD-123` to +# the commit message. +# +# This also works with multiple issue IDs in the same string, e.g. +# "OD-123 OD-456", or IDs on multiple lines. + +set -o errexit +set -o nounset +set -o pipefail + +PROJECT_DIR=$(git rev-parse --show-toplevel) +ISSUE_FILE="$PROJECT_DIR/.issue-id" + +if [ -f "${ISSUE_FILE}" ]; then + ISSUE_IDS=$(cat "${ISSUE_FILE}" | tr '\n' ',' | tr ' ' ',' | sed 's/,$//' | sed 's/,/, /g') + + if [ -n "${ISSUE_IDS}" ]; then + sed -i.bak "s/# Refs:/Refs: $ISSUE_IDS/" "$1" + fi +fi diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.github/workflows/ci.yml b/tests/snapshots/output/drupal-commerce-kickstart/.github/workflows/ci.yml new file mode 100644 index 0000000..868fe2e --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + pull_request: + push: + workflow_dispatch: + +env: + COMPOSE_DOCKER_CLI_BUILD: 1 + DOCKER_BUILDKIT: 1 + DOCKER_UID: 1001 + +jobs: + build_and_test: + name: Build and test + + runs-on: ubuntu-latest + + steps: + - name: Checkout the code + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + + - name: Build and test + run: | + ./run ci:test diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.gitignore b/tests/snapshots/output/drupal-commerce-kickstart/.gitignore new file mode 100644 index 0000000..2f85b08 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.gitignore @@ -0,0 +1,45 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +.editorconfig +.env +.gitattributes +vendor/ +web/.csslintrc +web/.eslintignore +web/.eslintrc.json +web/.ht.router.php +web/.htaccess +web/INSTALL.txt +web/README.md +web/autoload.php +web/core/ +web/example.gitignore +web/index.php +web/modules/README.txt +web/modules/contrib/ +web/profiles/README.txt +web/robots.txt +web/sites/*/files/ +web/sites/*/private/ +web/sites/*/services*.yml +web/sites/*/settings*.php +web/sites/README.txt +web/sites/default/default.services.yml +web/sites/default/default.settings.php +web/sites/development.services.yml +web/sites/example.settings.local.php +web/sites/example.sites.php +web/sites/simpletest/ +web/themes/README.txt +web/themes/contrib/ +web/update.php +web/web.config + +# Docker. +.env +docker-compose.override.yaml + + +/bin/ +/libraries/ +/web/profiles/contrib/ diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.hadolint.yaml b/tests/snapshots/output/drupal-commerce-kickstart/.hadolint.yaml new file mode 100644 index 0000000..d87bf88 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/.hadolint.yaml @@ -0,0 +1,2 @@ +ignore: + - DL3059 diff --git a/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile b/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile new file mode 100644 index 0000000..c83003d --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile @@ -0,0 +1,67 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +FROM php:8.1-fpm-bullseye AS base + +COPY --from=composer:2 /usr/bin/composer /usr/bin/composer +RUN which composer && composer -V + +ARG DOCKER_UID=1000 +ENV DOCKER_UID="${DOCKER_UID}" + +WORKDIR /app + +RUN adduser --disabled-password --uid "${DOCKER_UID}" app \ + && chown app:app -R /app + +USER app + +ENV PATH="${PATH}:/app/bin:/app/vendor/bin" + +COPY --chown=app:app composer.* ./ + +################################################################################ + +FROM base AS build + +USER root + + +RUN apt-get update -yqq \ + && apt-get install -yqq --no-install-recommends \ + git libpng-dev libjpeg-dev libzip-dev mariadb-client unzip \ + && rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \ + && apt-get clean + +RUN docker-php-ext-configure gd --with-jpeg + +RUN docker-php-ext-install bcmath gd pdo_mysql zip + +COPY --chown=app:app phpunit.xml* ./ + +COPY --chown=app:app config config +COPY --chown=app:app patches patches +COPY --chown=app:app scripts scripts + + +USER app + +RUN composer validate +RUN composer install + +COPY --chown=app:app tools/docker/images/php/root / + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"] +CMD ["php-fpm"] + + + + +################################################################################ + +FROM nginx:1 as web + +EXPOSE 8080 + +WORKDIR /app + +COPY tools/docker/images/web/root / diff --git a/tests/snapshots/output/drupal-commerce-kickstart/docker-compose.yaml b/tests/snapshots/output/drupal-commerce-kickstart/docker-compose.yaml new file mode 100644 index 0000000..fa1f56c --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/docker-compose.yaml @@ -0,0 +1,77 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +x-proxy: &default-proxy + networks: + - default + - web + labels: + - "traefik.docker.network=traefik_proxy" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host( + `${COMPOSE_PROJECT_NAME}.localhost`, + )" + +x-app: &default-app + volumes: + - "${DOCKER_WEB_VOLUME:-./web:/app/web}" + env_file: + - .env + restart: "${DOCKER_RESTART_POLICY:-unless-stopped}" + networks: + - default + deploy: + resources: + limits: + cpus: "${DOCKER_MYSQL_CPUS:-0}" + memory: "${DOCKER_MYSQL_MEMORY:-0}" + labels: + - "traefik.enabled=false" + tty: true + +services: + web: + <<: [*default-proxy, *default-app] + build: + context: . + target: web + depends_on: + - php + profiles: [web] + + php: + <<: [*default-app] + build: + context: . + target: build + args: + - "DOCKER_UID=${DOCKER_UID:-1000}" + volumes: + - .:/app + depends_on: + - database + profiles: [php] + + database: + image: mariadb:10 + deploy: + resources: + limits: + cpus: "${DOCKER_MYSQL_CPUS:-0}" + memory: "${DOCKER_MYSQL_MEMORY:-0}" + volumes: + - db-data:/var/lib/mysql + + env_file: + - .env + labels: + - "traefik.enabled=false" + environment: + MYSQL_RANDOM_ROOT_PASSWORD: true + profiles: [database] + +volumes: + db-data: {} + +networks: + web: + external: true + name: traefik_proxy diff --git a/tests/snapshots/output/drupal-commerce-kickstart/run b/tests/snapshots/output/drupal-commerce-kickstart/run new file mode 100755 index 0000000..bb43b7e --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/run @@ -0,0 +1,111 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +set -o errexit +set -o pipefail + +# If we're running in CI we need to disable TTY allocation for docker compose +# commands that enable it by default, such as exec and run. +TTY="${TTY:-}" +if [[ ! -t 1 ]]; then + TTY="-T" +fi + +# Run automated tests as part of the Continuous Integration (CI) pipeline. +function ci:test { + lint:dockerfile + + docker compose version + + docker network create traefik_proxy + + cp --no-clobber .env.example .env + + docker compose build --progress plain + + docker compose up --detach + docker compose logs + + composer install --quiet --no-progress + + +} + +# Run a command within the php container. +function cmd { + docker compose exec php "${@}" +} + + +function composer { + _exec php composer "${@}" +} + +function drush { + _exec php drush "${@}" +} + +function git-hooks:off { + git config --unset core.hooksPath +} + +function git-hooks:on { + git config core.hooksPath .githooks +} + +# Display a list of all available commands. +function help { + printf "%s [args]\n\nTasks:\n" "${0}" + + compgen -A function | grep -v "^_" | cat -n + + printf "\nExtended help:\n Each task has comments for general usage\n" +} + +function lint:dockerfile { + docker container run --rm -i \ + hadolint/hadolint hadolint --ignore DL3008 --ignore DL3059 -t style "${@}" - < Dockerfile +} + + +function start { + cp -v --no-clobber .env.example .env + + docker compose up -d +} + + +function stop { + docker compose down +} + + +function test:commit { + + quality +} + +function _exec { + docker compose exec ${TTY} "${@}" +} + +function _run { + local service="${1}" + local command="${2}" + + docker compose run \ + --entrypoint "${command}" \ + --no-deps \ + --rm \ + ${TTY} \ + "${service}" "${@}" +} + +# Include any local tasks. +[[ -e run.local ]] && source run.local + +TIMEFORMAT=$'\nTask completed in %3lR' +time "${@:-help}" + +# vim: ft=bash diff --git a/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php b/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php new file mode 100755 index 0000000..dbd9900 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +[[ -f composer.json && ! -d vendor ]] && composer install + +eval "$@" diff --git a/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/php/root/usr/local/etc/php/php.ini b/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/php/root/usr/local/etc/php/php.ini new file mode 100644 index 0000000..aa883a1 --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/php/root/usr/local/etc/php/php.ini @@ -0,0 +1,4 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +max_vars_input = 1000 +memory_limit = 128M diff --git a/tests/snapshots/output/drupal-localgov/.dockerignore b/tests/snapshots/output/drupal-localgov/.dockerignore new file mode 100644 index 0000000..42366c5 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/.dockerignore @@ -0,0 +1 @@ +/README.md diff --git a/tests/snapshots/output/drupal-localgov/.env.example b/tests/snapshots/output/drupal-localgov/.env.example new file mode 100644 index 0000000..c4699ce --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/.env.example @@ -0,0 +1,12 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +export DOCKER_UID=1000 + +export COMPOSE_PROJECT_NAME=drupal-localgov +export COMPOSE_PROFILES=web,php,database + +export DOCKER_WEB_VOLUME=.:/app + +export MYSQL_DATABASE=app +export MYSQL_PASSWORD=app +export MYSQL_USER=app diff --git a/tests/snapshots/output/drupal-localgov/.githooks/prepare-commit-msg b/tests/snapshots/output/drupal-localgov/.githooks/prepare-commit-msg new file mode 100755 index 0000000..6ff8ea0 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/.githooks/prepare-commit-msg @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +# Load the issue ID from an `.issue-id` file within the project and replace the +# `ISSUE_ID` placeholder within a Git commit message. +# +# For example, running `echo "OD-123" > .issue-id` will add `Refs: OD-123` to +# the commit message. +# +# This also works with multiple issue IDs in the same string, e.g. +# "OD-123 OD-456", or IDs on multiple lines. + +set -o errexit +set -o nounset +set -o pipefail + +PROJECT_DIR=$(git rev-parse --show-toplevel) +ISSUE_FILE="$PROJECT_DIR/.issue-id" + +if [ -f "${ISSUE_FILE}" ]; then + ISSUE_IDS=$(cat "${ISSUE_FILE}" | tr '\n' ',' | tr ' ' ',' | sed 's/,$//' | sed 's/,/, /g') + + if [ -n "${ISSUE_IDS}" ]; then + sed -i.bak "s/# Refs:/Refs: $ISSUE_IDS/" "$1" + fi +fi diff --git a/tests/snapshots/output/drupal-localgov/.gitignore b/tests/snapshots/output/drupal-localgov/.gitignore new file mode 100644 index 0000000..f1df0c3 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/.gitignore @@ -0,0 +1,42 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +.editorconfig +.env +.gitattributes +vendor/ +web/.csslintrc +web/.eslintignore +web/.eslintrc.json +web/.ht.router.php +web/.htaccess +web/INSTALL.txt +web/README.md +web/autoload.php +web/core/ +web/example.gitignore +web/index.php +web/modules/README.txt +web/modules/contrib/ +web/profiles/README.txt +web/robots.txt +web/sites/*/files/ +web/sites/*/private/ +web/sites/*/services*.yml +web/sites/*/settings*.php +web/sites/README.txt +web/sites/default/default.services.yml +web/sites/default/default.settings.php +web/sites/development.services.yml +web/sites/example.settings.local.php +web/sites/example.sites.php +web/sites/simpletest/ +web/themes/README.txt +web/themes/contrib/ +web/update.php +web/web.config + +# Docker. +.env +docker-compose.override.yaml + + diff --git a/tests/snapshots/output/drupal-localgov/.hadolint.yaml b/tests/snapshots/output/drupal-localgov/.hadolint.yaml new file mode 100644 index 0000000..d87bf88 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/.hadolint.yaml @@ -0,0 +1,2 @@ +ignore: + - DL3059 diff --git a/tests/snapshots/output/drupal-localgov/Dockerfile b/tests/snapshots/output/drupal-localgov/Dockerfile new file mode 100644 index 0000000..e0b3f71 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/Dockerfile @@ -0,0 +1,65 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +FROM php:8.1-fpm-bullseye AS base + +COPY --from=composer:2 /usr/bin/composer /usr/bin/composer +RUN which composer && composer -V + +ARG DOCKER_UID=1000 +ENV DOCKER_UID="${DOCKER_UID}" + +WORKDIR /app + +RUN adduser --disabled-password --uid "${DOCKER_UID}" app \ + && chown app:app -R /app + +USER app + +ENV PATH="${PATH}:/app/bin:/app/vendor/bin" + +COPY --chown=app:app composer.* ./ + +################################################################################ + +FROM base AS build + +USER root + + +RUN apt-get update -yqq \ + && apt-get install -yqq --no-install-recommends \ + git libpng-dev libjpeg-dev libzip-dev mariadb-client unzip \ + && rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \ + && apt-get clean + +RUN docker-php-ext-configure gd --with-jpeg + +RUN docker-php-ext-install gd pdo_mysql zip + +COPY --chown=app:app phpunit.xml* ./ + +COPY --chown=app:app assets assets + + +USER app + +RUN composer validate --strict +RUN composer install + +COPY --chown=app:app tools/docker/images/php/root / + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"] +CMD ["php-fpm"] + + + + +################################################################################ + +FROM nginx:1 as web + +EXPOSE 8080 + +WORKDIR /app + +COPY tools/docker/images/web/root / diff --git a/tests/snapshots/output/drupal-localgov/docker-compose.yaml b/tests/snapshots/output/drupal-localgov/docker-compose.yaml new file mode 100644 index 0000000..fa1f56c --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/docker-compose.yaml @@ -0,0 +1,77 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +x-proxy: &default-proxy + networks: + - default + - web + labels: + - "traefik.docker.network=traefik_proxy" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host( + `${COMPOSE_PROJECT_NAME}.localhost`, + )" + +x-app: &default-app + volumes: + - "${DOCKER_WEB_VOLUME:-./web:/app/web}" + env_file: + - .env + restart: "${DOCKER_RESTART_POLICY:-unless-stopped}" + networks: + - default + deploy: + resources: + limits: + cpus: "${DOCKER_MYSQL_CPUS:-0}" + memory: "${DOCKER_MYSQL_MEMORY:-0}" + labels: + - "traefik.enabled=false" + tty: true + +services: + web: + <<: [*default-proxy, *default-app] + build: + context: . + target: web + depends_on: + - php + profiles: [web] + + php: + <<: [*default-app] + build: + context: . + target: build + args: + - "DOCKER_UID=${DOCKER_UID:-1000}" + volumes: + - .:/app + depends_on: + - database + profiles: [php] + + database: + image: mariadb:10 + deploy: + resources: + limits: + cpus: "${DOCKER_MYSQL_CPUS:-0}" + memory: "${DOCKER_MYSQL_MEMORY:-0}" + volumes: + - db-data:/var/lib/mysql + + env_file: + - .env + labels: + - "traefik.enabled=false" + environment: + MYSQL_RANDOM_ROOT_PASSWORD: true + profiles: [database] + +volumes: + db-data: {} + +networks: + web: + external: true + name: traefik_proxy diff --git a/tests/snapshots/output/drupal-localgov/run b/tests/snapshots/output/drupal-localgov/run new file mode 100755 index 0000000..bb43b7e --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/run @@ -0,0 +1,111 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +set -o errexit +set -o pipefail + +# If we're running in CI we need to disable TTY allocation for docker compose +# commands that enable it by default, such as exec and run. +TTY="${TTY:-}" +if [[ ! -t 1 ]]; then + TTY="-T" +fi + +# Run automated tests as part of the Continuous Integration (CI) pipeline. +function ci:test { + lint:dockerfile + + docker compose version + + docker network create traefik_proxy + + cp --no-clobber .env.example .env + + docker compose build --progress plain + + docker compose up --detach + docker compose logs + + composer install --quiet --no-progress + + +} + +# Run a command within the php container. +function cmd { + docker compose exec php "${@}" +} + + +function composer { + _exec php composer "${@}" +} + +function drush { + _exec php drush "${@}" +} + +function git-hooks:off { + git config --unset core.hooksPath +} + +function git-hooks:on { + git config core.hooksPath .githooks +} + +# Display a list of all available commands. +function help { + printf "%s [args]\n\nTasks:\n" "${0}" + + compgen -A function | grep -v "^_" | cat -n + + printf "\nExtended help:\n Each task has comments for general usage\n" +} + +function lint:dockerfile { + docker container run --rm -i \ + hadolint/hadolint hadolint --ignore DL3008 --ignore DL3059 -t style "${@}" - < Dockerfile +} + + +function start { + cp -v --no-clobber .env.example .env + + docker compose up -d +} + + +function stop { + docker compose down +} + + +function test:commit { + + quality +} + +function _exec { + docker compose exec ${TTY} "${@}" +} + +function _run { + local service="${1}" + local command="${2}" + + docker compose run \ + --entrypoint "${command}" \ + --no-deps \ + --rm \ + ${TTY} \ + "${service}" "${@}" +} + +# Include any local tasks. +[[ -e run.local ]] && source run.local + +TIMEFORMAT=$'\nTask completed in %3lR' +time "${@:-help}" + +# vim: ft=bash diff --git a/tests/snapshots/output/drupal-localgov/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php b/tests/snapshots/output/drupal-localgov/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php new file mode 100755 index 0000000..dbd9900 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +[[ -f composer.json && ! -d vendor ]] && composer install + +eval "$@" diff --git a/tests/snapshots/output/drupal-localgov/tools/docker/images/php/root/usr/local/etc/php/php.ini b/tests/snapshots/output/drupal-localgov/tools/docker/images/php/root/usr/local/etc/php/php.ini new file mode 100644 index 0000000..aa883a1 --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/tools/docker/images/php/root/usr/local/etc/php/php.ini @@ -0,0 +1,4 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +max_vars_input = 1000 +memory_limit = 128M