diff --git a/.ahoy.yml b/.ahoy.yml index 014ddd59e..c52eb724e 100644 --- a/.ahoy.yml +++ b/.ahoy.yml @@ -10,11 +10,11 @@ # Run `ahoy up cli` to apply environment variables changes to containers. #; #; Comments starting with '#:' provide explicit documentation and will be -#; automatically removed during installation or update of Scaffold if an option +#; automatically removed during installation or update of Vortex if an option #; is selected. #; -#; Comments starting with '#;<' and '#;>' are internal Scaffold comments -#; and will be removed during installation or update of Scaffold. +#; Comments starting with '#;<' and '#;>' are internal Vortex comments +#; and will be removed during installation or update of Vortex. --- ahoyapi: v2 @@ -29,24 +29,24 @@ commands: ahoy fei # Install front-end dependencies. ahoy fe # Build front-end assets. ahoy provision # Provision the site. - DREVOPS_SHOW_LOGIN=1 ahoy info # Show information and a login link. + VORTEX_SHOW_LOGIN=1 ahoy info # Show information and a login link. info: usage: Show information about this project. cmd: | COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-${PWD##*/}} \ - DREVOPS_HOST_DB_PORT=$(docker compose port mariadb 3306 2>/dev/null | cut -d : -f 2) \ - DREVOPS_HOST_SOLR_PORT=$(docker compose port solr 8983 2>/dev/null | cut -d : -f 2) \ - DREVOPS_HOST_SELENIUM_VNC_PORT=$(docker compose port chrome 7900 2>/dev/null | cut -d : -f 2) \ - DREVOPS_HOST_HAS_SEQUELACE=$(uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null | grep -q "Ace" && echo 1 || true) \ - ahoy cli ./scripts/drevops/info.sh "$@" + VORTEX_HOST_DB_PORT=$(docker compose port mariadb 3306 2>/dev/null | cut -d : -f 2) \ + VORTEX_HOST_SOLR_PORT=$(docker compose port solr 8983 2>/dev/null | cut -d : -f 2) \ + VORTEX_HOST_SELENIUM_VNC_PORT=$(docker compose port chrome 7900 2>/dev/null | cut -d : -f 2) \ + VORTEX_HOST_HAS_SEQUELACE=$(uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null | grep -q "Ace" && echo 1 || true) \ + ahoy cli ./scripts/vortex/info.sh "$@" db: usage: Open DB in Sequel Ace. cmd: | uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null |grep -q "Ace" \ - && DREVOPS_HOST_DB_PORT="$(docker port $(docker compose ps -q mariadb 2>/dev/null) 3306 2>/dev/null | cut -d : -f 2)" \ - && open "mysql://${MARIADB_USERNAME:-drupal}:${MARIADB_PASSWORD:-drupal}@127.0.0.1:${DREVOPS_HOST_DB_PORT}/drupal" -a "Sequel Ace" \ + && VORTEX_HOST_DB_PORT="$(docker port $(docker compose ps -q mariadb 2>/dev/null) 3306 2>/dev/null | cut -d : -f 2)" \ + && open "mysql://${MARIADB_USERNAME:-drupal}:${MARIADB_PASSWORD:-drupal}@127.0.0.1:${VORTEX_HOST_DB_PORT}/drupal" -a "Sequel Ace" \ || echo "Not a supported OS or Sequel Ace is not installed." # ---------------------------------------------------------------------------- @@ -93,9 +93,9 @@ commands: # arguments that contain spaces. cmd: | if [ "${#}" -ne 0 ]; then - docker compose exec $(env | cut -f1 -d= | grep "TERM\|COMPOSE_\|GITHUB_\|DOCKER_\|DRUPAL_\|DREVOPS_" | sed 's/^/-e /') -T cli bash -c "$*" + docker compose exec $(env | cut -f1 -d= | grep "TERM\|COMPOSE_\|GITHUB_\|DOCKER_\|DRUPAL_\|VORTEX_" | sed 's/^/-e /') -T cli bash -c "$*" else - docker compose exec $(env | cut -f1 -d= | grep "TERM\|COMPOSE_\|GITHUB_\|DOCKER_\|DRUPAL_\|DREVOPS_" | sed 's/^/-e /') cli bash + docker compose exec $(env | cut -f1 -d= | grep "TERM\|COMPOSE_\|GITHUB_\|DOCKER_\|DRUPAL_\|VORTEX_" | sed 's/^/-e /') cli bash fi composer: @@ -107,7 +107,7 @@ commands: drush: usage: Run Drush commands in the CLI service container. - cmd: ahoy cli "vendor/bin/drush -l \${DREVOPS_LOCALDEV_URL} $*" + cmd: ahoy cli "vendor/bin/drush -l \${VORTEX_LOCALDEV_URL} $*" #;< REDIS flush-redis: @@ -122,12 +122,12 @@ commands: login: usage: Login to a website. # Unblock user 1 and generate a one time login link. - cmd: ahoy cli ./scripts/drevops/login.sh + cmd: ahoy cli ./scripts/vortex/login.sh #;< !PROVISION_USE_PROFILE download-db: usage: Download database. - cmd: ./scripts/drevops/download-db.sh + cmd: ./scripts/vortex/download-db.sh #;> !PROVISION_USE_PROFILE reload-db: @@ -139,43 +139,43 @@ commands: ahoy up wait_dependencies && \ sleep 15 && \ ahoy provision && \ - DREVOPS_SHOW_LOGIN=1 ahoy info + VORTEX_SHOW_LOGIN=1 ahoy info provision: usage: Provision a site from the database dump or profile. - cmd: ahoy cli ./scripts/drevops/provision.sh + cmd: ahoy cli ./scripts/vortex/provision.sh export-db: - usage: Export database dump or database image (if DREVOPS_DB_IMAGE variable is set). - cmd: ./scripts/drevops/export-db.sh "$@" + usage: Export database dump or database image (if VORTEX_DB_IMAGE variable is set). + cmd: ./scripts/vortex/export-db.sh "$@" pull-db: usage: Download database image with the latest nightly dump. Run "ahoy reload-db" to reload DB in the running stack. - cmd: \[ -n "${DREVOPS_DB_IMAGE}" \] && docker pull ${DREVOPS_DB_IMAGE} || true + cmd: \[ -n "${VORTEX_DB_IMAGE}" \] && docker pull ${VORTEX_DB_IMAGE} || true reset: usage: "Remove containers, all build files. Use with `hard` to reset repository to the last commit." cmd: | ahoy confirm "All containers and build files will be removed. Proceed?" && - AHOY_CONFIRM_RESPONSE=y ahoy down && ./scripts/drevops/reset.sh "$@" + AHOY_CONFIRM_RESPONSE=y ahoy down && ./scripts/vortex/reset.sh "$@" fei: usage: Install front-end assets. - cmd: ahoy cli "npm --prefix ${DREVOPS_WEBROOT}/themes/custom/${DRUPAL_THEME} install" + cmd: ahoy cli "npm --prefix ${VORTEX_WEBROOT}/themes/custom/${DRUPAL_THEME} install" fe: usage: Build front-end assets. - cmd: ahoy cli "cd ${DREVOPS_WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run build" + cmd: ahoy cli "cd ${VORTEX_WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run build" fed: usage: Build front-end assets for development. - cmd: ahoy cli "cd ${DREVOPS_WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run build-dev" + cmd: ahoy cli "cd ${VORTEX_WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run build-dev" few: usage: Watch front-end assets during development. cmd: | ahoy cli "pkill -9 -f grunt" || true - ahoy cli "cd ${DREVOPS_WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run watch" + ahoy cli "cd ${VORTEX_WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run watch" lint: usage: Lint back-end and front-end code. @@ -193,7 +193,7 @@ commands: usage: Lint front-end code. cmd: | ahoy cli vendor/bin/twig-cs-fixer lint - ahoy cli "npm run --prefix \${DREVOPS_WEBROOT}/themes/custom/\${DRUPAL_THEME} lint" + ahoy cli "npm run --prefix \${VORTEX_WEBROOT}/themes/custom/\${DRUPAL_THEME} lint" lint-tests: usage: Lint tests code. @@ -214,7 +214,7 @@ commands: usage: Fix lint issues of front-end code. cmd: | ahoy cli vendor/bin/twig-cs-fixer lint --fix - ahoy cli "npm run --prefix \${DREVOPS_WEBROOT}/themes/custom/\${DRUPAL_THEME} lint-fix" + ahoy cli "npm run --prefix \${VORTEX_WEBROOT}/themes/custom/\${DRUPAL_THEME} lint-fix" test: usage: Run all tests. @@ -244,21 +244,21 @@ commands: 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', 'container_registry', 'webhook')" && - ./scripts/drevops/deploy.sh "$@" + ./scripts/vortex/deploy.sh "$@" github-labels: usage: Update project's GitHub labels. - cmd: ./scripts/drevops/github-labels.sh "$@" + cmd: ./scripts/vortex/github-labels.sh "$@" doctor: usage: Find problems with current project setup. - cmd: ./scripts/drevops/doctor.sh "$@" + cmd: ./scripts/vortex/doctor.sh "$@" - update-scaffold: + update-vortex: usage: Update DrevOps stack. cmd: | ahoy confirm "Some committed files may become overwritten. Proceed?" && - ./scripts/drevops/update-scaffold.sh $@ + ./scripts/vortex/update-vortex.sh $@ local: usage: Custom local commands. See `ahoy local help`. diff --git a/.circleci/config.yml b/.circleci/config.yml index ecd490ac4..c37d95168 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,8 +8,8 @@ # controlled by CircleCI. # The "runner" container uses Docker client to control the remote Docker server. #; -#; Comments starting with '#;<' and '#;>' are internal Scaffold comments -#; and will be removed during installation or update of Scaffold. +#; Comments starting with '#;<' and '#;>' are internal Vortex comments +#; and will be removed during installation or update of Vortex. version: '2.1' aliases: @@ -38,9 +38,9 @@ aliases: working_directory: &working_directory ~/project environment: #;< !PROVISION_USE_PROFILE - DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT: *db_ssh_fingerprint + VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT: *db_ssh_fingerprint #;> !PROVISION_USE_PROFILE - DREVOPS_DEPLOY_SSH_FINGERPRINT: *deploy_ssh_fingerprint + VORTEX_DEPLOY_SSH_FINGERPRINT: *deploy_ssh_fingerprint docker: # Using the 'runner' container where each job will be executed. # This container has all the necessary tools to run a dockerized environment. @@ -48,8 +48,8 @@ aliases: # @see https://hub.docker.com/repository/docker/drevops/ci-runner/tags - image: drevops/ci-runner:24.8.0 auth: - username: ${DREVOPS_CONTAINER_REGISTRY_USER} - password: ${DREVOPS_CONTAINER_REGISTRY_PASS} + username: ${VORTEX_CONTAINER_REGISTRY_USER} + password: ${VORTEX_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 @@ -58,28 +58,28 @@ aliases: TERM: xterm-256color #;< !PROVISION_USE_PROFILE # How often to refresh the cache of the DB dump. Refer to `date` command. - DREVOPS_CI_DB_CACHE_TIMESTAMP: +%Y%m%d + VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d # Use previous database caches on this branch as a fallback if the above cache # does not match (for example, the cache is available only from the previous # day). If "no" is set, the cache will be rebuilt from scratch. - DREVOPS_CI_DB_CACHE_FALLBACK: "yes" + VORTEX_CI_DB_CACHE_FALLBACK: "yes" # Which branch to use as a source of DB caches. - DREVOPS_CI_DB_CACHE_BRANCH: "develop" + VORTEX_CI_DB_CACHE_BRANCH: "develop" #;> !PROVISION_USE_PROFILE # Directory to store test results. - DREVOPS_CI_TEST_RESULTS: &test_results /tmp/tests + VORTEX_CI_TEST_RESULTS: &test_results /tmp/tests # Directory to store test artifacts. - DREVOPS_CI_ARTIFACTS: &artifacts /tmp/artifacts + VORTEX_CI_ARTIFACTS: &artifacts /tmp/artifacts # Directory to store code exported between jobs. - DREVOPS_EXPORT_CODE_DIR: &drevops_build_export_dir /tmp/workspace/code + VORTEX_EXPORT_CODE_DIR: &drevops_build_export_dir /tmp/workspace/code # Directory to use for artifact deployments. - DREVOPS_DEPLOY_ARTIFACT_SRC: *drevops_build_export_dir + VORTEX_DEPLOY_ARTIFACT_SRC: *drevops_build_export_dir # Source code location for artifact deployments. - DREVOPS_DEPLOY_ARTIFACT_ROOT: *working_directory + VORTEX_DEPLOY_ARTIFACT_ROOT: *working_directory # Report file location for artifact deployments. - DREVOPS_DEPLOY_ARTIFACT_LOG: /tmp/artifacts/deployment_log.txt + VORTEX_DEPLOY_ARTIFACT_LOG: /tmp/artifacts/deployment_log.txt # Check only minimal stack requirements. - DREVOPS_DOCTOR_CHECK_MINIMAL: 1 + VORTEX_DOCTOR_CHECK_MINIMAL: 1 # CI runner resource class. # @see https://circleci.com/docs/2.0/configuration-reference/#resource_class # Change to 'large' for faster builds. @@ -113,10 +113,10 @@ aliases: jobs: #;< !PROVISION_USE_PROFILE # Database handling is a first step of the build. - # - $DREVOPS_CI_DB_CACHE_TIMESTAMP is used to determine if a fresh DB dump + # - $VORTEX_CI_DB_CACHE_TIMESTAMP is used to determine if a fresh DB dump # should be downloaded for the current build. Usually, a daily database dump # is sufficient for development activities. - # - $DREVOPS_CI_DB_CACHE_FALLBACK is used if the cache did not match $DREVOPS_CI_DB_CACHE_TIMESTAMP. + # - $VORTEX_CI_DB_CACHE_FALLBACK is used if the cache did not match $VORTEX_CI_DB_CACHE_TIMESTAMP. # This allows to rely on the cache from the previous days within the same branch. database: &job-database <<: *runner_config @@ -136,9 +136,9 @@ jobs: - run: name: Create cache keys for database caching as files command: | - echo "${DREVOPS_CI_DB_CACHE_BRANCH}" | tee /tmp/db_cache_branch - echo "${DREVOPS_CI_DB_CACHE_FALLBACK/no/${CIRCLE_BUILD_NUM}}" | tee /tmp/db_cache_fallback - echo "$(date ${DREVOPS_CI_DB_CACHE_TIMESTAMP})" | tee /tmp/db_cache_timestamp + echo "${VORTEX_CI_DB_CACHE_BRANCH}" | tee /tmp/db_cache_branch + echo "${VORTEX_CI_DB_CACHE_FALLBACK/no/${CIRCLE_BUILD_NUM}}" | tee /tmp/db_cache_fallback + echo "$(date ${VORTEX_CI_DB_CACHE_TIMESTAMP})" | tee /tmp/db_cache_timestamp echo "yes" | tee /tmp/db_cache_fallback_yes echo 'v24.8.0-db10-{{ checksum "/tmp/db_cache_branch" }}-{{ checksum "/tmp/db_cache_fallback" }}-{{ checksum "/tmp/db_cache_timestamp" }}' @@ -156,7 +156,7 @@ jobs: - run: name: Download DB - command: DREVOPS_DB_DOWNLOAD_SEMAPHORE=/tmp/download-db-success ./scripts/drevops/download-db.sh + command: VORTEX_DB_DOWNLOAD_SEMAPHORE=/tmp/download-db-success ./scripts/vortex/download-db.sh no_output_timeout: 30m # Execute commands after database download script finished: if the @@ -169,12 +169,12 @@ jobs: 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-container-registry.sh + ./scripts/vortex/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" - grep -q ^DREVOPS_DB_IMAGE .env && rm .data/db.sql || true - ./scripts/drevops/export-db.sh db.sql + docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 ./scripts/vortex/provision.sh" + grep -q ^VORTEX_DB_IMAGE .env && rm .data/db.sql || true + ./scripts/vortex/export-db.sh db.sql no_output_timeout: 30m - save_cache: @@ -190,14 +190,14 @@ jobs: database-nightly: <<: *job-database environment: - DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT: *db_ssh_fingerprint - DREVOPS_DEPLOY_SSH_FINGERPRINT: *deploy_ssh_fingerprint + VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT: *db_ssh_fingerprint + VORTEX_DEPLOY_SSH_FINGERPRINT: *deploy_ssh_fingerprint # Enforce fresh DB build (do not rely on fallback caches). - DREVOPS_CI_DB_CACHE_FALLBACK: 'no' + VORTEX_CI_DB_CACHE_FALLBACK: 'no' # Always use fresh base image for the database (if database-in-image storage is used). - DREVOPS_DB_IMAGE_BASE: drevops/mariadb-drupal-data:24.4.0 + VORTEX_DB_IMAGE_BASE: drevops/mariadb-drupal-data:24.4.0 # Deploy container image (if database-in-image storage is used). - DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1 + VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1 #;> !PROVISION_USE_PROFILE # Build and test is a second step of the build. The testing is performed @@ -218,9 +218,9 @@ jobs: - run: name: Set cache keys for database caching command: | - echo "${DREVOPS_CI_DB_CACHE_BRANCH}" | tee /tmp/db_cache_branch + echo "${VORTEX_CI_DB_CACHE_BRANCH}" | tee /tmp/db_cache_branch echo "yes" | tee /tmp/db_cache_fallback_yes - echo "$(date ${DREVOPS_CI_DB_CACHE_TIMESTAMP})" | tee /tmp/db_cache_timestamp + echo "$(date ${VORTEX_CI_DB_CACHE_TIMESTAMP})" | tee /tmp/db_cache_timestamp - restore_cache: keys: @@ -234,12 +234,12 @@ jobs: name: Lint Dockerfiles with Hadolint command: | for file in $(find .docker -name 'Dockerfile' -o -name '*.dockerfile'); do - echo "Linting ${file}" && cat "${file}" | docker run --rm -i hadolint/hadolint || [ "${DREVOPS_CI_HADOLINT_IGNORE_FAILURE:-0}" -eq 1 ] + echo "Linting ${file}" && cat "${file}" | docker run --rm -i hadolint/hadolint || [ "${VORTEX_CI_HADOLINT_IGNORE_FAILURE:-0}" -eq 1 ] done - run: name: Login to container registry - command: ./scripts/drevops/login-container-registry.sh + command: ./scripts/vortex/login-container-registry.sh - run: name: Build stack @@ -248,12 +248,12 @@ jobs: - run: name: Export built codebase command: | - mkdir -p "${DREVOPS_EXPORT_CODE_DIR}" - docker compose cp -L cli:"/app/." "${DREVOPS_EXPORT_CODE_DIR}" + mkdir -p "${VORTEX_EXPORT_CODE_DIR}" + docker compose cp -L cli:"/app/." "${VORTEX_EXPORT_CODE_DIR}" - run: name: Validate Composer configuration - command: docker compose exec cli composer validate --strict || [ "${DREVOPS_CI_COMPOSER_VALIDATE_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec cli composer validate --strict || [ "${VORTEX_CI_COMPOSER_VALIDATE_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Install development dependencies @@ -264,31 +264,31 @@ jobs: - run: name: Lint code with PHPCS - command: docker compose exec -T cli vendor/bin/phpcs || [ "${DREVOPS_CI_PHPCS_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli vendor/bin/phpcs || [ "${VORTEX_CI_PHPCS_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Lint code with PHPStan - command: docker compose exec -T cli vendor/bin/phpstan || [ "${DREVOPS_CI_PHPSTAN_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli vendor/bin/phpstan || [ "${VORTEX_CI_PHPSTAN_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Lint code with Rector - command: docker compose exec -T cli vendor/bin/rector --clear-cache --dry-run || [ "${DREVOPS_CI_RECTOR_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli vendor/bin/rector --clear-cache --dry-run || [ "${VORTEX_CI_RECTOR_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Lint code with PHPMD - command: docker compose exec -T cli vendor/bin/phpmd . text phpmd.xml || [ "${DREVOPS_CI_PHPMD_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli vendor/bin/phpmd . text phpmd.xml || [ "${VORTEX_CI_PHPMD_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Lint code with Twig CS Fixer - command: docker compose exec -T cli vendor/bin/twig-cs-fixer || [ "${DREVOPS_CI_TWIG_CS_FIXER_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli vendor/bin/twig-cs-fixer || [ "${VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Lint code with Gherkin Lint - command: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features || [ "${DREVOPS_CI_GHERKIN_LINT_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features || [ "${VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Lint code with NPM linters - command: docker compose exec -T cli bash -c "npm run --prefix \${DREVOPS_WEBROOT}/themes/custom/\${DRUPAL_THEME} lint" || [ "${DREVOPS_CI_NPM_LINT_IGNORE_FAILURE:-0}" -eq 1 ] + command: docker compose exec -T cli bash -c "npm run --prefix \${VORTEX_WEBROOT}/themes/custom/\${DRUPAL_THEME} lint" || [ "${VORTEX_CI_NPM_LINT_IGNORE_FAILURE:-0}" -eq 1 ] - run: name: Provision site @@ -297,34 +297,34 @@ jobs: docker compose exec cli mkdir -p .data docker compose cp -L .data/db.sql cli:/app/.data/db.sql fi - docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli ./scripts/drevops/provision.sh + docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli ./scripts/vortex/provision.sh no_output_timeout: 30m - run: name: Test with PHPUnit command: | XDEBUG_ENABLE=true docker compose up -d cli php nginx # Restart stack with XDEBUG enabled for coverage. - docker compose exec -T -e XDEBUG_MODE=coverage cli vendor/bin/phpunit || [ "${DREVOPS_CI_PHPUNIT_IGNORE_FAILURE:-0}" -eq 1 ] + docker compose exec -T -e XDEBUG_MODE=coverage cli vendor/bin/phpunit || [ "${VORTEX_CI_PHPUNIT_IGNORE_FAILURE:-0}" -eq 1 ] docker compose up -d cli php nginx # Restart stack without XDEBUG enabled for coverage. - run: name: Test with Behat command: | - if [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ]; then export DREVOPS_CI_BEHAT_PROFILE="${DREVOPS_CI_BEHAT_PROFILE:-p${CIRCLE_NODE_INDEX}}"; fi - echo "Running with ${DREVOPS_CI_BEHAT_PROFILE:-default} profile" - docker compose exec -T cli php -d memory_limit=-1 vendor/bin/behat --colors --strict --profile="${DREVOPS_CI_BEHAT_PROFILE:-default}" || \ - docker compose exec -T cli php -d memory_limit=-1 vendor/bin/behat --colors --strict --rerun --profile="${DREVOPS_CI_BEHAT_PROFILE:-default}" || \ - [ "${DREVOPS_CI_BEHAT_IGNORE_FAILURE:-0}" -eq 1 ] + if [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ]; then export VORTEX_CI_BEHAT_PROFILE="${VORTEX_CI_BEHAT_PROFILE:-p${CIRCLE_NODE_INDEX}}"; fi + echo "Running with ${VORTEX_CI_BEHAT_PROFILE:-default} profile" + docker compose exec -T cli php -d memory_limit=-1 vendor/bin/behat --colors --strict --profile="${VORTEX_CI_BEHAT_PROFILE:-default}" || \ + docker compose exec -T cli php -d memory_limit=-1 vendor/bin/behat --colors --strict --rerun --profile="${VORTEX_CI_BEHAT_PROFILE:-default}" || \ + [ "${VORTEX_CI_BEHAT_IGNORE_FAILURE:-0}" -eq 1 ] no_output_timeout: 30m - run: name: Process test logs and artifacts command: | - mkdir -p "${DREVOPS_CI_TEST_RESULTS}" "${DREVOPS_CI_ARTIFACTS}" + mkdir -p "${VORTEX_CI_TEST_RESULTS}" "${VORTEX_CI_ARTIFACTS}" if docker compose ps --services --filter "status=running" | grep -q cli && docker compose exec cli test -d /app/.logs; then - docker compose cp cli:/app/.logs/. "${DREVOPS_CI_ARTIFACTS}/" + docker compose cp cli:/app/.logs/. "${VORTEX_CI_ARTIFACTS}/" if docker compose exec -T cli sh -c '[ -d /app/.logs/test_results/ ]'; then - docker compose cp cli:/app/.logs/test_results/. "${DREVOPS_CI_TEST_RESULTS}/" + docker compose cp cli:/app/.logs/test_results/. "${VORTEX_CI_TEST_RESULTS}/" fi fi when: always @@ -361,10 +361,10 @@ jobs: - run: command: | - DREVOPS_DEPLOY_BRANCH="${CIRCLE_BRANCH}" \ - DREVOPS_DEPLOY_PR="$(echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f 7)" \ - DREVOPS_DEPLOY_PR_HEAD=${CIRCLE_SHA1} \ - ./scripts/drevops/deploy.sh + VORTEX_DEPLOY_BRANCH="${CIRCLE_BRANCH}" \ + VORTEX_DEPLOY_PR="$(echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f 7)" \ + VORTEX_DEPLOY_PR_HEAD=${CIRCLE_SHA1} \ + ./scripts/vortex/deploy.sh no_output_timeout: 30m - store_artifacts: @@ -385,7 +385,7 @@ jobs: - *step_process_codebase_for_ci - run: - command: DREVOPS_DEPLOY_MODE="tag" ./scripts/drevops/deploy.sh + command: VORTEX_DEPLOY_MODE="tag" ./scripts/vortex/deploy.sh no_output_timeout: 30m - store_artifacts: @@ -413,15 +413,15 @@ jobs: #;> RENOVATEBOT #;============================================================================ - #; Scaffold development section. Removed during Scaffold installation/update. + #; Vortex development section. Removed during Vortex installation/update. #;============================================================================ #;< SCAFFOLD_DEV #----------------------------------------------------------------------------- - # Test suite for Scaffold. + # Test suite for Vortex. #----------------------------------------------------------------------------- - # Run Scaffold tests after 'build' job to test CircleCI's configuration. - scaffold-dev-test-ci-postbuild: + # Run Vortex tests after 'build' job to test CircleCI's configuration. + vortex-dev-test-ci-postbuild: <<: *runner_config steps: - checkout @@ -431,7 +431,7 @@ jobs: - 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 + command: SCAFFOLD_DEV_VOLUMES_MOUNTED=0 SCAFFOLD_DEV_TEST_COVERAGE_DIR=/tmp/artifacts/coverage .vortex/tests/test.postbuild.sh - store_test_results: path: *test_results @@ -449,83 +449,83 @@ jobs: # # Switching between "database in file" (DIF, mounted data volume) and # "database-in-image" (DIDI, data volume is a part of the image) is - # done by providing the value of DREVOPS_DB_IMAGE environment variable, + # done by providing the value of VORTEX_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 + # This means that there should be the following tests for Vortex # 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 # # Since we need to have "database" job generic for consumer sites and any # logic is controlled within DrevOps scripts, we have to create additional - # test jobs below and run them as a part of the CI system for Scaffold itself. + # test jobs below and run them as a part of the CI system for Vortex itself. # # Job to test creation of the image from DB dump file when using - # DREVOPS_DB_IMAGE workflow. - scaffold-dev-didi-database-fi: + # VORTEX_DB_IMAGE workflow. + vortex-dev-didi-database-fi: <<: *job-database environment: - DREVOPS_DB_DOWNLOAD_SOURCE: curl - DREVOPS_DB_DOWNLOAD_FORCE: 1 + VORTEX_DB_DOWNLOAD_SOURCE: curl + VORTEX_DB_DOWNLOAD_FORCE: 1 # 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 + # have VORTEX_DB_IMAGE variable set and this environment variable # would not be required. # # Note that here and below we are using "destination" demo image - this # is to allow updating of this image from CI tests without jeopardizing # main demo image. - DREVOPS_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x + VORTEX_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_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: scaffold-dev-didi-database-fi + VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: vortex-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_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1 + VORTEX_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 + VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-fi # Job to test creation of the image from the previous version of the image # when using database-in-image workflow. - scaffold-dev-database-ii: + vortex-dev-database-ii: <<: *job-database environment: - 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_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: scaffold-dev-database-ii + VORTEX_DB_DOWNLOAD_SOURCE: VORTEX_CONTAINER_REGISTRY + VORTEX_DB_DOWNLOAD_FORCE: 1 + VORTEX_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x + VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: vortex-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_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1 + VORTEX_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 + VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-ii # Job to test build of the image from the previous stage of the image when - # using database-in-image workflow. Overwriting just the DREVOPS_DB_IMAGE + # using database-in-image workflow. Overwriting just the VORTEX_DB_IMAGE # variable should change the storage mechanisms, but preserve application-level # stack operation. - scaffold-dev-didi-build-fi: + vortex-dev-didi-build-fi: <<: *job_build environment: - DREVOPS_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x:drevops_dev_didi_database_fi + VORTEX_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x:drevops_dev_didi_database_fi # 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 + VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-fi - scaffold-dev-didi-build-ii: + vortex-dev-didi-build-ii: <<: *job_build environment: - DREVOPS_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x:drevops_dev_database_ii + VORTEX_DB_IMAGE: drevops/drevops-mariadb-drupal-data-demo-destination-10.x:drevops_dev_database_ii # 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 + VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-ii #============================================================================= #;> SCAFFOLD_DEV @@ -585,36 +585,36 @@ workflows: #;> DEPLOYMENT #;============================================================================ - #; Scaffold development section. Removed during Scaffold installation/update. + #; Vortex development section. Removed during Vortex installation/update. #;============================================================================ #; #;< SCAFFOLD_DEV - # Run functional tests for Scaffold. + # Run functional tests for Vortex. # Note that these jobs must run within the "commit" workflow, because they # depend on the "build" job. # Run tests after 'build' job. - - scaffold-dev-test-ci-postbuild: + - vortex-dev-test-ci-postbuild: requires: - build filters: tags: only: /.*/ - # Test workflow to test DREVOPS_DB_IMAGE workflow for DB from file. - scaffold-dev-didi-fi: + # Test workflow to test VORTEX_DB_IMAGE workflow for DB from file. + vortex-dev-didi-fi: jobs: - - scaffold-dev-didi-database-fi - - scaffold-dev-didi-build-fi: + - vortex-dev-didi-database-fi + - vortex-dev-didi-build-fi: requires: - - scaffold-dev-didi-database-fi + - vortex-dev-didi-database-fi - # Test workflow to test DREVOPS_DB_IMAGE workflow for DB from the container registry. - scaffold-dev-didi-ii: + # Test workflow to test VORTEX_DB_IMAGE workflow for DB from the container registry. + vortex-dev-didi-ii: jobs: - - scaffold-dev-database-ii - - scaffold-dev-didi-build-ii: + - vortex-dev-database-ii + - vortex-dev-didi-build-ii: requires: - - scaffold-dev-database-ii + - vortex-dev-database-ii #============================================================================= #;> SCAFFOLD_DEV diff --git a/.env b/.env index 2454a6d10..f5ba7654b 100644 --- a/.env +++ b/.env @@ -25,13 +25,13 @@ # Drives internal naming within the codebase. # Does not affect the names of containers and development URL - those depend on # the project directory and can be overridden with $COMPOSE_PROJECT_NAME. -DREVOPS_PROJECT=your_site +VORTEX_PROJECT=your_site # Name of the webroot directory with Drupal codebase. -DREVOPS_WEBROOT=web +VORTEX_WEBROOT=web # The timezone for the containers. -DREVOPS_TZ="Australia/Melbourne" +VORTEX_TZ="Australia/Melbourne" ################################################################################ # DRUPAL # @@ -75,28 +75,28 @@ DRUPAL_CLAMAV_MODE=daemon # @see https://docs.drevops.com/workflows/provision # Set to 1 to install a site from profile instead of the database file dump. -DREVOPS_PROVISION_USE_PROFILE=0 +VORTEX_PROVISION_USE_PROFILE=0 # Overwrite existing database if it exists. # # Usually set to 0 in deployed environments and can be temporary set to 1 for # a specific deployment. # Set this to 1 in .env.local to override when developing locally. -DREVOPS_PROVISION_OVERRIDE_DB=0 +VORTEX_PROVISION_OVERRIDE_DB=0 # Skip database sanitization. # # Database sanitization is enabled by default in all non-production # environments and is always skipped in the production environment. -DREVOPS_PROVISION_SANITIZE_DB_SKIP=0 +VORTEX_PROVISION_SANITIZE_DB_SKIP=0 # Sanitization email pattern. Sanitization is enabled by default in all # non-production environments. # @see https://docs.drevops.com/workflows/build#sanitization -DREVOPS_PROVISION_SANITIZE_DB_EMAIL="user_%uid@your-site-url.example" +VORTEX_PROVISION_SANITIZE_DB_EMAIL="user_%uid@your-site-url.example" # Put the site into a maintenance mode during site provisioning. -DREVOPS_PROVISION_USE_MAINTENANCE_MODE=1 +VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ # DATABASE # @@ -111,15 +111,15 @@ DREVOPS_PROVISION_USE_MAINTENANCE_MODE=1 # @see https://docs.drevops.com/workflows/database # Database dump directory. -DREVOPS_DB_DIR=./.data +VORTEX_DB_DIR=./.data # Database dump file name. -DREVOPS_DB_FILE=db.sql +VORTEX_DB_FILE=db.sql # 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 +# VORTEX_DB_IMAGE=your_org/your_site:latest #;< !PROVISION_USE_PROFILE # Database can be sourced from one of the following locations: @@ -132,42 +132,42 @@ DREVOPS_DB_FILE=db.sql # - `none` - not downloaded, site is freshly installed for every build. # 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 +# database storage (when $VORTEX_DB_IMAGE variable has a value). +VORTEX_DB_DOWNLOAD_SOURCE=curl -#;< DREVOPS_DB_DOWNLOAD_SOURCE_CURL +#;< VORTEX_DB_DOWNLOAD_SOURCE_CURL # Database dump file sourced from CURL, with optional HTTP Basic Authentication # credentials embedded into the value. -DREVOPS_DB_DOWNLOAD_CURL_URL= -#;> DREVOPS_DB_DOWNLOAD_SOURCE_CURL +VORTEX_DB_DOWNLOAD_CURL_URL= +#;> VORTEX_DB_DOWNLOAD_SOURCE_CURL # Environment to download the database from. -DREVOPS_DB_DOWNLOAD_ENVIRONMENT=prod +VORTEX_DB_DOWNLOAD_ENVIRONMENT=prod #;> !PROVISION_USE_PROFILE #;< FTP # Database dump file sourced from FTP. # Database dump FTP host. -DREVOPS_DB_DOWNLOAD_FTP_HOST= +VORTEX_DB_DOWNLOAD_FTP_HOST= # Database dump FTP port. -DREVOPS_DB_DOWNLOAD_FTP_PORT=21 +VORTEX_DB_DOWNLOAD_FTP_PORT=21 # Database dump FTP file name. -DREVOPS_DB_DOWNLOAD_FTP_FILE=db.sql +VORTEX_DB_DOWNLOAD_FTP_FILE=db.sql #;> FTP #;< ACQUIA # Acquia application name to download the database from. -DREVOPS_ACQUIA_APP_NAME= +VORTEX_ACQUIA_APP_NAME= # Acquia database name to download the database from. -DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME=your_site +VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME=your_site #;> ACQUIA #;< LAGOON -# Lagoon project name. May be different from $DREVOPS_PROJECT. +# Lagoon project name. May be different from $VORTEX_PROJECT. LAGOON_PROJECT=your_site #;> LAGOON @@ -185,11 +185,11 @@ LAGOON_PROJECT=your_site # `artifact`,`container_registry`, `webhook`, `lagoon`. # # See https://docs.drevops.com/workflows/deploy -DREVOPS_DEPLOY_TYPES=artifact +VORTEX_DEPLOY_TYPES=artifact #;< LAGOON # Dedicated branch to identify the production environment. -DREVOPS_LAGOON_PRODUCTION_BRANCH=main +VORTEX_LAGOON_PRODUCTION_BRANCH=main #;> LAGOON #;> DEPLOYMENT @@ -205,17 +205,17 @@ DREVOPS_LAGOON_PRODUCTION_BRANCH=main # The channels of the notifications. # # Can be a combination of comma-separated values: email,newrelic,github,jira -DREVOPS_NOTIFY_CHANNELS=email +VORTEX_NOTIFY_CHANNELS=email # Email to send notifications from. -DREVOPS_NOTIFY_EMAIL_FROM="webmaster@your-site-url.example" +VORTEX_NOTIFY_EMAIL_FROM="webmaster@your-site-url.example" # Email address(es) to send notifications to. # # Multiple names can be specified as a comma-separated list of email addresses # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" -DREVOPS_NOTIFY_EMAIL_RECIPIENTS="webmaster@your-site-url.example" +VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@your-site-url.example" #;> NOTIFICATIONS #;< DEMO @@ -226,25 +226,25 @@ DREVOPS_NOTIFY_EMAIL_RECIPIENTS="webmaster@your-site-url.example" #------------------------------------------------------------------------------- # Variables used to override project-specific values for demonstration purposes. # -# This is to allow to demonstrate how Scaffold works without asking users -# to perform any additional steps when trying out Scaffold for the first time. +# This is to allow to demonstrate how Vortex works without asking users +# to perform any additional steps when trying out Vortex for the first time. # # Remove this section from your project when database download integration setup # is finished. #------------------------------------------------------------------------------- -#;< DREVOPS_DB_DOWNLOAD_SOURCE_CURL +#;< VORTEX_DB_DOWNLOAD_SOURCE_CURL # URL of the demo database used for demonstration with CURL database # dump as a type of file source. -DREVOPS_DB_DOWNLOAD_CURL_URL=https://github.com/drevops/scaffold/releases/download/1.18.0/db_d10.demo.sql -#;> DREVOPS_DB_DOWNLOAD_SOURCE_CURL +VORTEX_DB_DOWNLOAD_CURL_URL=https://github.com/drevops/scaffold/releases/download/1.18.0/db_d10.demo.sql +#;> VORTEX_DB_DOWNLOAD_SOURCE_CURL -#;< DREVOPS_DB_IMAGE +#;< VORTEX_DB_IMAGE # The name of the demo database image used for demonstration only for # 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 +##### VORTEX_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest +#;> VORTEX_DB_IMAGE #;> DEMO diff --git a/.env.local.default b/.env.local.default index 6a1938a9f..f4879983c 100644 --- a/.env.local.default +++ b/.env.local.default @@ -17,19 +17,19 @@ # AHOY_CONFIRM_WAIT_SKIP=1 # Always override DB. -DREVOPS_PROVISION_OVERRIDE_DB=1 +VORTEX_PROVISION_OVERRIDE_DB=1 # Local development URL. # Defaults to `.docker.amazee.io` # Override only if you need to use a different URL than the default. -# DREVOPS_LOCALDEV_URL="your_site.docker.amazee.io" +# VORTEX_LOCALDEV_URL="your_site.docker.amazee.io" -# Print debug information in DrevOps Scaffold scripts. -# DREVOPS_DEBUG=1 +# Print debug information in DrevOps Vortex scripts. +# VORTEX_DEBUG=1 #;< !PROVISION_USE_PROFILE # Always override existing downloaded DB dump. -DREVOPS_DB_DOWNLOAD_FORCE=1 +VORTEX_DB_DOWNLOAD_FORCE=1 #;> !PROVISION_USE_PROFILE #;< !PROVISION_USE_PROFILE @@ -37,9 +37,9 @@ DREVOPS_DB_DOWNLOAD_FORCE=1 # Database dump file sourced from FTP. # Database dump FTP user. -DREVOPS_DB_DOWNLOAD_FTP_USER= +VORTEX_DB_DOWNLOAD_FTP_USER= # Database dump FTP password. -DREVOPS_DB_DOWNLOAD_FTP_PASS= +VORTEX_DB_DOWNLOAD_FTP_PASS= #;> FTP #;> !PROVISION_USE_PROFILE @@ -49,21 +49,21 @@ DREVOPS_DB_DOWNLOAD_FTP_PASS= # Acquia Cloud API token: Acquia Cloud UI -> Account -> API tokens -> Create Token # Acquia Cloud API key. -DREVOPS_ACQUIA_KEY= +VORTEX_ACQUIA_KEY= # Acquia Cloud API secret. -DREVOPS_ACQUIA_SECRET= +VORTEX_ACQUIA_SECRET= #;> ACQUIA #;> !PROVISION_USE_PROFILE #;< !PROVISION_USE_PROFILE -#;< DREVOPS_DB_DOWNLOAD_SOURCE_CONTAINER_REGISTRY +#;< VORTEX_DB_DOWNLOAD_SOURCE_CONTAINER_REGISTRY # Container registry credentials to read and write images. # The username to log into the container registry. -DREVOPS_CONTAINER_REGISTRY_USER=$DOCKER_USER +VORTEX_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 +VORTEX_CONTAINER_REGISTRY_PASS=$DOCKER_PASS +#;> VORTEX_DB_DOWNLOAD_SOURCE_CONTAINER_REGISTRY #;> !PROVISION_USE_PROFILE # GitHub token used to overcome API rate limits or access private repositories. diff --git a/.gitattributes b/.gitattributes index 898c2b27c..fb1d399e6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,8 @@ ## -# Scaffold git settings. +# Vortex git settings. # # Drupal provides its own .gitattributes so git normalisations are handled there. /.gitattributes export-ignore /.github/FUNDING.yml export-ignore -/.scaffold export-ignore +/.vortex export-ignore diff --git a/.github/workflows/draft-release-notes.yml b/.github/workflows/draft-release-notes.yml index 18c27c613..605e3d0c8 100644 --- a/.github/workflows/draft-release-notes.yml +++ b/.github/workflows/draft-release-notes.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Generate CalVer version - if: vars.DREVOPS_RELEASE_VERSION_SCHEME == 'calver' + if: vars.VORTEX_RELEASE_VERSION_SCHEME == 'calver' id: calver run: | export VERSION="$(date "+%y.%-m").0" diff --git a/.github/workflows/scaffold-release-docs.yml b/.github/workflows/vortex-release-docs.yml similarity index 71% rename from .github/workflows/scaffold-release-docs.yml rename to .github/workflows/vortex-release-docs.yml index 8aa38e53d..e68a14e63 100644 --- a/.github/workflows/scaffold-release-docs.yml +++ b/.github/workflows/vortex-release-docs.yml @@ -1,5 +1,5 @@ -# This action is used for Scaffold maintenance. It will not be used in the scaffolded project. -name: Scaffold - Release docs +# This action is used for Vortex maintenance. It will not be used in the scaffolded project. +name: Vortex - Release docs on: push: @@ -44,21 +44,21 @@ jobs: run: | composer --working-dir=.utils install npm run update-variables - git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .scaffold && ahoy update-docs' and commit changes."; git diff; exit 1; } - working-directory: '${{ github.workspace }}/.scaffold/docs' + git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .vortex && ahoy update-docs' and commit changes."; git diff; exit 1; } + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Install dependencies run: npm install - working-directory: '${{ github.workspace }}/.scaffold/docs' + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Build documentation site run: npm run build - working-directory: '${{ github.workspace }}/.scaffold/docs' + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Upload documentation site uses: actions/upload-pages-artifact@v3 with: - path: ".scaffold/docs/build" + path: ".vortex/docs/build" - name: Setup SSH private key uses: webfactory/ssh-agent@v0.9.0 @@ -67,8 +67,8 @@ jobs: - name: Publish docs run: | - cd "${GITHUB_WORKSPACE}/.scaffold/docs" - export DOCS_PUBLISH_SRC_DIR="${GITHUB_WORKSPACE}/.scaffold/docs/build" + cd "${GITHUB_WORKSPACE}/.vortex/docs" + export DOCS_PUBLISH_SRC_DIR="${GITHUB_WORKSPACE}/.vortex/docs/build" export DOCS_PUBLISH_REMOTE_URL=git@github.com:drevops/docs.git export DOCS_PUBLISH_COMMIT_MESSAGE="Automatically pushed from drevops/scaffold" export DOCS_PUBLISH_GIT_EMAIL="deployer@drevops.com" diff --git a/.github/workflows/scaffold-test-common.yml b/.github/workflows/vortex-test-common.yml similarity index 72% rename from .github/workflows/scaffold-test-common.yml rename to .github/workflows/vortex-test-common.yml index 6d6680c34..299f56cc6 100644 --- a/.github/workflows/scaffold-test-common.yml +++ b/.github/workflows/vortex-test-common.yml @@ -1,5 +1,5 @@ -# This action is used for Scaffold maintenance. It will not be used in the scaffolded project. -name: Scaffold - Test +# This action is used for Vortex maintenance. It will not be used in the scaffolded project. +name: Vortex - Test on: push: @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true jobs: - scaffold-test-common: + vortex-test-common: runs-on: ubuntu-latest container: @@ -24,12 +24,12 @@ jobs: env: # Prevent GitHub overriding the Docker config. DOCKER_CONFIG: /root/.docker - DREVOPS_DOCTOR_CHECK_MINIMAL: 1 + VORTEX_DOCTOR_CHECK_MINIMAL: 1 TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} - TEST_DREVOPS_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_USER }} - TEST_DREVOPS_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_PASS }} + TEST_VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_USER }} + TEST_VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_PASS }} SCAFFOLD_DEV_VOLUMES_MOUNTED: 0 - SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html + SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html steps: - name: Checkout code @@ -55,33 +55,33 @@ jobs: - name: Install dependencies run: npm ci - working-directory: .scaffold/tests + working-directory: .vortex/tests - name: Lint code run: | ./tests/lint.scripts.sh ./tests/lint.dockerfiles.sh - working-directory: .scaffold + working-directory: .vortex - name: Run tests run: ./tests/test.common.sh - working-directory: .scaffold + working-directory: .vortex - name: Upload coverage report as an artifact uses: actions/upload-artifact@v4 with: name: ${{github.job}}-code-coverage-report - path: /tmp/.scaffold-coverage-html + path: /tmp/.vortex-coverage-html - name: Upload coverage report to Codecov uses: codecov/codecov-action@v4 with: - directory: /tmp/.scaffold-coverage-html + directory: /tmp/.vortex-coverage-html fail_ci_if_error: false env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - scaffold-test-workflow: + vortex-test-workflow: runs-on: ubuntu-latest strategy: @@ -93,12 +93,12 @@ jobs: env: # Prevent GitHub overriding the Docker config. DOCKER_CONFIG: /root/.docker - DREVOPS_DOCTOR_CHECK_MINIMAL: 1 + VORTEX_DOCTOR_CHECK_MINIMAL: 1 TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} - TEST_DREVOPS_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_USER }} - TEST_DREVOPS_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_PASS }} + TEST_VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_USER }} + TEST_VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_PASS }} SCAFFOLD_DEV_VOLUMES_MOUNTED: 0 - SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html + SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html TEST_NODE_INDEX: ${{ matrix.batch }} steps: @@ -113,27 +113,27 @@ jobs: - name: Install dependencies run: npm ci - working-directory: .scaffold/tests + working-directory: .vortex/tests - name: Run tests run: ./tests/test.workflow.sh - working-directory: .scaffold + working-directory: .vortex - name: Upload coverage report as an artifact uses: actions/upload-artifact@v4 with: name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report - path: /tmp/.scaffold-coverage-html + path: /tmp/.vortex-coverage-html - name: Upload coverage report to Codecov uses: codecov/codecov-action@v4 with: - directory: /tmp/.scaffold-coverage-html + directory: /tmp/.vortex-coverage-html fail_ci_if_error: false env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - scaffold-test-deployment: + vortex-test-deployment: runs-on: ubuntu-latest strategy: @@ -145,12 +145,12 @@ jobs: env: # Prevent GitHub overriding the Docker config. DOCKER_CONFIG: /root/.docker - DREVOPS_DOCTOR_CHECK_MINIMAL: 1 + VORTEX_DOCTOR_CHECK_MINIMAL: 1 TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} - TEST_DREVOPS_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_USER }} - TEST_DREVOPS_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_DREVOPS_CONTAINER_REGISTRY_PASS }} + TEST_VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_USER }} + TEST_VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.TEST_VORTEX_CONTAINER_REGISTRY_PASS }} SCAFFOLD_DEV_VOLUMES_MOUNTED: 0 - SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html + SCAFFOLD_DEV_TEST_COVERAGE_DIR: /tmp/.vortex-coverage-html TEST_NODE_INDEX: ${{ matrix.batch }} steps: @@ -174,27 +174,27 @@ jobs: - name: Install dependencies run: npm ci - working-directory: .scaffold/tests + working-directory: .vortex/tests - name: Run tests run: ./tests/test.deployment.sh - working-directory: .scaffold + working-directory: .vortex - name: Upload coverage report as an artifact uses: actions/upload-artifact@v4 with: name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report - path: /tmp/.scaffold-coverage-html + path: /tmp/.vortex-coverage-html - name: Upload coverage report to Codecov uses: codecov/codecov-action@v4 with: - directory: /tmp/.scaffold-coverage-html + directory: /tmp/.vortex-coverage-html fail_ci_if_error: false env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - scaffold-test-actions: + vortex-test-actions: runs-on: ubuntu-latest steps: @@ -202,9 +202,9 @@ jobs: uses: actions/checkout@v4 - name: Check coding standards with yamllint - run: yamllint --config-file .scaffold/tests/.yamllint-for-gha.yml .github/workflows - continue-on-error: ${{ vars.DREVOPS_CI_YAMLLINT_IGNORE_FAILURE == '1' }} + run: yamllint --config-file .vortex/tests/.yamllint-for-gha.yml .github/workflows + continue-on-error: ${{ vars.VORTEX_CI_YAMLLINT_IGNORE_FAILURE == '1' }} - name: Check coding standards with actionlint run: docker run --rm -v "${GITHUB_WORKSPACE:-.}":/app --workdir /app rhysd/actionlint:1.6.27 -ignore 'SC2002:' -ignore 'SC2155:' - continue-on-error: ${{ vars.DREVOPS_CI_ACTIONLINT_IGNORE_FAILURE == '1' }} + continue-on-error: ${{ vars.VORTEX_CI_ACTIONLINT_IGNORE_FAILURE == '1' }} diff --git a/.github/workflows/scaffold-test-docs.yml b/.github/workflows/vortex-test-docs.yml similarity index 69% rename from .github/workflows/scaffold-test-docs.yml rename to .github/workflows/vortex-test-docs.yml index 65438b733..5c48992f7 100644 --- a/.github/workflows/scaffold-test-docs.yml +++ b/.github/workflows/vortex-test-docs.yml @@ -1,5 +1,5 @@ -# This action is used for Scaffold maintenance. It will not be used in the scaffolded project. -name: Scaffold - Test docs +# This action is used for Vortex maintenance. It will not be used in the scaffolded project. +name: Vortex - Test docs on: push: @@ -9,7 +9,7 @@ on: - '**' jobs: - scaffold-test-docs: + vortex-test-docs: runs-on: ubuntu-latest steps: @@ -28,26 +28,26 @@ jobs: run: | composer --working-dir=.utils install npm run update-variables - git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .scaffold && ahoy update-docs' and commit changes."; git diff; exit 1; } - working-directory: '${{ github.workspace }}/.scaffold/docs' + git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .vortex && ahoy update-docs' and commit changes."; git diff; exit 1; } + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Install dependencies run: npm install - working-directory: '${{ github.workspace }}/.scaffold/docs' + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Build documentation site run: npm run build - working-directory: '${{ github.workspace }}/.scaffold/docs' + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Run tests run: npm run test - working-directory: '${{ github.workspace }}/.scaffold/docs' + working-directory: '${{ github.workspace }}/.vortex/docs' - name: Deploy to Netlify uses: nwtgck/actions-netlify@v3.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} - publish-dir: '.scaffold/docs/build' + publish-dir: '.vortex/docs/build' production-branch: develop deploy-message: "Deploy from GitHub Actions" enable-pull-request-comment: true diff --git a/.gitignore b/.gitignore index 57afd5053..6db7529f6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ # To add an override file, explicitly un-ignore it below and add to the # repository (useful for robots.txt and .htaccess file overrides). -#; To simplify maintenance of Scaffold, we support only 'web' document root +#; To simplify maintenance of Vortex, we support only 'web' document root #; defined explicitly here. web/* !web/sites/ @@ -40,7 +40,7 @@ web/sites/default/* !web/update.php #;< SCAFFOLD_DEV -#; Ignore these files in Scaffold itself, but do not ignore in consumer site. +#; Ignore these files in Vortex itself, but do not ignore in consumer site. /composer.lock #;> SCAFFOLD_DEV diff --git a/.gitignore.artifact b/.gitignore.artifact index 7ec05aac6..f6544719a 100644 --- a/.gitignore.artifact +++ b/.gitignore.artifact @@ -10,7 +10,7 @@ !composer.json !.env -# Do not ignore webroot (manage Drupal scaffold files using the composer.json) +# Do not ignore webroot (manage Drupal_Scaffold files using the composer.json) !web # But ignore content files and test artifacts. web/sites/default/files diff --git a/.lagoon.yml b/.lagoon.yml index 5d35c29e9..52da870ed 100644 --- a/.lagoon.yml +++ b/.lagoon.yml @@ -8,16 +8,16 @@ environment_variables: # container-registries: # dockerhub: # # The `username` field must be set as a scalar value. -# # Environment variable DREVOPS_CONTAINER_REGISTRY_PASS needs to be set via Lagoon CLI. +# # Environment variable VORTEX_CONTAINER_REGISTRY_PASS needs to be set via Lagoon CLI. # username: your_registry_username -# password: DREVOPS_CONTAINER_REGISTRY_PASS +# password: VORTEX_CONTAINER_REGISTRY_PASS tasks: post-rollout: - run: name: Show DrevOps variables. command: | - [ "${DREVOPS_DEBUG-}" = "1" ] && env -0 | sort -z | tr '\0' '\n' | grep ^DREVOPS_ || true + [ "${VORTEX_DEBUG-}" = "1" ] && env -0 | sort -z | tr '\0' '\n' | grep ^VORTEX_ || true service: cli shell: bash @@ -25,10 +25,10 @@ tasks: - run: name: Notify about pre-deployment. command: | - if [ -n "$LAGOON_PR_NUMBER" ]; then export DREVOPS_NOTIFY_REF=$LAGOON_PR_NUMBER;export DREVOPS_NOTIFY_SHA=${LAGOON_PR_HEAD_SHA#origin/};export DREVOPS_NOTIFY_BRANCH=$LAGOON_PR_HEAD_BRANCH;else export DREVOPS_NOTIFY_REF=$LAGOON_GIT_BRANCH;export DREVOPS_NOTIFY_SHA=$LAGOON_GIT_SHA;export DREVOPS_NOTIFY_BRANCH=$LAGOON_GIT_BRANCH;fi - DREVOPS_NOTIFY_PROJECT=$LAGOON_PROJECT \ - DREVOPS_NOTIFY_ENVIRONMENT_URL=$LAGOON_ROUTE \ - DREVOPS_NOTIFY_EVENT=pre_deployment ./scripts/drevops/notify.sh || true + if [ -n "$LAGOON_PR_NUMBER" ]; then export VORTEX_NOTIFY_REF=$LAGOON_PR_NUMBER;export VORTEX_NOTIFY_SHA=${LAGOON_PR_HEAD_SHA#origin/};export VORTEX_NOTIFY_BRANCH=$LAGOON_PR_HEAD_BRANCH;else export VORTEX_NOTIFY_REF=$LAGOON_GIT_BRANCH;export VORTEX_NOTIFY_SHA=$LAGOON_GIT_SHA;export VORTEX_NOTIFY_BRANCH=$LAGOON_GIT_BRANCH;fi + VORTEX_NOTIFY_PROJECT=$LAGOON_PROJECT \ + VORTEX_NOTIFY_ENVIRONMENT_URL=$LAGOON_ROUTE \ + VORTEX_NOTIFY_EVENT=pre_deployment ./scripts/vortex/notify.sh || true service: cli shell: bash #;> !NOTIFICATIONS @@ -36,9 +36,9 @@ tasks: - run: name: Backup DB before deployment in production command: | - if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${DREVOPS_LAGOON_PRODUCTION_BRANCH:-main}" ]; then + if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${VORTEX_LAGOON_PRODUCTION_BRANCH:-main}" ]; then echo "==> Running in PRODUCTION environment." - DREVOPS_DB_DIR=/app/web/sites/default/files/private/pre_deployment_backups ./scripts/drevops/export-db-file.sh + VORTEX_DB_DIR=/app/web/sites/default/files/private/pre_deployment_backups ./scripts/vortex/export-db-file.sh fi service: cli #;< !PROVISION_USE_PROFILE @@ -46,12 +46,12 @@ tasks: - run: name: Download database in non-production environments command: | - if [ "$LAGOON_ENVIRONMENT_TYPE" != "production" ] && [ "$LAGOON_GIT_BRANCH" != "${DREVOPS_LAGOON_PRODUCTION_BRANCH:-main}" ]; then + if [ "$LAGOON_ENVIRONMENT_TYPE" != "production" ] && [ "$LAGOON_GIT_BRANCH" != "${VORTEX_LAGOON_PRODUCTION_BRANCH:-main}" ]; then # No need to load SSH file to access production DB as Lagoon has SSH agent keys. - export DREVOPS_DB_DOWNLOAD_SSH_FILE=false - export DREVOPS_DB_DIR=/tmp/data - rm -Rf $DREVOPS_DB_DIR || true - ./scripts/drevops/download-db.sh + export VORTEX_DB_DOWNLOAD_SSH_FILE=false + export VORTEX_DB_DIR=/tmp/data + rm -Rf $VORTEX_DB_DIR || true + ./scripts/vortex/download-db.sh fi service: cli #;> !PROVISION_USE_PROFILE @@ -60,27 +60,27 @@ tasks: name: Provision site command: | #;< PROVISION_USE_PROFILE - if [ "$DREVOPS_PROVISION_USE_PROFILE" = "1" ]; then + if [ "$VORTEX_PROVISION_USE_PROFILE" = "1" ]; then # Explicitly set DB overwrite flag to the value from .env file for deployments from the profile. # @see https://github.com/uselagoon/lagoon/issues/1922 - export DREVOPS_PROVISION_OVERRIDE_DB="$(cat .env | grep ^DREVOPS_PROVISION_OVERRIDE_DB | cut -c31-)" + export VORTEX_PROVISION_OVERRIDE_DB="$(cat .env | grep ^VORTEX_PROVISION_OVERRIDE_DB | cut -c31-)" fi #;> PROVISION_USE_PROFILE - if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${DREVOPS_LAGOON_PRODUCTION_BRANCH:-main}" ]; then + if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${VORTEX_LAGOON_PRODUCTION_BRANCH:-main}" ]; then echo "==> Running in PRODUCTION environment." #;< !PROVISION_USE_PROFILE # Never overwrite existing DB when production site already exists. - export DREVOPS_PROVISION_OVERRIDE_DB=0 + export VORTEX_PROVISION_OVERRIDE_DB=0 #;> !PROVISION_USE_PROFILE # Never unblock admin user in production. export DRUPAL_UNBLOCK_ADMIN=0 # Never sanitize DB in production. - export DREVOPS_PROVISION_SANITIZE_DB_SKIP=1 + export VORTEX_PROVISION_SANITIZE_DB_SKIP=1 fi - export DREVOPS_DB_DIR=/tmp/data - ./scripts/drevops/provision.sh + export VORTEX_DB_DIR=/tmp/data + ./scripts/vortex/provision.sh service: cli shell: bash @@ -88,11 +88,11 @@ tasks: - run: name: Send deployment notifications command: | - if [ -n "$LAGOON_PR_NUMBER" ]; then export DREVOPS_NOTIFY_REF=$LAGOON_PR_NUMBER; export DREVOPS_NOTIFY_SHA=${LAGOON_PR_HEAD_SHA#origin/}; export DREVOPS_NOTIFY_BRANCH=$LAGOON_PR_HEAD_BRANCH; else export DREVOPS_NOTIFY_REF=$LAGOON_GIT_BRANCH; export DREVOPS_NOTIFY_SHA=$LAGOON_GIT_SHA; export DREVOPS_NOTIFY_BRANCH=$LAGOON_GIT_BRANCH; fi - DREVOPS_NOTIFY_EVENT=post_deployment \ - DREVOPS_NOTIFY_PROJECT=$LAGOON_PROJECT \ - DREVOPS_NOTIFY_ENVIRONMENT_URL=$LAGOON_ROUTE \ - ./scripts/drevops/notify.sh || true + if [ -n "$LAGOON_PR_NUMBER" ]; then export VORTEX_NOTIFY_REF=$LAGOON_PR_NUMBER; export VORTEX_NOTIFY_SHA=${LAGOON_PR_HEAD_SHA#origin/}; export VORTEX_NOTIFY_BRANCH=$LAGOON_PR_HEAD_BRANCH; else export VORTEX_NOTIFY_REF=$LAGOON_GIT_BRANCH; export VORTEX_NOTIFY_SHA=$LAGOON_GIT_SHA; export VORTEX_NOTIFY_BRANCH=$LAGOON_GIT_BRANCH; fi + VORTEX_NOTIFY_EVENT=post_deployment \ + VORTEX_NOTIFY_PROJECT=$LAGOON_PROJECT \ + VORTEX_NOTIFY_ENVIRONMENT_URL=$LAGOON_ROUTE \ + ./scripts/vortex/notify.sh || true service: cli shell: bash #;> !NOTIFICATIONS diff --git a/.scaffold/docs/static/img/favicon.ico b/.scaffold/docs/static/img/favicon.ico deleted file mode 100644 index 095bfde71..000000000 Binary files a/.scaffold/docs/static/img/favicon.ico and /dev/null differ diff --git a/.scaffold/docs/static/img/logo-dark.svg b/.scaffold/docs/static/img/logo-dark.svg deleted file mode 100644 index 7269fefce..000000000 --- a/.scaffold/docs/static/img/logo-dark.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - Group - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/.scaffold/docs/static/img/logo-drop-dark.png b/.scaffold/docs/static/img/logo-drop-dark.png deleted file mode 100644 index 48be0c176..000000000 Binary files a/.scaffold/docs/static/img/logo-drop-dark.png and /dev/null differ diff --git a/.scaffold/docs/static/img/logo-drop-light.png b/.scaffold/docs/static/img/logo-drop-light.png deleted file mode 100644 index a94820bf8..000000000 Binary files a/.scaffold/docs/static/img/logo-drop-light.png and /dev/null differ diff --git a/.scaffold/docs/static/img/logo-scaffold-dark.svg b/.scaffold/docs/static/img/logo-scaffold-dark.svg deleted file mode 100644 index fc9a65771..000000000 --- a/.scaffold/docs/static/img/logo-scaffold-dark.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.scaffold/docs/static/img/logo-scaffold-light.svg b/.scaffold/docs/static/img/logo-scaffold-light.svg deleted file mode 100644 index 758f513db..000000000 --- a/.scaffold/docs/static/img/logo-scaffold-light.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.scaffold/tests/bats/deploy-artifact.bats b/.scaffold/tests/bats/deploy-artifact.bats deleted file mode 100644 index 86b3fbbdb..000000000 --- a/.scaffold/tests/bats/deploy-artifact.bats +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bats -# -# Test for CircleCI lifecycle. -# -# shellcheck disable=SC2030,SC2031,SC2129,SC2155 - -load _helper.bash -load _helper.deployment.bash - -@test "Missing or Invalid DREVOPS_DEPLOY_TYPES" { - substep "Swap to ${LOCAL_REPO_DIR}" - pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - - export DREVOPS_DEPLOY_TYPES="" - run ahoy deploy - assert_failure - - assert_output_contains "Missing required value for DREVOPS_DEPLOY_TYPES. Must be a combination of comma-separated values (to support multiple deployments): code, container_registry, webhook, lagoon." - - popd >/dev/null -} - -@test "Check setting and default values for required variables" { - pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - - # Note the following variables have default values - # so the check for empty string is redundant: - # - DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME - # - DREVOPS_DEPLOY_ARTIFACT_ROOT - # - DREVOPS_DEPLOY_ARTIFACT_LOG - - unset DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE - unset DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH - unset DREVOPS_DEPLOY_ARTIFACT_SRC - unset DREVOPS_DEPLOY_ARTIFACT_ROOT - unset DREVOPS_DEPLOY_ARTIFACT_LOG - - run scripts/drevops/deploy-artifact.sh - assert_failure - assert_output_contains "Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE." - - export DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE="git@github.com:yourorg/your-repo-destination.git" - - run scripts/drevops/deploy-artifact.sh - assert_failure - assert_output_contains "Missing required value for DREVOPS_DEPLOY_ARTIFACT_SRC." - - export DREVOPS_DEPLOY_ARTIFACT_SRC="dist" - - run scripts/drevops/deploy-artifact.sh - assert_failure - assert_output_contains "Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL." - - popd >/dev/null -} - -@test "Artifact deployment, global git username and email configured, default SSH Key" { - pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - - setup_ssh_key_fixture - setup_robo_fixture - provision_default_ssh_key - export DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE="git@github.com:yourorg/your-repo-destination.git" - export DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH="main" - export DREVOPS_DEPLOY_ARTIFACT_SRC="dist" - export DREVOPS_DEPLOY_ARTIFACT_ROOT="." - export DREVOPS_DEPLOY_ARTIFACT_LOG="deploy-report.txt" - export DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME="test_user" - export DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL="test_user@example.com" - local file=${HOME}/.ssh/id_rsa - - mock_realpath=$(mock_command "realpath") - - declare -a STEPS=( - "- Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE." - "- Missing required value for DREVOPS_DEPLOY_ARTIFACT_SRC." - "- Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL." - "@git config --global user.name #" - "Configuring global git user name." - "@git config --global user.name ${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME} # 0 #" - "@git config --global user.email #" - "Configuring global git user email." - "@git config --global user.email ${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL} # 0 #" - "Using default SSH file ${file}." - "Using SSH key file ${file}." - "@ssh-add -l # ${file}" - "SSH agent has ${file} key loaded." - "Installing artifact builder." - "@composer global require --dev -n --ansi --prefer-source --ignore-platform-reqs drevops/git-artifact:^0.7" - "Running artifact builder." - "Finished ARTIFACT deployment." - ) - mocks="$(run_steps "setup")" - - run scripts/drevops/deploy-artifact.sh - assert_success - - run_steps "assert" "${mocks[@]}" - assert_equal "2" "$(mock_get_call_num "${mock_realpath}" 1)" - - popd >/dev/null -} diff --git a/.scaffold/tests/bats/deploy-webhook.bats b/.scaffold/tests/bats/deploy-webhook.bats deleted file mode 100644 index 2dd973c14..000000000 --- a/.scaffold/tests/bats/deploy-webhook.bats +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bats -# -# Test for webhook deployments. -# -# shellcheck disable=SC2030,SC2031,SC2129,SC2155 - -load _helper.bash -load _helper.deployment.bash - -@test "Missing variable checks" { - pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - - unset DREVOPS_DEPLOY_WEBHOOK_URL - unset DREVOPS_DEPLOY_WEBHOOK_METHOD - unset DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS - - run scripts/drevops/deploy-webhook.sh - assert_failure - assert_output_contains "Missing required value for DREVOPS_DEPLOY_WEBHOOK_URL." - - mock_curl=$(mock_command "curl") - mock_set_output "${mock_curl}" "200" 1 - export DREVOPS_DEPLOY_WEBHOOK_URL="https://example.com" - unset DREVOPS_DEPLOY_WEBHOOK_METHOD - unset DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS - - run scripts/drevops/deploy-webhook.sh - assert_success - assert_output_not_contains "Missing required value for DREVOPS_DEPLOY_WEBHOOK_METHOD." - assert_output_not_contains "Missing required value for DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS." - - popd >/dev/null -} - -@test "Successful webhook deployment" { - pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - - export DREVOPS_DEPLOY_WEBHOOK_URL="https://example.com" - export DREVOPS_DEPLOY_WEBHOOK_METHOD="GET" - export DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS="200" - mock_curl=$(mock_command "curl") - mock_set_output "${mock_curl}" "${DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS}" 1 - - run scripts/drevops/deploy-webhook.sh - assert_success - assert_output_contains "Webhook call completed." - assert_output_contains "Finished WEBHOOK deployment." - - popd >/dev/null -} - -@test "Failed webhook deployment" { - pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - - export DREVOPS_DEPLOY_WEBHOOK_URL="https://example.com" - export DREVOPS_DEPLOY_WEBHOOK_METHOD="GET" - export DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS="200" - mock_curl=$(mock_command "curl") - mock_set_output "${mock_curl}" "400" 1 - - run scripts/drevops/deploy-webhook.sh - assert_failure - assert_output_contains "Unable to complete webhook deployment." - - popd >/dev/null -} diff --git a/.scaffold/.ahoy.yml b/.vortex/.ahoy.yml similarity index 96% rename from .scaffold/.ahoy.yml rename to .vortex/.ahoy.yml index ab78a332b..823dd4b7f 100644 --- a/.scaffold/.ahoy.yml +++ b/.vortex/.ahoy.yml @@ -22,7 +22,7 @@ commands: npm --prefix docs run build lint: - name: Lint Scaffold project. + name: Lint Vortex project. cmd: | ahoy lint-scripts ahoy lint-dockerfiles @@ -35,7 +35,7 @@ commands: cmd: ./tests/lint.dockerfiles.sh test: - name: Test Scaffold project. + name: Test Vortex project. cmd: | ahoy test-common ahoy test-docs diff --git a/.scaffold/README.md b/.vortex/README.md similarity index 85% rename from .scaffold/README.md rename to .vortex/README.md index d822b02f8..b84a51911 100644 --- a/.scaffold/README.md +++ b/.vortex/README.md @@ -1,4 +1,4 @@ -# Scaffold development +# Vortex development This directory contains development files for the scaffold itself. This directory is removed by the installer or can be deleted manually. diff --git a/.scaffold/docs/.gitignore b/.vortex/docs/.gitignore similarity index 100% rename from .scaffold/docs/.gitignore rename to .vortex/docs/.gitignore diff --git a/.scaffold/docs/.utils/.gitignore b/.vortex/docs/.utils/.gitignore similarity index 100% rename from .scaffold/docs/.utils/.gitignore rename to .vortex/docs/.utils/.gitignore diff --git a/.scaffold/docs/.utils/composer.json b/.vortex/docs/.utils/composer.json similarity index 100% rename from .scaffold/docs/.utils/composer.json rename to .vortex/docs/.utils/composer.json diff --git a/.scaffold/docs/.utils/composer.lock b/.vortex/docs/.utils/composer.lock similarity index 100% rename from .scaffold/docs/.utils/composer.lock rename to .vortex/docs/.utils/composer.lock diff --git a/.scaffold/docs/.utils/publish.sh b/.vortex/docs/.utils/publish.sh similarity index 99% rename from .scaffold/docs/.utils/publish.sh rename to .vortex/docs/.utils/publish.sh index 609751bc2..7296a4f4d 100755 --- a/.scaffold/docs/.utils/publish.sh +++ b/.vortex/docs/.utils/publish.sh @@ -10,7 +10,7 @@ # set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # The source directory. DOCS_PUBLISH_SRC_DIR=${DOCS_PUBLISH_SRC_DIR?Specify the source directory to publish.} diff --git a/.scaffold/docs/.utils/terminalizer/README.md b/.vortex/docs/.utils/terminalizer/README.md similarity index 100% rename from .scaffold/docs/.utils/terminalizer/README.md rename to .vortex/docs/.utils/terminalizer/README.md diff --git a/.scaffold/docs/.utils/terminalizer/example.yml b/.vortex/docs/.utils/terminalizer/example.yml similarity index 100% rename from .scaffold/docs/.utils/terminalizer/example.yml rename to .vortex/docs/.utils/terminalizer/example.yml diff --git a/.scaffold/docs/.utils/update-docs.sh b/.vortex/docs/.utils/update-docs.sh similarity index 60% rename from .scaffold/docs/.utils/update-docs.sh rename to .vortex/docs/.utils/update-docs.sh index 1668da367..8a311a0ec 100755 --- a/.scaffold/docs/.utils/update-docs.sh +++ b/.vortex/docs/.utils/update-docs.sh @@ -3,12 +3,12 @@ # Update docs. # # @usage -# cd .scaffold/docs && ./update-docs.sh +# cd .vortex/docs && ./update-docs.sh # # shellcheck disable=SC2129 set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)" @@ -38,16 +38,16 @@ echo >>"${OUTPUT_FILE}" ../../.env \ ../../.env.local.default \ ./.utils/variables/extra \ - ../../scripts/drevops \ + ../../scripts/vortex \ ../../scripts/custom \ >>"${OUTPUT_FILE}" -sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/environment.variables.sh/ENVIRONMENT/g" "${OUTPUT_FILE}" -sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/acquia.variables.sh/ACQUIA ENVIRONMENT/g" "${OUTPUT_FILE}" -sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/lagoon.variables.sh/LAGOON ENVIRONMENT/g" "${OUTPUT_FILE}" -sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/.env.local.default.variables.sh/.env.local.default/g" "${OUTPUT_FILE}" -sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/.env.variables.sh/.env/g" "${OUTPUT_FILE}" -sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/ci.variables.sh/CI config/g" "${OUTPUT_FILE}" +sed "${sed_opts[@]}" "s/.vortex\/docs\/.utils\/variables\/extra\/environment.variables.sh/ENVIRONMENT/g" "${OUTPUT_FILE}" +sed "${sed_opts[@]}" "s/.vortex\/docs\/.utils\/variables\/extra\/acquia.variables.sh/ACQUIA ENVIRONMENT/g" "${OUTPUT_FILE}" +sed "${sed_opts[@]}" "s/.vortex\/docs\/.utils\/variables\/extra\/lagoon.variables.sh/LAGOON ENVIRONMENT/g" "${OUTPUT_FILE}" +sed "${sed_opts[@]}" "s/.vortex\/docs\/.utils\/variables\/extra\/.env.local.default.variables.sh/.env.local.default/g" "${OUTPUT_FILE}" +sed "${sed_opts[@]}" "s/.vortex\/docs\/.utils\/variables\/extra\/.env.variables.sh/.env/g" "${OUTPUT_FILE}" +sed "${sed_opts[@]}" "s/.vortex\/docs\/.utils\/variables\/extra\/ci.variables.sh/CI config/g" "${OUTPUT_FILE}" echo "---" >>"${OUTPUT_FILE}" echo "Variable list generated with [Shellvar - Utility to work with shell variables](https://github.com/AlexSkrypnyk/shellvar)" >>"${OUTPUT_FILE}" diff --git a/.scaffold/docs/.utils/variables/extra/.env.local.default.variables.sh b/.vortex/docs/.utils/variables/extra/.env.local.default.variables.sh similarity index 78% rename from .scaffold/docs/.utils/variables/extra/.env.local.default.variables.sh rename to .vortex/docs/.utils/variables/extra/.env.local.default.variables.sh index c8b3126ff..ac921af6f 100755 --- a/.scaffold/docs/.utils/variables/extra/.env.local.default.variables.sh +++ b/.vortex/docs/.utils/variables/extra/.env.local.default.variables.sh @@ -6,13 +6,13 @@ # Local development URL. # Override only if you need to use a different URL than the default. -DREVOPS_LOCALDEV_URL=".docker.amazee.io" +VORTEX_LOCALDEV_URL=".docker.amazee.io" # Set to `1` to override existing downloaded DB dump without asking. -DREVOPS_DB_DOWNLOAD_FORCE= +VORTEX_DB_DOWNLOAD_FORCE= -# Set to `1` to print debug information in Scaffold scripts. -DREVOPS_DEBUG= +# Set to `1` to print debug information in Vortex scripts. +VORTEX_DEBUG= # Set to `y` to suppress Ahoy prompts. AHOY_CONFIRM_RESPONSE= diff --git a/.scaffold/docs/.utils/variables/extra/.env.variables.sh b/.vortex/docs/.utils/variables/extra/.env.variables.sh similarity index 74% rename from .scaffold/docs/.utils/variables/extra/.env.variables.sh rename to .vortex/docs/.utils/variables/extra/.env.variables.sh index 5090321cf..a0c4f804d 100755 --- a/.scaffold/docs/.utils/variables/extra/.env.variables.sh +++ b/.vortex/docs/.utils/variables/extra/.env.variables.sh @@ -7,24 +7,24 @@ # Name of the database container image to use. # # See https://github.com/drevops/mariadb-drupal-data to seed your DB image. -DREVOPS_DB_IMAGE= +VORTEX_DB_IMAGE= # Name of the database fall-back container image to use. # -# If the image specified in $DREVOPS_DB_IMAGE does not exist and base +# If the image specified in $VORTEX_DB_IMAGE does not exist and base # image was provided - it will be used as a "clean slate" for the database. -DREVOPS_DB_IMAGE_BASE= +VORTEX_DB_IMAGE_BASE= # Drupal admin email. May need to be reset if database was sanitized. DRUPAL_ADMIN_EMAIL="webmaster@your-site-url.example" # Password replacement used for sanitised database. -DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="" +VORTEX_PROVISION_SANITIZE_DB_PASSWORD="" # Container registry name. # # Provide port, if required as `:`. -DREVOPS_CONTAINER_REGISTRY="${DREVOPS_CONTAINER_REGISTRY:-docker.io}" +VORTEX_CONTAINER_REGISTRY="${VORTEX_CONTAINER_REGISTRY:-docker.io}" # Unblock admin account when logging in. DRUPAL_UNBLOCK_ADMIN=1 @@ -34,24 +34,24 @@ DRUPAL_ADMIN_EMAIL= # Replace username with email after database sanitization. Useful when email # is used as username. -DREVOPS_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL=0 +VORTEX_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL=0 # Drupal site name. # Used only when installing from profile. -DRUPAL_SITE_NAME="${DREVOPS_PROJECT}" +DRUPAL_SITE_NAME="${VORTEX_PROJECT}" # Drupal site email. # Used only when installing from profile. DRUPAL_SITE_EMAIL="webmaster@your-site-url.example" # Print output from Composer install. -DREVOPS_COMPOSER_VERBOSE=1 +VORTEX_COMPOSER_VERBOSE=1 # Print output from NPM install. -DREVOPS_NPM_VERBOSE=0 +VORTEX_NPM_VERBOSE=0 # Path to public files. -DRUPAL_PUBLIC_FILES="${DRUPAL_PUBLIC_FILES:-./${DREVOPS_WEBROOT}/sites/default/files}" +DRUPAL_PUBLIC_FILES="${DRUPAL_PUBLIC_FILES:-./${VORTEX_WEBROOT}/sites/default/files}" # Path to private files. DRUPAL_PRIVATE_FILES="${DRUPAL_PRIVATE_FILES:-${DRUPAL_PUBLIC_FILES}/private}" diff --git a/.scaffold/docs/.utils/variables/extra/acquia.variables.sh b/.vortex/docs/.utils/variables/extra/acquia.variables.sh similarity index 72% rename from .scaffold/docs/.utils/variables/extra/acquia.variables.sh rename to .vortex/docs/.utils/variables/extra/acquia.variables.sh index b8b24f020..7df1bfc8f 100755 --- a/.scaffold/docs/.utils/variables/extra/acquia.variables.sh +++ b/.vortex/docs/.utils/variables/extra/acquia.variables.sh @@ -4,13 +4,13 @@ # shellcheck disable=SC2034 # Skip copying of database between Acquia environment. -DREVOPS_TASK_COPY_DB_ACQUIA_SKIP= +VORTEX_TASK_COPY_DB_ACQUIA_SKIP= # Skip copying of files between Acquia environment. -DREVOPS_TASK_COPY_FILES_ACQUIA_SKIP= +VORTEX_TASK_COPY_FILES_ACQUIA_SKIP= # Skip purging of edge cache in Acquia environment. -DREVOPS_PURGE_CACHE_ACQUIA_SKIP= +VORTEX_PURGE_CACHE_ACQUIA_SKIP= # Skip Drupal site provisioning in Acquia environment. -DREVOPS_PROVISION_ACQUIA_SKIP= +VORTEX_PROVISION_ACQUIA_SKIP= diff --git a/.scaffold/docs/.utils/variables/extra/ci.variables.sh b/.vortex/docs/.utils/variables/extra/ci.variables.sh similarity index 66% rename from .scaffold/docs/.utils/variables/extra/ci.variables.sh rename to .vortex/docs/.utils/variables/extra/ci.variables.sh index 83b9354b1..186fe316e 100755 --- a/.scaffold/docs/.utils/variables/extra/ci.variables.sh +++ b/.vortex/docs/.utils/variables/extra/ci.variables.sh @@ -4,52 +4,52 @@ # shellcheck disable=SC2034 # Proceed with container image deployment after it was exported. -DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED= +VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED= # Directory to store exported code. -DREVOPS_EXPORT_CODE_DIR= +VORTEX_EXPORT_CODE_DIR= # Ignore Hadolint failures. -DREVOPS_CI_HADOLINT_IGNORE_FAILURE=0 +VORTEX_CI_HADOLINT_IGNORE_FAILURE=0 # Ignore `composer validate` failures. -DREVOPS_CI_COMPOSER_VALIDATE_IGNORE_FAILURE=0 +VORTEX_CI_COMPOSER_VALIDATE_IGNORE_FAILURE=0 # Ignore PHPCS failures. -DREVOPS_CI_PHPCS_IGNORE_FAILURE=0 +VORTEX_CI_PHPCS_IGNORE_FAILURE=0 # Ignore PHPStan failures. -DREVOPS_CI_PHPSTAN_IGNORE_FAILURE=0 +VORTEX_CI_PHPSTAN_IGNORE_FAILURE=0 # Ignore Rector failures. -DREVOPS_CI_RECTOR_IGNORE_FAILURE=0 +VORTEX_CI_RECTOR_IGNORE_FAILURE=0 # Ignore PHPMD failures. -DREVOPS_CI_PHPMD_IGNORE_FAILURE=0 +VORTEX_CI_PHPMD_IGNORE_FAILURE=0 # Ignore Twig CS Fixer failures. -DREVOPS_CI_TWIG_CS_FIXER_IGNORE_FAILURE=0 +VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE=0 # Ignore NPM linters failures. -DREVOPS_CI_NPM_LINT_IGNORE_FAILURE=0 +VORTEX_CI_NPM_LINT_IGNORE_FAILURE=0 # Ignore Gherkin Lint failures. -DREVOPS_CI_GHERKIN_LINT_IGNORE_FAILURE=0 +VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE=0 # Ignore PHPUnit test failures. -DREVOPS_CI_PHPUNIT_IGNORE_FAILURE=0 +VORTEX_CI_PHPUNIT_IGNORE_FAILURE=0 # Ignore Behat test failures. -DREVOPS_CI_BEHAT_IGNORE_FAILURE=0 +VORTEX_CI_BEHAT_IGNORE_FAILURE=0 # Test Behat profile to use in CI. If not set, the `default` profile will be used. -DREVOPS_CI_BEHAT_PROFILE= +VORTEX_CI_BEHAT_PROFILE= # Directory to store test results in CI. -DREVOPS_CI_TEST_RESULTS=/tmp/tests +VORTEX_CI_TEST_RESULTS=/tmp/tests # Directory to store test artifacts in CI. -DREVOPS_CI_ARTIFACTS=/tmp/artifacts +VORTEX_CI_ARTIFACTS=/tmp/artifacts # Self-hosted Renovate bot token. # Create a GitHub token with a permission to write to a repository. diff --git a/.scaffold/docs/.utils/variables/extra/environment.variables.sh b/.vortex/docs/.utils/variables/extra/environment.variables.sh similarity index 100% rename from .scaffold/docs/.utils/variables/extra/environment.variables.sh rename to .vortex/docs/.utils/variables/extra/environment.variables.sh diff --git a/.scaffold/docs/.utils/variables/extra/lagoon.variables.sh b/.vortex/docs/.utils/variables/extra/lagoon.variables.sh similarity index 100% rename from .scaffold/docs/.utils/variables/extra/lagoon.variables.sh rename to .vortex/docs/.utils/variables/extra/lagoon.variables.sh diff --git a/.scaffold/docs/.utils/variables/variables.excluded.txt b/.vortex/docs/.utils/variables/variables.excluded.txt similarity index 74% rename from .scaffold/docs/.utils/variables/variables.excluded.txt rename to .vortex/docs/.utils/variables/variables.excluded.txt index 65e2d6cc6..f31481cb2 100755 --- a/.scaffold/docs/.utils/variables/variables.excluded.txt +++ b/.vortex/docs/.utils/variables/variables.excluded.txt @@ -6,5 +6,5 @@ IFS PATH SRC_TMPDIR TEST_GITHUB_TOKEN -DREVOPS_DOCTOR_CHECK_PREFLIGHT +VORTEX_DOCTOR_CHECK_PREFLIGHT ENV_ID diff --git a/.scaffold/docs/.utils/variables/variables.inline-code-extra.txt b/.vortex/docs/.utils/variables/variables.inline-code-extra.txt similarity index 100% rename from .scaffold/docs/.utils/variables/variables.inline-code-extra.txt rename to .vortex/docs/.utils/variables/variables.inline-code-extra.txt diff --git a/.scaffold/docs/.utils/variables/variables.template.md b/.vortex/docs/.utils/variables/variables.template.md similarity index 100% rename from .scaffold/docs/.utils/variables/variables.template.md rename to .vortex/docs/.utils/variables/variables.template.md diff --git a/.scaffold/docs/README.md b/.vortex/docs/README.md similarity index 95% rename from .scaffold/docs/README.md rename to .vortex/docs/README.md index 7ade60970..29258fbbd 100644 --- a/.scaffold/docs/README.md +++ b/.vortex/docs/README.md @@ -1,4 +1,4 @@ -# Scaffold documentation +# Vortex documentation This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. diff --git a/.scaffold/docs/babel.config.js b/.vortex/docs/babel.config.js similarity index 100% rename from .scaffold/docs/babel.config.js rename to .vortex/docs/babel.config.js diff --git a/.scaffold/docs/content/README.mdx b/.vortex/docs/content/README.mdx similarity index 73% rename from .scaffold/docs/content/README.mdx rename to .vortex/docs/content/README.mdx index 96e8a452a..82dd41044 100644 --- a/.scaffold/docs/content/README.mdx +++ b/.vortex/docs/content/README.mdx @@ -6,16 +6,16 @@ sidebar_position: 1
- Scaffold Logo - Scaffold Logo + Vortex Logo + Vortex Logo

- Scaffold
Drupal project template + Vortex
Drupal project template

-Welcome to Scaffold — a project template for Drupal designed to simplify onboarding and website maintenance. +Welcome to Vortex — a project template for Drupal designed to simplify onboarding and website maintenance. At [DrevOps®](https://www.drevops.com/), we carefully maintain this template, keeping it aligned with the latest tools and validating it through @@ -51,5 +51,5 @@ Refer to [Contributing](contributing) for more details. ## License -Scaffold is licensed under the [GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) license. See +Vortex is licensed under the [GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) license. See the [LICENSE](https://github.com/drevops/scaffold/blob/develop/LICENSE) file for more details. diff --git a/.scaffold/docs/content/ci/README.mdx b/.vortex/docs/content/ci/README.mdx similarity index 100% rename from .scaffold/docs/content/ci/README.mdx rename to .vortex/docs/content/ci/README.mdx diff --git a/.scaffold/docs/content/ci/circleci.mdx b/.vortex/docs/content/ci/circleci.mdx similarity index 100% rename from .scaffold/docs/content/ci/circleci.mdx rename to .vortex/docs/content/ci/circleci.mdx diff --git a/.scaffold/docs/content/ci/github-actions.mdx b/.vortex/docs/content/ci/github-actions.mdx similarity index 100% rename from .scaffold/docs/content/ci/github-actions.mdx rename to .vortex/docs/content/ci/github-actions.mdx diff --git a/.scaffold/docs/content/contributing/README.mdx b/.vortex/docs/content/contributing/README.mdx similarity index 83% rename from .scaffold/docs/content/contributing/README.mdx rename to .vortex/docs/content/contributing/README.mdx index 6851584e2..93fcfb34f 100644 --- a/.scaffold/docs/content/contributing/README.mdx +++ b/.vortex/docs/content/contributing/README.mdx @@ -5,13 +5,13 @@ sidebar_position: 1 # Contributing -**Scaffold** is an open source project. There are numerous ways to -contribute to **Scaffold** whether you’re a developer or a non-technical +**Vortex** is an open source project. There are numerous ways to +contribute to **Vortex** whether you’re a developer or a non-technical user. ## What forms of contribution are we looking for? -Any form of contribution to **Scaffold**, be it rectifying a bug, proposing +Any form of contribution to **Vortex**, be it rectifying a bug, proposing a new feature, or enhancing our documentation, is highly appreciated. We are glad for your willingness to assist! @@ -26,7 +26,7 @@ already been reported in the [issue queue](https://github.com/drevops/scaffold/i Fantastic! Please [submit your idea](https://github.com/drevops/scaffold/issues) and we'll gladly review it. While we can't promise every suggestion will be implemented, we are always keen to hear innovative ideas for enhancing -the **Scaffold**. +the **Vortex**. ## Talk to us on Slack diff --git a/.scaffold/docs/content/contributing/code-of-conduct.mdx b/.vortex/docs/content/contributing/code-of-conduct.mdx similarity index 100% rename from .scaffold/docs/content/contributing/code-of-conduct.mdx rename to .vortex/docs/content/contributing/code-of-conduct.mdx diff --git a/.scaffold/docs/content/contributing/maintenance/README.mdx b/.vortex/docs/content/contributing/maintenance/README.mdx similarity index 100% rename from .scaffold/docs/content/contributing/maintenance/README.mdx rename to .vortex/docs/content/contributing/maintenance/README.mdx diff --git a/.scaffold/docs/content/contributing/maintenance/documentation.mdx b/.vortex/docs/content/contributing/maintenance/documentation.mdx similarity index 62% rename from .scaffold/docs/content/contributing/maintenance/documentation.mdx rename to .vortex/docs/content/contributing/maintenance/documentation.mdx index cd1df045e..64d0703fa 100644 --- a/.scaffold/docs/content/contributing/maintenance/documentation.mdx +++ b/.vortex/docs/content/contributing/maintenance/documentation.mdx @@ -1,23 +1,23 @@ # Authoring documentation -There are 2 types of the documentation that **Scaffold** provides: +There are 2 types of the documentation that **Vortex** provides: -1. This Documentation of **Scaffold** that is then deployed +1. This Documentation of **Vortex** that is then deployed to https://docs.drevops.com/ -2. Consumer site documentation that is distributed when **Scaffold** is +2. Consumer site documentation that is distributed when **Vortex** is installed. ## docs.drevops.com The Documentation (this site) is written in Markdown and located in -[`.scaffold/docs`](https://github.com/drevops/scaffold/blob/develop/.scaffold/docs) directory. This is -removed when you install **Scaffold** for a +[`.vortex/docs`](https://github.com/drevops/scaffold/blob/develop/.vortex/docs) directory. This is +removed when you install **Vortex** for a consumer site. ### Local build ```bash -cd .scaffold/docs +cd .vortex/docs ahoy build ``` @@ -25,7 +25,7 @@ Parts of the documentation is generated automatically from the codebase. To update it, run: ```bash -cd .scaffold +cd .vortex ahoy update-docs ``` @@ -35,11 +35,11 @@ be available immediately. ### Check spelling and links ```bash -cd .scaffold +cd .vortex ahoy test-docs ``` -If required, add spelling exclusions to `.scaffold/docs/cspell.json` +If required, add spelling exclusions to `.vortex/docs/cspell.json` file. ### Publishing @@ -48,15 +48,15 @@ An automated CI build publishes this documentation. - on tag, publishes to https://docs.drevops.com/ - on every commit to a branch that contains `release-docs` string publishes to https://docs.drevops.com/ -- on every push to `develop`, publishes to development version of documentation https://drevops-scaffold-docs.netlify.app +- on every push to `develop`, publishes to development version of documentation https://drevops-vortex-docs.netlify.app - on every push or tag, publishes to the temporary version of documentation with a link added to the PR as a comment. ## Consumer site documentation -**Scaffold** provides a scaffold of the consumer site documentation in the +**Vortex** provides a scaffold of the consumer site documentation in the [`docs`](https://github.com/drevops/scaffold/blob/develop/docs) directory. -After **Scaffold** is installed into the consumer site, these docs are +After **Vortex** is installed into the consumer site, these docs are intended to be used by the site maintainers and stay up-to-date with the project changes. diff --git a/.scaffold/docs/content/contributing/maintenance/release.mdx b/.vortex/docs/content/contributing/maintenance/release.mdx similarity index 84% rename from .scaffold/docs/content/contributing/maintenance/release.mdx rename to .vortex/docs/content/contributing/maintenance/release.mdx index 60dbf15cb..ef8e8f3b2 100644 --- a/.scaffold/docs/content/contributing/maintenance/release.mdx +++ b/.vortex/docs/content/contributing/maintenance/release.mdx @@ -1,6 +1,6 @@ # Release -Follow the steps below to release a new version of the Scaffold: +Follow the steps below to release a new version of the Vortex: 1. Run renovate bot locally to update all dependencies outside of the schedule: ``` @@ -13,4 +13,4 @@ renovate --schedule= --force-cli=true drevops/scaffold 6. Increment minor version of all packages in `composer.json`. 7. Update minor version of dependencies in theme's `package.json`. 8. Increment the cache version in `.circleci/config.yml`. -9. Updated documentation with `cd .scaffold && ahoy update-docs`. +9. Updated documentation with `cd .vortex && ahoy update-docs`. diff --git a/.scaffold/docs/content/contributing/maintenance/script-boilerplate.sh b/.vortex/docs/content/contributing/maintenance/script-boilerplate.sh similarity index 72% rename from .scaffold/docs/content/contributing/maintenance/script-boilerplate.sh rename to .vortex/docs/content/contributing/maintenance/script-boilerplate.sh index a8035ce57..d9aee9673 100755 --- a/.scaffold/docs/content/contributing/maintenance/script-boilerplate.sh +++ b/.vortex/docs/content/contributing/maintenance/script-boilerplate.sh @@ -7,10 +7,10 @@ # set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Example scaffold variable with a default value. -DREVOPS_SCAFFOLD_EXAMPLE_URL="${DREVOPS_SCAFFOLD_EXAMPLE_URL:-http://example.com}" +VORTEX_SCAFFOLD_EXAMPLE_URL="${VORTEX_SCAFFOLD_EXAMPLE_URL:-http://example.com}" # ------------------------------------------------------------------------------ @@ -23,10 +23,10 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 info "Started scaffold operations." -[ -z "${DREVOPS_SCAFFOLD_EXAMPLE_URL}" ] && fail "Missing required value for DREVOPS_SCAFFOLD_EXAMPLE_URL" && exit 1 +[ -z "${VORTEX_SCAFFOLD_EXAMPLE_URL}" ] && fail "Missing required value for VORTEX_SCAFFOLD_EXAMPLE_URL" && exit 1 command -v curl >/dev/null || (fail "curl command is not available." && exit 1) # Example of the script body. -curl -L -s -o /dev/null -w "%{http_code}" "${DREVOPS_SCAFFOLD_EXAMPLE_URL}" | grep -q '200\|403' && note "Requested example page" +curl -L -s -o /dev/null -w "%{http_code}" "${VORTEX_SCAFFOLD_EXAMPLE_URL}" | grep -q '200\|403' && note "Requested example page" pass "Finished scaffold operations." diff --git a/.scaffold/docs/content/contributing/maintenance/scripts.mdx b/.vortex/docs/content/contributing/maintenance/scripts.mdx similarity index 76% rename from .scaffold/docs/content/contributing/maintenance/scripts.mdx rename to .vortex/docs/content/contributing/maintenance/scripts.mdx index c39428002..1c55e44cc 100644 --- a/.scaffold/docs/content/contributing/maintenance/scripts.mdx +++ b/.vortex/docs/content/contributing/maintenance/scripts.mdx @@ -21,12 +21,12 @@ # set -eu - [ "${DREVOPS_DEBUG-}" = "1" ] && set -x + [ "${VORTEX_DEBUG-}" = "1" ] && set -x ``` 4. MUST list all variables with their default values and descriptions. i.e.: ```bash # Deployment reference, such as a git SHA. -DREVOPS_NOTIFY_REF="${DREVOPS_NOTIFY_REF:-}" +VORTEX_NOTIFY_REF="${VORTEX_NOTIFY_REF:-}" ``` 5. MUST include a delimiter between variables and the script body preceded and followed by an empty line (3 lines in total): @@ -44,7 +44,7 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 ``` 7. SHOULD include variable values checks with errors and early exist, i.e.: ```bash -[ -z "${DREVOPS_NOTIFY_REF}" ] && fail "Missing required value for DREVOPS_NOTIFY_REF" && exit 1 +[ -z "${VORTEX_NOTIFY_REF}" ] && fail "Missing required value for VORTEX_NOTIFY_REF" && exit 1 ``` 8. SHOULD include binaries checks if the script relies on them, i.e.: ```bash @@ -52,23 +52,23 @@ command -v curl > /dev/null || ( fail "curl command is not available." && exit 1 ``` 9. MUST contain an `info` message about the start of the script body, e.g.: ```bash -info "Started GitHub notification for operation ${DREVOPS_NOTIFY_EVENT}" +info "Started GitHub notification for operation ${VORTEX_NOTIFY_EVENT}" ``` 10. MUST contain an `pass` message about the finish of the script body, e.g.: ```bash -pass "Finished GitHub notification for operation ${DREVOPS_NOTIFY_EVENT}" +pass "Finished GitHub notification for operation ${VORTEX_NOTIFY_EVENT}" ``` 11. MUST use uppercase global variables 12. MUST use lowercase local variables. 13. MUST use long options instead of short options for readability. I.e., `drush cache:rebuild` instead of `drush cr`. -14. MUST use `DREVOPS_` prefix for variables, unless it is a known 3-rd party +14. MUST use `VORTEX_` prefix for variables, unless it is a known 3-rd party variable like `GITHUB_TOKEN` or `COMPOSER`. 15. MUST use script-specific prefix. I.e., for `notify.sh`, the variable to skip - notifications should start with `DREVOPS_NOTIFY_`. + notifications should start with `VORTEX_NOTIFY_`. 16. MAY rely on variables from the external scripts (not prefixed with a script-specific prefix), but MUST declare such variables in the header of the file. -17. MAY call other **Scaffold** scripts (discouraged), but MUST source them rather +17. MAY call other **Vortex** scripts (discouraged), but MUST source them rather than creating a sub-process. This is to allow passing environment variables down the call stack. 18. SHOULD use `note` messages for informing about the script progress. @@ -77,23 +77,23 @@ pass "Finished GitHub notification for operation ${DREVOPS_NOTIFY_EVENT}" ## Variables -Follow these guidelines when creating or updating **Scaffold** variables. +Follow these guidelines when creating or updating **Vortex** variables. 1. Local variables MUST be in lowercase, and global variables MUST be in uppercase. -2. All **Scaffold** variables MUST start with `DREVOPS_` to separate DrevOps from +2. All **Vortex** variables MUST start with `VORTEX_` to separate DrevOps from third-party variables. 3. Global variables MAY be re-used as-is across scripts. For instance, the - `DREVOPS_WEBROOT` variable is used in several scripts. + `VORTEX_WEBROOT` variable is used in several scripts. -4. **Scaffold** action-specific script variables MUST be scoped within their own - script. For instance, the `DREVOPS_PROVISION_OVERRIDE_DB` +4. **Vortex** action-specific script variables MUST be scoped within their own + script. For instance, the `VORTEX_PROVISION_OVERRIDE_DB` variable in the `provision.sh`. 5. Drupal-related variables SHOULD start with `DRUPAL_` and SHOULD have a module - name added as a second prefix. This is to separate **Scaffold**, + name added as a second prefix. This is to separate **Vortex**, third-party services variables, and Drupal variables. For instance, to set a user for Drupal's Shield module configuration, use `DRUPAL_SHIELD_USER`. @@ -103,7 +103,7 @@ Follow these guidelines when creating or updating **Scaffold** variables. ## Boilerplate script -Use the boilerplate script below to kick-start your custom **Scaffold** script. +Use the boilerplate script below to kick-start your custom **Vortex** script. import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./script-boilerplate.sh'; diff --git a/.scaffold/docs/content/contributing/maintenance/tests.mdx b/.vortex/docs/content/contributing/maintenance/tests.mdx similarity index 68% rename from .scaffold/docs/content/contributing/maintenance/tests.mdx rename to .vortex/docs/content/contributing/maintenance/tests.mdx index 49979c078..f070d1e76 100644 --- a/.scaffold/docs/content/contributing/maintenance/tests.mdx +++ b/.vortex/docs/content/contributing/maintenance/tests.mdx @@ -1,6 +1,6 @@ # Authoring tests -**Scaffold** uses [Bats](https://github.com/bats-core/bats-core) for testing. +**Vortex** uses [Bats](https://github.com/bats-core/bats-core) for testing. Bats is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected. @@ -9,31 +9,31 @@ See [Bats documentation](https://bats-core.readthedocs.io/) for more information ## Installation ```bash -npm install --prefix .scaffold/tests +npm install --prefix .vortex/tests ``` ## Usage ```bash # Run a single test. -bats .scaffold/tests/bats/helpers.bats +bats .vortex/tests/bats/helpers.bats # Some tests require Composer and container registry tokens. -TEST_GITHUB_TOKEN= TEST_DREVOPS_CONTAINER_REGISTRY_USER= TEST_DREVOPS_CONTAINER_REGISTRY_PASS= bats .scaffold/tests/bats/workflow.smoke.bats +TEST_GITHUB_TOKEN= TEST_VORTEX_CONTAINER_REGISTRY_USER= TEST_VORTEX_CONTAINER_REGISTRY_PASS= bats .vortex/tests/bats/workflow.smoke.bats # To preserve test run directory. -bats --no-tempdir-cleanup .scaffold/tests/bats/helpers.bats +bats --no-tempdir-cleanup .vortex/tests/bats/helpers.bats # To override Bats temporary directory where tests are ran (required for container tests). mkdir -p $HOME/.bats-tmp # run once -TMPDIR=$HOME/.bats-tmp bats .scaffold/tests/bats/helpers.bats +TMPDIR=$HOME/.bats-tmp bats .vortex/tests/bats/helpers.bats # Run all tests, preserving the temporary directory. TEST_GITHUB_TOKEN= \ -TEST_DREVOPS_CONTAINER_REGISTRY_USER= \ -TEST_DREVOPS_CONTAINER_REGISTRY_PASS= \ +TEST_VORTEX_CONTAINER_REGISTRY_USER= \ +TEST_VORTEX_CONTAINER_REGISTRY_PASS= \ TMPDIR=$HOME/.bats-tmp \ -bats --no-tempdir-cleanup .scaffold/tests/bats/*.bats +bats --no-tempdir-cleanup .vortex/tests/bats/*.bats ``` ## Updating test assets @@ -42,10 +42,10 @@ Some tests use test fixtures such as Drupal database snapshots. ### Updating demo database file dump -1. Run fresh build of **Scaffold** locally: +1. Run fresh build of **Vortex** locally: ```bash echo "DRUPAL_PROFILE=standard">>.env.local -echo "DREVOPS_PROVISION_USE_PROFILE=1">>.env.local +echo "VORTEX_PROVISION_USE_PROFILE=1">>.env.local rm .data/db.sql AHOY_CONFIRM_RESPONSE=1 ahoy build ``` diff --git a/.scaffold/docs/content/contributing/roadmap.mdx b/.vortex/docs/content/contributing/roadmap.mdx similarity index 88% rename from .scaffold/docs/content/contributing/roadmap.mdx rename to .vortex/docs/content/contributing/roadmap.mdx index 28dadbf9c..eed93841f 100644 --- a/.scaffold/docs/content/contributing/roadmap.mdx +++ b/.vortex/docs/content/contributing/roadmap.mdx @@ -13,7 +13,7 @@ bug fixes required. :::note - **Scaffold** 2.0 is coming soon! + **Vortex** 2.0 is coming soon! ::: @@ -28,7 +28,7 @@ bug fixes required. 1. Adding integration with Pantheon and Platform.sh. 2. Adding support for Cypress and Drupal Test Traits. 2. Adding support for Visual Regression and Accessibility tools. -3. Introduction of the Scaffold Dashboard as a single place for managing projects. +3. Introduction of the Vortex Dashboard as a single place for managing projects. diff --git a/.scaffold/docs/content/drupal/README.mdx b/.vortex/docs/content/drupal/README.mdx similarity index 94% rename from .scaffold/docs/content/drupal/README.mdx rename to .vortex/docs/content/drupal/README.mdx index 6c067d189..c2c3273ad 100644 --- a/.scaffold/docs/content/drupal/README.mdx +++ b/.vortex/docs/content/drupal/README.mdx @@ -5,7 +5,7 @@ sidebar_position: 1 # Drupal -When it comes to Drupal code, **Scaffold** offers several key components: +When it comes to Drupal code, **Vortex** offers several key components: 1. [Composer configuration](composer) 2. [Settings management](settings) 3. [Provision script](provision) @@ -14,7 +14,7 @@ When it comes to Drupal code, **Scaffold** offers several key components: ## Included modules -Please note that **Scaffold** is not a Drupal distribution, and it does not aim +Please note that **Vortex** is not a Drupal distribution, and it does not aim to provide a full Drupal installation profile or a set of recipes. Instead, it provides you with a minimal set of modules and dependencies to get you started. diff --git a/.scaffold/docs/content/drupal/composer.mdx b/.vortex/docs/content/drupal/composer.mdx similarity index 96% rename from .scaffold/docs/content/drupal/composer.mdx rename to .vortex/docs/content/drupal/composer.mdx index 510f0d566..f90e71e81 100644 --- a/.scaffold/docs/content/drupal/composer.mdx +++ b/.vortex/docs/content/drupal/composer.mdx @@ -7,7 +7,7 @@ sidebar_position: 1 [Composer](https://getcomposer.org/) is a dependency manager for PHP projects, including Drupal. It allows you to declare the libraries your project depends on and manages them for you. -Scaffold comes with a pre-configured `composer.json` file based on +Vortex comes with a pre-configured `composer.json` file based on the [Drupal Composer project](https://github.com/drupal-composer/drupal-project), extended to support additional features and tools. @@ -23,10 +23,10 @@ extended to support additional features and tools. [Drupal Composer project](https://github.com/drupal-composer/drupal-project) provides a starter kit for managing your site dependencies with Composer. -**Scaffold** extends the Drupal Composer project's `composer.json` to support +**Vortex** extends the Drupal Composer project's `composer.json` to support additional features and tools. -**Scaffold** team will keep the `composer.json` file up-to-date with the +**Vortex** team will keep the `composer.json` file up-to-date with the latest version of the `composer.json` in the [Drupal Composer project](https://github.com/drupal-composer/drupal-project), so you can always make sure you are using the best community practices. @@ -68,7 +68,7 @@ package. The type key can influence how the package is installed and used. ### `license` [license](https://getcomposer.org/doc/04-schema.md#license) indicates the -licence of the project. Since **Scaffold** is a template for your consumer sites +licence of the project. Since **Vortex** is a template for your consumer sites that are usually proprietary, we use `proprietary` as the default value. More license identifiers are listed at the [SPDX Open Source License Registry](https://spdx.org/licenses/). @@ -111,7 +111,7 @@ specifies the essential packages and libraries your project needs. - `drupal/admin_toolbar`, `drupal/clamav`, `drupal/coffee`, etc. - Drupal modules that provide various site administration and development helping functionalities that is usually installed across all of your Drupal sites. - **Scaffold** comes with [pre-configured settings](settings.mdx) for some of the + **Vortex** comes with [pre-configured settings](settings.mdx) for some of the modules to make them work out of the box. - [`drupal/core-recommended`](https://github.com/drupal/core-recommended): A package that provides a carefully selected set of dependencies, including @@ -120,7 +120,7 @@ specifies the essential packages and libraries your project needs. and stability, as these dependencies are maintained and curated by the Drupal community. - [`drupal/core-composer-scaffold`](https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold): - Allows downloading and placing **Drupal scaffold** files (like `index.php`, + Allows downloading and placing **Drupal_Scaffold** files (like `index.php`, `update.php`, etc.) from the `drupal/core` project into their desired location inside the web root. - [`drush/drush`](https://github.com/drush-ops/drush): A command-line shell and @@ -274,7 +274,7 @@ needs and structure of your Drupal project. - `locations`: Specifies the location of the web root (the directory containing the `index.php` file). - `file-mapping`: Determines which files are managed by the scaffold process. - Scaffold comes with sensible defaults, but you can customize this section to + Vortex comes with sensible defaults, but you can customize this section to suit your needs. - [`installer-paths`](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md): Defines custom installation paths for various types of packages like Drupal diff --git a/.scaffold/docs/content/drupal/module-scaffold.mdx b/.vortex/docs/content/drupal/module-scaffold.mdx similarity index 100% rename from .scaffold/docs/content/drupal/module-scaffold.mdx rename to .vortex/docs/content/drupal/module-scaffold.mdx diff --git a/.scaffold/docs/content/drupal/provision.mdx b/.vortex/docs/content/drupal/provision.mdx similarity index 100% rename from .scaffold/docs/content/drupal/provision.mdx rename to .vortex/docs/content/drupal/provision.mdx diff --git a/.scaffold/docs/content/drupal/settings.mdx b/.vortex/docs/content/drupal/settings.mdx similarity index 90% rename from .scaffold/docs/content/drupal/settings.mdx rename to .vortex/docs/content/drupal/settings.mdx index dfa588614..c0b6c47b1 100644 --- a/.scaffold/docs/content/drupal/settings.mdx +++ b/.vortex/docs/content/drupal/settings.mdx @@ -7,7 +7,7 @@ sidebar_position: 2 The `settings.php` file provides the primary configuration for a Drupal site, including its database connection, file paths, and various other settings. -**Scaffold** ships with own streamlined version of +**Vortex** ships with own streamlined version of the [`settings.php`](https://github.com/drevops/scaffold/blob/develop/web/sites/default/settings.php) and [`services.yml`](https://github.com/drevops/scaffold/blob/develop/web/sites/default/services.yml) files. @@ -16,7 +16,7 @@ the settings apply correctly per environment. These tests are supposed to be maintained within your project, ensuring that settings activated by specific environments and environment variables are applied accurately. -The default **Drupal scaffold**'s [`default.settings.php`](https://github.com/drevops/scaffold/blob/develop/web/sites/default/default.settings.php) +The default **Drupal_Scaffold**'s [`default.settings.php`](https://github.com/drevops/scaffold/blob/develop/web/sites/default/default.settings.php) and [`default.services.yml`](https://github.com/drevops/scaffold/blob/develop/web/sites/default/default.services.yml) files are also provided if you choose to use them instead. @@ -70,7 +70,7 @@ environments. :::info - The `$DREVOPS_PROVISION_ENVIRONMENT` environment variable can be utilized + The `$VORTEX_PROVISION_ENVIRONMENT` environment variable can be utilized within post-provision custom scripts, allowing targeted code execution based on specific environments. Refer to [Provision](provision.mdx) for additional information. @@ -121,7 +121,7 @@ temporary override during testing. ### 4. Per-environment overrides Configurations in this section alter the site's behavior based on the -environment. Out-of-the-box, **Scaffold** provides overrides for CI and Local +environment. Out-of-the-box, **Vortex** provides overrides for CI and Local environments. You can add additional overrides for other environments as needed. @@ -131,7 +131,7 @@ You can add additional overrides for other environments as needed. This section includes any additional module-specific settings from the `/includes` directory. -**Scaffold** ships with settings overrides for several popular contributed modules +**Vortex** ships with settings overrides for several popular contributed modules used in almost every project. The per environment overrides for modules should be also placed into files @@ -148,12 +148,12 @@ functionality. ## Testing settings with unit tests -**Scaffold** provides a [set of unit tests](https://github.com/drevops/scaffold/blob/develop/tests/phpunit/Drupal) that +**Vortex** provides a [set of unit tests](https://github.com/drevops/scaffold/blob/develop/tests/phpunit/Drupal) that ensure that the settings apply correctly per environment. These tests are supposed to be maintained within your project, ensuring that settings activated by specific environments and environment variables are applied accurately. -After installing **Scaffold**, run `vendor/bin/phpunit --group=drupal_settings` to -run the tests for the settings provided by **Scaffold**. +After installing **Vortex**, run `vendor/bin/phpunit --group=drupal_settings` to +run the tests for the settings provided by **Vortex**. You may simply remove these tests if you do not want to maintain them. diff --git a/.scaffold/docs/content/drupal/theme-scaffold.mdx b/.vortex/docs/content/drupal/theme-scaffold.mdx similarity index 100% rename from .scaffold/docs/content/drupal/theme-scaffold.mdx rename to .vortex/docs/content/drupal/theme-scaffold.mdx diff --git a/.scaffold/docs/content/getting-started/architecture.mdx b/.vortex/docs/content/getting-started/architecture.mdx similarity index 93% rename from .scaffold/docs/content/getting-started/architecture.mdx rename to .vortex/docs/content/getting-started/architecture.mdx index 70959c949..4fa8ee483 100644 --- a/.scaffold/docs/content/getting-started/architecture.mdx +++ b/.vortex/docs/content/getting-started/architecture.mdx @@ -4,13 +4,13 @@ hide: --- # Architecture -**Scaffold** offers a pre-configured project template that is reliable, tested and +**Vortex** offers a pre-configured project template that is reliable, tested and ready-to-use. Its main goal is to streamline onboarding, making it as quick and efficient as possible. -## Zen of **Scaffold** +## Zen of **Vortex** -Similar to [Zen of Python](https://www.python.org/dev/peps/pep-0020/), **Scaffold** +Similar to [Zen of Python](https://www.python.org/dev/peps/pep-0020/), **Vortex** is built on its own set of principles: * Simple is better than complex. @@ -53,10 +53,10 @@ with addition of several configuration files and directories. │ ├── library # Library of hook implementations. │ └── prod # Hook implementations that run in prod environment. ├── patches # Patches for packages. -├── scripts # Composer, Scaffold and custom project scripts. +├── scripts # Composer, Vortex and custom project scripts. │ ├── composer # Composer scripts. │ ├── custom # Custom project scripts. -│ └── drevops # Scaffold workflow scripts. +│ └── drevops # Vortex workflow scripts. ├── tests # Integration and configuration tests. │ ├── behat # Behat BDD tests. │ └── phpunit # Configuration unit tests @@ -92,11 +92,11 @@ with addition of several configuration files and directories. ## Scripts -**Scaffold** provides a set of [POSIX](https://en.wikipedia.org/wiki/POSIX)-compliant +**Vortex** provides a set of [POSIX](https://en.wikipedia.org/wiki/POSIX)-compliant shell scripts designed to orchestrate workflows. During installation, the scripts are added to your project repository into -`scripts/drevops` directory. +`scripts/vortex` directory. Using shell scripts instead of compiled binaries allows you to modify files to fit your needs without requiring to learn an additional programming language, @@ -114,13 +114,13 @@ compile sources, or waiting for someone upstream to update the code. > A workflow is a sequence of steps or tasks to accomplish a specific goal. -**Scaffold** comes with as set of pre-defined workflow scripts used to +**Vortex** comes with as set of pre-defined workflow scripts used to standardise the development process. -For example, the `scripts/drevops/download-db.sh` script is used to download a +For example, the `scripts/vortex/download-db.sh` script is used to download a database from any supported hosting provider or a custom location. -Another example is a `scripts/drevops/provision.sh` script that is used to +Another example is a `scripts/vortex/provision.sh` script that is used to provision a website in a consistent way, allowing to alter the flow using [environment variables](../workflows/variables.mdx) and enhance it via custom scripts. diff --git a/.scaffold/docs/content/getting-started/faqs.mdx b/.vortex/docs/content/getting-started/faqs.mdx similarity index 76% rename from .scaffold/docs/content/getting-started/faqs.mdx rename to .vortex/docs/content/getting-started/faqs.mdx index c7a05615f..b1339879f 100644 --- a/.scaffold/docs/content/getting-started/faqs.mdx +++ b/.vortex/docs/content/getting-started/faqs.mdx @@ -1,9 +1,9 @@ # FAQs -## Why would I use **Scaffold** instead of just using Drupal Composer template? +## Why would I use **Vortex** instead of just using Drupal Composer template? You can use Drupal Composer template, but that will be your step 1. Your next -step would be to add all the missing pieces that **Scaffold** provides, +step would be to add all the missing pieces that **Vortex** provides, such as CI integrations, tooling configuration, workflows, deployment scripts, hosting-specific configurations, documentation. @@ -15,18 +15,18 @@ and would block it). And you would have to maintain all of that and apply the updates to all the projects that you have (if you like things to be consistent, of course). -**Scaffold** covers this out of the box: you can override anything +**Vortex** covers this out of the box: you can override anything you want in your project, but still receive updates and improvements from -**Scaffold** in the future. Your team will also have a central place to +**Vortex** in the future. Your team will also have a central place to look for the documentation and the tools that they need to use. -## Can I use **Scaffold** with my existing project? +## Can I use **Vortex** with my existing project? -Yes, you can install **Scaffold** into your existing project. +Yes, you can install **Vortex** into your existing project. -## Can I use **Scaffold** with my existing project and keep my existing CI? +## Can I use **Vortex** with my existing project and keep my existing CI? -Yes, but you would need to update your CI configuration to use **Scaffold**'s +Yes, but you would need to update your CI configuration to use **Vortex**'s workflow scripts. :::note @@ -35,7 +35,7 @@ workflow scripts. ::: -## Can I use **Scaffold** with my existing project and keep my existing hosting? +## Can I use **Vortex** with my existing project and keep my existing hosting? Yes, but you would need to update some of the deployment scripts to match your hosting provider. @@ -46,23 +46,23 @@ hosting provider. ::: -## I do not like some of the decisions made in **Scaffold**. Can I make changes? +## I do not like some of the decisions made in **Vortex**. Can I make changes? -Yes, you can change anything you want. **Scaffold** is a project template, +Yes, you can change anything you want. **Vortex** is a project template, which means that you can disable/remove certain features. But it also means that you may need to maintain these changes in the future yourself. Feel free to [open an issue](https://github.com/drevops/scaffold/issues) to -discuss any of the decisions made in **Scaffold**. +discuss any of the decisions made in **Vortex**. ## I do not need all these features? It looks like an overkill. -One of the core principles of **Scaffold** is to provide +One of the core principles of **Vortex** is to provide rich features to all projects, regardless of their size. If you think that some of the features are not required for your project, then -**Scaffold** is not for you. However, there were cases when people have -discovered some new tools and approaches by using **Scaffold** and have +**Vortex** is not for you. However, there were cases when people have +discovered some new tools and approaches by using **Vortex** and have decided to keep them in their projects. So, you may want to give it a try. :::note @@ -75,7 +75,7 @@ decided to keep them in their projects. So, you may want to give it a try. ## I think it is too opinionated. -**Scaffold** is opinionated to the point to make it work as a project +**Vortex** is opinionated to the point to make it work as a project template. There are some changes that you can make to the project, but there are also some that have to stay in order to make tools "talk" to each other. @@ -83,9 +83,9 @@ There could be some cases when it is unreasonably opinionated - we consider this as a defect and would be happy to fix it. Please provide your feedback in the [issue queue](https://github.com/drevops/scaffold/issues). -## How easy is it to upgrade **Scaffold** in my project? +## How easy is it to upgrade **Vortex** in my project? -We provide a command to update **Scaffold** to the latest version. When it +We provide a command to update **Vortex** to the latest version. When it runs, it will update the scaffolded code to the latest version. You would then need to manually resolve any conflicts that may arise. This process is similar to how developers manually copying the changes from one project to another, but @@ -105,7 +105,7 @@ someone else has full control of the code that drives your project. ## How easy is it choose the features that I need? -**Scaffold** provides an installer that allows you to choose the features +**Vortex** provides an installer that allows you to choose the features that you need interactively. It is usually used as a part of the project creation process. @@ -125,7 +125,7 @@ same way as it would be built in your hosting (if your hosting uses Docker). The other reason is that CircleCI supports passing the build artifacts between jobs via cache. This becomes really powerful on large consumer sites, where -building the project takes a long time. **Scaffold** mitigates this by +building the project takes a long time. **Vortex** mitigates this by providing a [CI configuration](https://github.com/drevops/scaffold/blob/develop/.circleci/config.yml) used to download and cache the database overnight and use this cache for all the builds during the day, skipping the long database download and import diff --git a/.scaffold/docs/content/getting-started/features.mdx b/.vortex/docs/content/getting-started/features.mdx similarity index 97% rename from .scaffold/docs/content/getting-started/features.mdx rename to .vortex/docs/content/getting-started/features.mdx index fd7a33980..9a6d0bcdf 100644 --- a/.scaffold/docs/content/getting-started/features.mdx +++ b/.vortex/docs/content/getting-started/features.mdx @@ -68,12 +68,12 @@ The following list includes ✅ completed and 🚧 upcoming features. * 📖 Documentation * ✅ Your project [README.md](https://github.com/drevops/scaffold/blob/develop/README.dist.md) * ✅ Your [project documentation](https://github.com/drevops/scaffold/blob/develop/docs) - * ✅ [Scaffold documentation](https://docs.drevops.com/) -* 🧪 Scaffold + * ✅ [Vortex documentation](https://docs.drevops.com/) +* 🧪 Vortex * ✅ Unit test coverage for scripts * ✅ Functional test coverage for workflows * ✅ Integration test coverage for deployments - * ✅ Scaffold updates + * ✅ Vortex updates * ✅ [Basic installer](https://install.drevops.com/) * 🚧 Advanced installer CLI UI * 🚧 Advances installer Web UI diff --git a/.scaffold/docs/content/getting-started/installation.mdx b/.vortex/docs/content/getting-started/installation.mdx similarity index 78% rename from .scaffold/docs/content/getting-started/installation.mdx rename to .vortex/docs/content/getting-started/installation.mdx index a9e915765..09c757707 100644 --- a/.scaffold/docs/content/getting-started/installation.mdx +++ b/.vortex/docs/content/getting-started/installation.mdx @@ -4,18 +4,18 @@ sidebar_position: 1 # Installation -The installation process consists of installing the **Scaffold** template +The installation process consists of installing the **Vortex** template followed by setting up the integrations with the required services. We automated the first part by providing an in interactive installer. The second part is a manual process that requires you to follow the instructions provided for each service. -## Installing Scaffold into a new project +## Installing Vortex into a new project 1. Create a new directory for your project and navigate to it. -2. Run the following command to install the **Scaffold** template. +2. Run the following command to install the **Vortex** template. ```shell title="Install using interactive prompts" curl -SsL https://install.drevops.com > install.php && php install.php ``` @@ -30,10 +30,10 @@ for each service. 4. Create a new repository on GitHub and push the initial commit to it. -## Installing Scaffold into an existing project +## Installing Vortex into an existing project The installer cannot predict the state of your project, so it is recommended to -initialise **Scaffold** into a new directory and then merge the changes from +initialise **Vortex** into a new directory and then merge the changes from your existing project into the new one. :::warning @@ -49,7 +49,7 @@ your existing project into the new one. 3. Remove all files except for `.git` directory. -4. Run the following command to install the **Scaffold** template. +4. Run the following command to install the **Vortex** template. ```shell title="Install using interactive prompts" curl -SsL https://install.drevops.com > install.php && php install.php ``` @@ -57,16 +57,16 @@ your existing project into the new one. 5. Commit the changes to the new branch. 6. Copy the files from the temporary directory back into the project directory, -overriding the files that were installed by **Scaffold**. Git status will show -the changes between the **Scaffold** files and your files. +overriding the files that were installed by **Vortex**. Git status will show +the changes between the **Vortex** files and your files. 7. Selectively choose which changes to keep and which to discard: - Potentially, you may want to remove the module and theme examples provided - by **Scaffold**. + by **Vortex**. - `composer.json` would need to be merged manually, preserving **all** - the entries from the **Scaffold's** `composer.json`. + the entries from the **Vortex's** `composer.json`. - `composer.lock` would need to be removed and fully regenerated by running `composer install`. diff --git a/.scaffold/docs/content/hosting/README.mdx b/.vortex/docs/content/hosting/README.mdx similarity index 100% rename from .scaffold/docs/content/hosting/README.mdx rename to .vortex/docs/content/hosting/README.mdx diff --git a/.scaffold/docs/content/hosting/acquia.mdx b/.vortex/docs/content/hosting/acquia.mdx similarity index 100% rename from .scaffold/docs/content/hosting/acquia.mdx rename to .vortex/docs/content/hosting/acquia.mdx diff --git a/.scaffold/docs/content/hosting/lagoon.mdx b/.vortex/docs/content/hosting/lagoon.mdx similarity index 100% rename from .scaffold/docs/content/hosting/lagoon.mdx rename to .vortex/docs/content/hosting/lagoon.mdx diff --git a/.scaffold/docs/content/tools/README.mdx b/.vortex/docs/content/tools/README.mdx similarity index 91% rename from .scaffold/docs/content/tools/README.mdx rename to .vortex/docs/content/tools/README.mdx index 1f1bdf82b..504e536fa 100644 --- a/.scaffold/docs/content/tools/README.mdx +++ b/.vortex/docs/content/tools/README.mdx @@ -5,7 +5,7 @@ sidebar_position: 1 # Tools -Scaffold comes with a set of tools to help you develop and maintain your Drupal +Vortex comes with a set of tools to help you develop and maintain your Drupal project. The tools have their own configuration files with sensible defaults to make them work @@ -20,7 +20,7 @@ Head over to the tool-specific documentation to learn more. | [Ahoy](ahoy.mdx) | CLI command wrapper | | [Behat](behat.mdx) | Testing framework for for auto-testing your business expectations | | [Docker](docker.mdx) | A platform for containerizing and running applications | -| [Doctor](doctor.mdx) | Check **Scaffold** project requirements or print info | +| [Doctor](doctor.mdx) | Check **Vortex** project requirements or print info | | [Drush](drush.mdx) | Command line shell and Unix scripting interface for Drupal | | [Gherkin Lint](gherkin-lint.mdx) | Provides a Gherkin linter for PHP | | [Git artifact](git-artifact.mdx) | Package and push files to remote repositories | diff --git a/.scaffold/docs/content/tools/ahoy.mdx b/.vortex/docs/content/tools/ahoy.mdx similarity index 93% rename from .scaffold/docs/content/tools/ahoy.mdx rename to .vortex/docs/content/tools/ahoy.mdx index 629c65c70..ea314f5fd 100644 --- a/.scaffold/docs/content/tools/ahoy.mdx +++ b/.vortex/docs/content/tools/ahoy.mdx @@ -10,7 +10,7 @@ with zero code and dependencies. Usually, Ahoy is used to wrap the commands to make the development workflow consistent and easy to use. -Scaffold comes with [pre-configured Ahoy file](https://github.com/drevops/scaffold/blob/develop/.ahoy.yml) that has +Vortex comes with [pre-configured Ahoy file](https://github.com/drevops/scaffold/blob/develop/.ahoy.yml) that has commands wrapped around the most common tasks: - Working with containers diff --git a/.scaffold/docs/content/tools/behat.mdx b/.vortex/docs/content/tools/behat.mdx similarity index 95% rename from .scaffold/docs/content/tools/behat.mdx rename to .vortex/docs/content/tools/behat.mdx index 19376d4ee..2c3339136 100644 --- a/.scaffold/docs/content/tools/behat.mdx +++ b/.vortex/docs/content/tools/behat.mdx @@ -6,7 +6,7 @@ https://docs.behat.org/en/latest/user_guide.html > A php framework for auto-testing your business expectations. -Scaffold comes with [pre-configured Behat profiles](https://github.com/drevops/scaffold/blob/develop/behat.yml) for Drupal projects. +Vortex comes with [pre-configured Behat profiles](https://github.com/drevops/scaffold/blob/develop/behat.yml) for Drupal projects. ## Usage @@ -112,14 +112,14 @@ Feature: Homepage Then I save screenshot ``` -The profile can be overridden using `$DREVOPS_CI_BEHAT_PROFILE` environment +The profile can be overridden using `$VORTEX_CI_BEHAT_PROFILE` environment variable set in the CI configuration. ## Ignoring fail in CI This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_BEHAT_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_BEHAT_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. ## Writing tests diff --git a/.scaffold/docs/content/tools/docker.mdx b/.vortex/docs/content/tools/docker.mdx similarity index 92% rename from .scaffold/docs/content/tools/docker.mdx rename to .vortex/docs/content/tools/docker.mdx index 18b99ba8e..5f2012015 100644 --- a/.scaffold/docs/content/tools/docker.mdx +++ b/.vortex/docs/content/tools/docker.mdx @@ -6,7 +6,7 @@ https://github.com/docker/compose > Docker is a platform for developing, shipping, and running applications in > containers. -Scaffold provides a configuration for Docker and Docker Compose to run the +Vortex provides a configuration for Docker and Docker Compose to run the project in all environments using containers. Special thanks to Lagoon for providing @@ -74,7 +74,7 @@ configuration and services. ## Using Docker -Scaffold uses Docker to run the project in a containerized environment locally +Vortex uses Docker to run the project in a containerized environment locally and in CI. Some of the commands are wrapped in the Ahoy script as a shorthand. But all @@ -90,7 +90,7 @@ Docker Compose reads the configuration from the `docker-compose.yml` and YAML, which [support anchors and references](http://blog.daemonl.com/2016/02/yaml.html) that help to reduce duplication. -The file provided by Scaffold contains the following sections: +The file provided by Vortex contains the following sections: - [Volumes definitions](#volumes-definitions) - [Default user](#default-user) @@ -147,7 +147,7 @@ Changes this value if your user ID is different. ### Environment variables By default, the Docker Composer reads environment variables from the `.env` -file. Scaffold provides an additional capability to read files from `.env.local` +file. Vortex provides an additional capability to read files from `.env.local` file as well. This allows to override the environment variables locally without modifying the `.env` file. @@ -166,22 +166,22 @@ Any other variables should be defined in the `.env` file. Consider the example: ``` - TZ: ${DREVOPS_TZ:-Australia/Melbourne} + TZ: ${VORTEX_TZ:-Australia/Melbourne} # Local development URL. - DREVOPS_LOCALDEV_URL: &default-url ${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io + VORTEX_LOCALDEV_URL: &default-url ${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io # Local development route used in Lagoon images and Pygmy to route requests. LAGOON_ROUTE: *default-url ``` where -- `TZ: ${DREVOPS_TZ:-Australia/Melbourne}` - defines a variable `TZ` with a - default value of `Australia/Melbourne`, but only if `DREVOPS_TZ` variable is +- `TZ: ${VORTEX_TZ:-Australia/Melbourne}` - defines a variable `TZ` with a + default value of `Australia/Melbourne`, but only if `VORTEX_TZ` variable is not defined. -- `DREVOPS_LOCALDEV_URL: &default-url ${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io` - - defines a variable `DREVOPS_LOCALDEV_URL` with a default value of +- `VORTEX_LOCALDEV_URL: &default-url ${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io` + - defines a variable `VORTEX_LOCALDEV_URL` with a default value of `${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io`, but only if - `DREVOPS_LOCALDEV_URL` variable is not defined. The value of the variable + `VORTEX_LOCALDEV_URL` variable is not defined. The value of the variable is also stored in a YAML anchor `default-url` for later use. - `LAGOON_ROUTE: *default-url` - defines a variable `LAGOON_ROUTE` with a value of `*default-url`, which is a reference to the `default-url` YAML anchor @@ -195,7 +195,7 @@ the [official documentation](https://docs.docker.com/compose/environment-variabl Services section describes the configuration for each container. The following services are defined in the `docker-compose.yml` file provided by -Scaffold: +Vortex: - `cli` - a container that runs a shell. This container is used to run commands in the context of the project, such as `composer` or `drush`. This is also a diff --git a/.scaffold/docs/content/tools/doctor.mdx b/.vortex/docs/content/tools/doctor.mdx similarity index 100% rename from .scaffold/docs/content/tools/doctor.mdx rename to .vortex/docs/content/tools/doctor.mdx diff --git a/.scaffold/docs/content/tools/drush.mdx b/.vortex/docs/content/tools/drush.mdx similarity index 85% rename from .scaffold/docs/content/tools/drush.mdx rename to .vortex/docs/content/tools/drush.mdx index bae2f8ff6..6daac0d5f 100644 --- a/.scaffold/docs/content/tools/drush.mdx +++ b/.vortex/docs/content/tools/drush.mdx @@ -7,12 +7,12 @@ https://www.drush.org/ > update.php, executes SQL queries, runs content migrations, and misc utilities > like cron or cache rebuild. Drush can be extended by 3rd party commandfiles. -Drush is used throughout Scaffold to interact with Drupal from the workflow +Drush is used throughout Vortex to interact with Drupal from the workflow scripts and Behat tests. It also allows a developer to interact with the site via CLI during development. -While all the standard Drush commands supported, Scaffold also provides some +While all the standard Drush commands supported, Vortex also provides some shorthand commands to abstract some of the common tasks: - downloading the database dump from the remote environment diff --git a/.scaffold/docs/content/tools/gherkin-lint.mdx b/.vortex/docs/content/tools/gherkin-lint.mdx similarity index 87% rename from .scaffold/docs/content/tools/gherkin-lint.mdx rename to .vortex/docs/content/tools/gherkin-lint.mdx index 02ff8d042..6797b3289 100644 --- a/.scaffold/docs/content/tools/gherkin-lint.mdx +++ b/.vortex/docs/content/tools/gherkin-lint.mdx @@ -4,7 +4,7 @@ https://github.com/dantleech/gherkin-lint-php > Provides a Gherkin linter for PHP. -**Scaffold** comes with [Gherkin Lint configuration](https://github.com/drevops/scaffold/blob/develop/gherkinlint.json) for Behat tests. +**Vortex** comes with [Gherkin Lint configuration](https://github.com/drevops/scaffold/blob/develop/gherkinlint.json) for Behat tests. ## Usage @@ -59,5 +59,5 @@ Gherkin Lint does not support ignoring rules on the **next line**. This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_GHERKIN_LINT_IGNORE_FAILURE` environment variable to `1` to +Set `VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/git-artifact.mdx b/.vortex/docs/content/tools/git-artifact.mdx similarity index 86% rename from .scaffold/docs/content/tools/git-artifact.mdx rename to .vortex/docs/content/tools/git-artifact.mdx index 5ffeb15f8..963a5539d 100644 --- a/.scaffold/docs/content/tools/git-artifact.mdx +++ b/.vortex/docs/content/tools/git-artifact.mdx @@ -10,9 +10,9 @@ tool streamlines that process: it uses a `.gitignore.artifact` file to control which files get transferred, and overwrites the destination repository's history with each push, while preserving the source history. -Scaffold comes +Vortex comes with [pre-configured `.gitignore.artifact`](https://github.com/drevops/scaffold/blob/develop/.gitignore.artifact) -file and [deployment script](https://github.com/drevops/scaffold/blob/develop/scripts/drevops/deploy-artifact.sh) +file and [deployment script](https://github.com/drevops/scaffold/blob/develop/scripts/vortex/deploy-artifact.sh) to build the artifact in CI and push it to the remote repository in Acquia. ## Usage @@ -33,7 +33,7 @@ a regular `.gitignore` file. It is required to set the following environment variables in CI: -- `DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME`: Email address of the user who will be +- `VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME`: Email address of the user who will be committing to a remote repository. -- `DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL`: Name of the user who will be +- `VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL`: Name of the user who will be committing to a remote repository. diff --git a/.scaffold/docs/content/tools/hadolint.mdx b/.vortex/docs/content/tools/hadolint.mdx similarity index 84% rename from .scaffold/docs/content/tools/hadolint.mdx rename to .vortex/docs/content/tools/hadolint.mdx index 4a7f1b09d..4639f3281 100644 --- a/.scaffold/docs/content/tools/hadolint.mdx +++ b/.vortex/docs/content/tools/hadolint.mdx @@ -4,7 +4,7 @@ https://github.com/hadolint/hadolint > A smarter Dockerfile linter that helps you build best practice container images. -**Scaffold** does not install Hadolint. Please follow the [ +**Vortex** does not install Hadolint. Please follow the [ instructions(https://github.com/hadolint/hadolint#install) to install it on your system. @@ -34,5 +34,5 @@ RUN cd /tmp && echo "hello!" This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_HADOLINT_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_HADOLINT_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/phpcs.mdx b/.vortex/docs/content/tools/phpcs.mdx similarity index 91% rename from .scaffold/docs/content/tools/phpcs.mdx rename to .vortex/docs/content/tools/phpcs.mdx index 553fbc948..ea7114c18 100644 --- a/.scaffold/docs/content/tools/phpcs.mdx +++ b/.vortex/docs/content/tools/phpcs.mdx @@ -12,7 +12,7 @@ https://github.com/squizlabs/PHP_CodeSniffer > violations. PHP_CodeSniffer is an essential development tool that ensures your > code remains clean and consistent. -Scaffold comes with [pre-configured PHPCS ruleset](https://github.com/drevops/scaffold/blob/develop/phpcs.xml) for Drupal projects. +Vortex comes with [pre-configured PHPCS ruleset](https://github.com/drevops/scaffold/blob/develop/phpcs.xml) for Drupal projects. ## Usage @@ -99,5 +99,5 @@ $a = 1; This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_PHPCS_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_PHPCS_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/phpmd.mdx b/.vortex/docs/content/tools/phpmd.mdx similarity index 91% rename from .scaffold/docs/content/tools/phpmd.mdx rename to .vortex/docs/content/tools/phpmd.mdx index a1d541b04..75368119e 100644 --- a/.scaffold/docs/content/tools/phpmd.mdx +++ b/.vortex/docs/content/tools/phpmd.mdx @@ -14,7 +14,7 @@ https://github.com/phpmd/phpmd > - Overcomplicated expressions > - Unused parameters, methods, properties -Scaffold comes with [pre-configured PHPMD ruleset](https://github.com/drevops/scaffold/blob/develop/phpmd.xml) +Vortex comes with [pre-configured PHPMD ruleset](https://github.com/drevops/scaffold/blob/develop/phpmd.xml) for Drupal projects. ## Usage @@ -96,5 +96,5 @@ class Bar { This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_PHPMD_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_PHPMD_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/phpstan.mdx b/.vortex/docs/content/tools/phpstan.mdx similarity index 92% rename from .scaffold/docs/content/tools/phpstan.mdx rename to .vortex/docs/content/tools/phpstan.mdx index 2394ee7d2..420ae1d1c 100644 --- a/.scaffold/docs/content/tools/phpstan.mdx +++ b/.vortex/docs/content/tools/phpstan.mdx @@ -13,7 +13,7 @@ https://phpstan.org/user-guide/getting-started > line > of the code can be checked before you run the actual line. -Scaffold comes with [pre-configured PHPStan ruleset](https://github.com/drevops/scaffold/blob/develop/phpstan.neon) +Vortex comes with [pre-configured PHPStan ruleset](https://github.com/drevops/scaffold/blob/develop/phpstan.neon) for Drupal projects. @@ -94,5 +94,5 @@ $a = 1; This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_PHPSTAN_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_PHPSTAN_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/phpunit.mdx b/.vortex/docs/content/tools/phpunit.mdx similarity index 93% rename from .scaffold/docs/content/tools/phpunit.mdx rename to .vortex/docs/content/tools/phpunit.mdx index 20fa3e928..64bd99537 100644 --- a/.scaffold/docs/content/tools/phpunit.mdx +++ b/.vortex/docs/content/tools/phpunit.mdx @@ -8,7 +8,7 @@ https://github.com/sebastianbergmann/phpunit/ > PHPUnit is a programmer-oriented testing framework for PHP. -Scaffold comes with [pre-configured PHPCS ruleset](https://github.com/drevops/scaffold/blob/develop/phpunit.xml) for Drupal projects. +Vortex comes with [pre-configured PHPCS ruleset](https://github.com/drevops/scaffold/blob/develop/phpunit.xml) for Drupal projects. ## Usage @@ -128,5 +128,5 @@ $b = 2; This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_PHPUNIT_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_PHPUNIT_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/pygmy.mdx b/.vortex/docs/content/tools/pygmy.mdx similarity index 100% rename from .scaffold/docs/content/tools/pygmy.mdx rename to .vortex/docs/content/tools/pygmy.mdx diff --git a/.scaffold/docs/content/tools/rector.mdx b/.vortex/docs/content/tools/rector.mdx similarity index 89% rename from .scaffold/docs/content/tools/rector.mdx rename to .vortex/docs/content/tools/rector.mdx index 649244f2b..376d09d7d 100644 --- a/.scaffold/docs/content/tools/rector.mdx +++ b/.vortex/docs/content/tools/rector.mdx @@ -8,7 +8,7 @@ https://github.com/rectorphp/rector > Rector instantly upgrades and refactors the PHP code of your application. -Scaffold comes with [pre-configured Rector configuration](https://github.com/drevops/scaffold/blob/develop/rector.php) +Vortex comes with [pre-configured Rector configuration](https://github.com/drevops/scaffold/blob/develop/rector.php) for Drupal projects. The configuration is based on the configuration provided by [Drupal Rector](https://github.com/palantirnet/drupal-rector). @@ -50,7 +50,7 @@ Targets include custom modules and themes, settings and tests. Rector provides [config sets](https://getrector.com/documentation/set-lists) functionality that allows to enable/disable rules in bulk. -Scaffold provides the config sets for Drupal 8 and Drupal 9 deprecated code and +Vortex provides the config sets for Drupal 8 and Drupal 9 deprecated code and code style fixes. The config sets are meant to be adjusted per-project as needed. @@ -111,5 +111,5 @@ Rector does not support ignoring of the **code blocks**. This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_RECTOR_IGNORE_FAILURE` environment variable to `1` to ignore +Set `VORTEX_CI_RECTOR_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/renovate.mdx b/.vortex/docs/content/tools/renovate.mdx similarity index 96% rename from .scaffold/docs/content/tools/renovate.mdx rename to .vortex/docs/content/tools/renovate.mdx index c0790aae3..40ab2360f 100644 --- a/.scaffold/docs/content/tools/renovate.mdx +++ b/.vortex/docs/content/tools/renovate.mdx @@ -4,7 +4,7 @@ sidebar_label: Renovate # Renovate - Automated updates -Scaffold uses [Renovate](https://renovatebot.com) for automated dependency updates. +Vortex uses [Renovate](https://renovatebot.com) for automated dependency updates. The configuration is stored in [`renovate.json`](https://github.com/drevops/scaffold/blob/develop/renovate.json). It is based on [Renovate configuration for automated Drupal dependency updates](https://github.com/drevops/renovate-drupal) diff --git a/.scaffold/docs/content/tools/twig-cs-fixer.mdx b/.vortex/docs/content/tools/twig-cs-fixer.mdx similarity index 91% rename from .scaffold/docs/content/tools/twig-cs-fixer.mdx rename to .vortex/docs/content/tools/twig-cs-fixer.mdx index 48bbd3379..6a9a8f74d 100644 --- a/.scaffold/docs/content/tools/twig-cs-fixer.mdx +++ b/.vortex/docs/content/tools/twig-cs-fixer.mdx @@ -6,7 +6,7 @@ https://github.com/VincentLanglet/Twig-CS-Fixer > > Twig CS Fixer aims to be what phpcs is to php. It checks your codebase for violations on coding standards. -**Scaffold** comes with [pre-configured Twig-cs-fixer ruleset](https://github.com/drevops/scaffold/blob/develop/.twig-cs-fixer.php) for Drupal projects. +**Vortex** comes with [pre-configured Twig-cs-fixer ruleset](https://github.com/drevops/scaffold/blob/develop/.twig-cs-fixer.php) for Drupal projects. ## Usage @@ -93,5 +93,5 @@ To ignore only the **next line**: This tool runs in CI by default and fails the build if there are any violations. -Set `DREVOPS_CI_TWIG_CS_FIXER_IGNORE_FAILURE` environment variable to `1` to +Set `VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE` environment variable to `1` to ignore failures. The tool will still run and report violations, if any. diff --git a/.scaffold/docs/content/tools/xdebug.mdx b/.vortex/docs/content/tools/xdebug.mdx similarity index 97% rename from .scaffold/docs/content/tools/xdebug.mdx rename to .vortex/docs/content/tools/xdebug.mdx index 787699b9b..4958ff0bd 100644 --- a/.scaffold/docs/content/tools/xdebug.mdx +++ b/.vortex/docs/content/tools/xdebug.mdx @@ -9,7 +9,7 @@ https://xdebug.org/ > Xdebug is an extension for PHP, and provides a range of features to improve > the PHP development experience. -Scaffold comes with Xdebug pre-installed and configured for local development +Vortex comes with Xdebug pre-installed and configured for local development thanks to [Lagoon images](https://github.com/uselagoon/lagoon-images). Xdebug is also configured to work in coverage mode, allowing to run tests with diff --git a/.scaffold/docs/content/workflows/README.mdx b/.vortex/docs/content/workflows/README.mdx similarity index 100% rename from .scaffold/docs/content/workflows/README.mdx rename to .vortex/docs/content/workflows/README.mdx diff --git a/.scaffold/docs/content/workflows/deployment.mdx b/.vortex/docs/content/workflows/deployment.mdx similarity index 77% rename from .scaffold/docs/content/workflows/deployment.mdx rename to .vortex/docs/content/workflows/deployment.mdx index 0b8d0cb4f..d376a0a29 100644 --- a/.scaffold/docs/content/workflows/deployment.mdx +++ b/.vortex/docs/content/workflows/deployment.mdx @@ -5,13 +5,13 @@ sidebar_position: 3 # Deployment The deployment to a remote location is performed by the -[`scripts/drevops/deploy.sh`](https://github.com/drevops/scaffold/blob/develop/scripts/drevops/deploy.sh) _router_ +[`scripts/vortex/deploy.sh`](https://github.com/drevops/scaffold/blob/develop/scripts/vortex/deploy.sh) _router_ script. The script runs in CI only after all tests pass. The script deploys the code to a remote location by calling the -relevant scripts based on the type of deployment defined in `$DREVOPS_DEPLOY_TYPES` +relevant scripts based on the type of deployment defined in `$VORTEX_DEPLOY_TYPES` variable as a comma-separated list of one or multiple supported deployment types: - `webhook` - a webhook URL is called via CURL. @@ -25,12 +25,12 @@ variable as a comma-separated list of one or multiple supported deployment types ### Deployment action By default, an existing database will be retained during a deployment. To change -this behavior and overwrite the database, set the `$DREVOPS_DEPLOY_ACTION` +this behavior and overwrite the database, set the `$VORTEX_DEPLOY_ACTION` variable to `deploy_override_db`. ### Skipping deployments for specific Pull Requests or branches -To skip a specific Pull Request or branch using the `$DREVOPS_DEPLOY_SKIP` +To skip a specific Pull Request or branch using the `$VORTEX_DEPLOY_SKIP` variable, you would define additional environment variables with a specific naming convention in your CI configuration. @@ -42,7 +42,7 @@ Here's an example of how this can be done: set the following environment variable: ```bash - DREVOPS_DEPLOY_SKIP_PR_42=1 + VORTEX_DEPLOY_SKIP_PR_42=1 ``` #### Skipping a specific branch: @@ -54,5 +54,5 @@ Here's an example of how this can be done: Set the following environment variable: ```bash - DREVOPS_DEPLOY_SKIP_BRANCH_FEATURE_X=1 + VORTEX_DEPLOY_SKIP_BRANCH_FEATURE_X=1 ``` diff --git a/.scaffold/docs/content/workflows/development.mdx b/.vortex/docs/content/workflows/development.mdx similarity index 100% rename from .scaffold/docs/content/workflows/development.mdx rename to .vortex/docs/content/workflows/development.mdx diff --git a/.scaffold/docs/content/workflows/releasing.mdx b/.vortex/docs/content/workflows/releasing.mdx similarity index 100% rename from .scaffold/docs/content/workflows/releasing.mdx rename to .vortex/docs/content/workflows/releasing.mdx diff --git a/.scaffold/docs/content/workflows/testing.mdx b/.vortex/docs/content/workflows/testing.mdx similarity index 75% rename from .scaffold/docs/content/workflows/testing.mdx rename to .vortex/docs/content/workflows/testing.mdx index 64a37e89b..844c1dc36 100644 --- a/.scaffold/docs/content/workflows/testing.mdx +++ b/.vortex/docs/content/workflows/testing.mdx @@ -4,7 +4,7 @@ sidebar_position: 2 # Testing -**Scaffold** supports running Unit (PHPUnit) and BDD (Behat) tests. +**Vortex** supports running Unit (PHPUnit) and BDD (Behat) tests. For local development, the tests can be run using handy Ahoy commands: @@ -24,29 +24,29 @@ In CI, tests are run by calling the test binaries directly. ## Unit testing -**Scaffold** uses PHPUnit as a framework for Unit testing. +**Vortex** uses PHPUnit as a framework for Unit testing. It is configured to use a copy of Drupal core's `core/phpunit.xml.dist` configuration file. This is done to allow per-project customisations. ### Reporting -Test reports are stored in `$DREVOPS_TEST_RESULTS_DIR/phpunit` directory +Test reports are stored in `$VORTEX_TEST_RESULTS_DIR/phpunit` directory separated into multiple files and named after the suite name. These reports are usually used in CI to track tests performance and stability. -### Scaffold +### Vortex -**Scaffold** provides a Unit test scaffold for custom [modules](https://github.com/drevops/scaffold/blob/develop/web/modules/custom/ys_core/tests/src), +**Vortex** provides a Unit test scaffold for custom [modules](https://github.com/drevops/scaffold/blob/develop/web/modules/custom/ys_core/tests/src), [themes](https://github.com/drevops/scaffold/blob/develop/web/themes/custom/your_site_theme/tests/src) and [scripts](https://github.com/drevops/scaffold/blob/develop/tests/phpunit). -These tests already run in CI when you install **Scaffold** and can be used as a +These tests already run in CI when you install **Vortex** and can be used as a starting point for writing your own. #### Drupal settings tests -**Scaffold** provides a [Drupal settings tests](https://github.com/drevops/scaffold/blob/develop/tests/phpunit/DrupalSettingsTest.php) +**Vortex** provides a [Drupal settings tests](https://github.com/drevops/scaffold/blob/develop/tests/phpunit/DrupalSettingsTest.php) to test that Drupal settings are correct based on the environment type the site is running: with the number of custom modules multiplied by the number of environment types, it is easy to miss certain settings which may lead to @@ -57,7 +57,7 @@ changes to the `settings.php` file. #### CI configuration tests -**Scaffold** provides a [CI configuration tests](https://github.com/drevops/scaffold/blob/develop/tests/phpunit/CircleCiConfigTest.php) +**Vortex** provides a [CI configuration tests](https://github.com/drevops/scaffold/blob/develop/tests/phpunit/CircleCiConfigTest.php) to assert that CI configuration is correct. It is intended to be used in a consumer site and kept up-to-date with the CI configurations. @@ -67,7 +67,7 @@ unexpected surprises during the consumer site release to production. ## BDD testing -**Scaffold** uses Behat for Behavior-Driven Development (BDD) testing. +**Vortex** uses Behat for Behavior-Driven Development (BDD) testing. It provides full Behat support, including configuration in [behat.yml](https://github.com/drevops/scaffold/blob/develop/behat.yml) and a [browser container](https://github.com/drevops/scaffold/blob/develop/docker-compose.yml) to run interactive tests. @@ -92,7 +92,7 @@ Custom steps can be added into this file. Behat `default` profile configured with sensible defaults to allow running Behat with provided extensions. -In CI, the profile can be overridden using `$DREVOPS_CI_BEHAT_PROFILE` environment +In CI, the profile can be overridden using `$VORTEX_CI_BEHAT_PROFILE` environment variable. ### Parallel runs @@ -100,7 +100,7 @@ variable. In CI, Behat tests can be tagged to be split between multiple runners. The tags are then used by profiles with the identical names to run them. -Out of the box, **Scaffold** provides support for unlimited parallel +Out of the box, **Vortex** provides support for unlimited parallel runners, but only 2 parallel profiles `p0` and `p1`: a feature can be tagged by either `@p0` or `@p1` to run in a dedicated runner, or with both tags to run in both runners. @@ -127,20 +127,20 @@ and are accessible in the Artifacts tab. ### Format -Out of the box, **Scaffold** comes with [Behat Progress formatter](https://github.com/drevops/behat-format-progress-fail) +Out of the box, **Vortex** comes with [Behat Progress formatter](https://github.com/drevops/behat-format-progress-fail) Behat output formatter to show progress as TAP and fails inline. This allows to continue test runs after failures while maintaining a minimal output. ### Reporting -Test reports produced if `$DREVOPS_TEST_RESULTS_DIR` is set. They are stored in -`$DREVOPS_TEST_RESULTS_DIR/behat` directory. These reports are usually used in +Test reports produced if `$VORTEX_TEST_RESULTS_DIR` is set. They are stored in +`$VORTEX_TEST_RESULTS_DIR/behat` directory. These reports are usually used in CI to track tests performance and stability. ### Examples -**Scaffold** provides BDD test examples for custom [modules](https://github.com/drevops/scaffold/blob/develop/web/modules/custom/ys_core/tests/src) +**Vortex** provides BDD test examples for custom [modules](https://github.com/drevops/scaffold/blob/develop/web/modules/custom/ys_core/tests/src) and [themes](https://github.com/drevops/scaffold/blob/develop/web/themes/custom/your_site_theme/tests/src). -These tests already run in CI when you install **Scaffold** and can be used +These tests already run in CI when you install **Vortex** and can be used as a starting point for writing your own. diff --git a/.scaffold/docs/content/workflows/updating-scaffold.mdx b/.vortex/docs/content/workflows/updating-vortex.mdx similarity index 50% rename from .scaffold/docs/content/workflows/updating-scaffold.mdx rename to .vortex/docs/content/workflows/updating-vortex.mdx index 981ab1737..352074242 100644 --- a/.scaffold/docs/content/workflows/updating-scaffold.mdx +++ b/.vortex/docs/content/workflows/updating-vortex.mdx @@ -2,25 +2,25 @@ sidebar_position: 9 --- -# Updating Scaffold +# Updating Vortex -**Scaffold** differs from other project templates in that it is not only used +**Vortex** differs from other project templates in that it is not only used for a one-time project setup but also for ongoing maintenance. This means that -you can update **Scaffold** to the latest version at any time. +you can update **Vortex** to the latest version at any time. Once you the update process finishes, you will need to review the changes and commit them to your project. -If you have modified any of the files that are provided by **Scaffold**, -the update process will override them, because **Scaffold** is not aware of the +If you have modified any of the files that are provided by **Vortex**, +the update process will override them, because **Vortex** is not aware of the changes you have made. You would need to manually accept or reject the new changes. ```shell title="Update to the latest version" -ahoy update-scaffold +ahoy update-vortex ``` ```shell title="Update to a specific commit" -ahoy update-scaffold cb9979b2c10c59d52874be4661e9331b01d9b7c5 +ahoy update-vortex cb9979b2c10c59d52874be4661e9331b01d9b7c5 ``` diff --git a/.scaffold/docs/content/workflows/variables.mdx b/.vortex/docs/content/workflows/variables.mdx similarity index 51% rename from .scaffold/docs/content/workflows/variables.mdx rename to .vortex/docs/content/workflows/variables.mdx index d365cae0a..9d2e2cde7 100644 --- a/.scaffold/docs/content/workflows/variables.mdx +++ b/.vortex/docs/content/workflows/variables.mdx @@ -44,31 +44,239 @@ Default value: `UNDEFINED` Defined in: `ENVIRONMENT` -### `DREVOPS_ACQUIA_APP_NAME` +### `DRUPAL_ADMIN_EMAIL` + +Drupal admin email. May need to be reset if database was sanitized. + +Default value: `webmaster@your-site-url.example` + +Defined in: `.env` + +### `DRUPAL_CLAMAV_ENABLED` + +Enable ClamAV integration. + +Default value: `1` + +Defined in: `.env` + +### `DRUPAL_CLAMAV_MODE` + +ClamAV mode. + +Run ClamAV in either daemon mode by setting it to `0` (or 'daemon') or in
executable mode by setting it to `1`. + +Default value: `daemon` + +Defined in: `.env` + +### `DRUPAL_CONFIG_PATH` + +Path to configuration directory relative to the project root.
Auto-discovered from site's `settings.php` file if not set. + +Default value: `UNDEFINED` + +Defined in: `scripts/vortex/provision.sh` + +### `DRUPAL_ENVIRONMENT` + +Override detected Drupal environment type. + +Used in the application to override the automatically detected environment type. + +Default value: `UNDEFINED` + +Defined in: `ENVIRONMENT` + +### `DRUPAL_PRIVATE_FILES` + +Path to private files. + +Default value: `${DRUPAL_PUBLIC_FILES}/private` + +Defined in: `.env` + +### `DRUPAL_PROFILE` + +Drupal profile name (used only when installing from profile). + +Default value: `standard` + +Defined in: `.env`, `scripts/vortex/provision.sh` + +### `DRUPAL_PUBLIC_FILES` + +Path to public files. + +Default value: `./${VORTEX_WEBROOT}/sites/default/files` + +Defined in: `.env` + +### `DRUPAL_REDIS_ENABLED` + +Enable Redis integration.
See settings.redis.php for details. + +Default value: `UNDEFINED` + +Defined in: `.env` + +### `DRUPAL_SHIELD_PRINT` + +Shield print message. + +Default value: `Restricted access.` + +Defined in: `.env` + +### `DRUPAL_SITE_EMAIL` + +Drupal site email.
Used only when installing from profile. + +Default value: `webmaster@your-site-url.example` + +Defined in: `.env`, `scripts/vortex/provision.sh` + +### `DRUPAL_SITE_NAME` + +Drupal site name.
Used only when installing from profile. + +Default value: `${VORTEX_PROJECT}` + +Defined in: `.env`, `scripts/vortex/provision.sh` + +### `DRUPAL_STAGE_FILE_PROXY_ORIGIN` + +Stage file proxy origin. Note that HTTP Auth provided by Shield will be
automatically added to the origin URL. + +Default value: `https://www.your-site-url.example/` + +Defined in: `.env` + +### `DRUPAL_TEMPORARY_FILES` + +Path to temporary files. + +Default value: `${DRUPAL_PRIVATE_FILES}/tmp` + +Defined in: `.env` + +### `DRUPAL_THEME` + +Drupal theme name. + +Default value: `your_site_theme` + +Defined in: `.env` + +### `DRUPAL_UNBLOCK_ADMIN` + +Unblock admin account when logging in. + +Default value: `1` + +Defined in: `.env`, `scripts/vortex/login.sh`, `scripts/vortex/logout.sh` + +### `GITHUB_TOKEN` + +GitHub token used to overcome API rate limits or access private repositories.
@see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token + +Default value: `UNDEFINED` + +Defined in: `.env.local.default`, `scripts/vortex/github-labels.sh` + +### `LAGOON_PROJECT` + +Lagoon project name. May be different from [`$VORTEX_PROJECT`](#vortex_project). + +Default value: `your_site` + +Defined in: `.env`, `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/download-db-lagoon.sh` + +### `NEWRELIC_ENABLED` + +Enable New Relic in Lagoon environment. + +Set as project-wide variable. + +Default value: `UNDEFINED` + +Defined in: `LAGOON ENVIRONMENT` + +### `NEWRELIC_LICENSE` + +New Relic license. + +Set as project-wide variable. + +Default value: `UNDEFINED` + +Defined in: `LAGOON ENVIRONMENT` + +### `RENOVATE_DEPENDENCY_DASHBOARD` + +Whether to enable self-hosted Renovate bot dashboard. + +Default value: `false` + +Defined in: `CI config` + +### `RENOVATE_DRY_RUN` + +Whether to allow self-hosted Renovate bot make changes to the repository. + +Default value: `false` + +Defined in: `CI config` + +### `RENOVATE_GIT_AUTHOR` + +Commit author for self-hosted Renovate bot. + +Default value: `'Renovate Self Hosted '` + +Defined in: `CI config` + +### `RENOVATE_TOKEN` + +Self-hosted Renovate bot token.
Create a GitHub token with a permission to write to a repository. + +Default value: `UNDEFINED` + +Defined in: `CI config` + +### `TARGET_ENV_REMAP` + +Special variable to remap target env to the sub-domain prefix based on UI name. + +Default value: `${target_env}` + +Defined in: `scripts/vortex/task-purge-cache-acquia.sh` + +### `VORTEX_ACQUIA_APP_NAME` Acquia application name to download the database from. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/task-copy-db-acquia.sh`, `scripts/drevops/task-copy-files-acquia.sh`, `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `.env`, `scripts/vortex/download-db-acquia.sh`, `scripts/vortex/task-copy-db-acquia.sh`, `scripts/vortex/task-copy-files-acquia.sh`, `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_ACQUIA_KEY` +### `VORTEX_ACQUIA_KEY` Acquia Cloud API key. Default value: `UNDEFINED` -Defined in: `.env.local.default`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/task-copy-db-acquia.sh`, `scripts/drevops/task-copy-files-acquia.sh`, `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `.env.local.default`, `scripts/vortex/download-db-acquia.sh`, `scripts/vortex/task-copy-db-acquia.sh`, `scripts/vortex/task-copy-files-acquia.sh`, `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_ACQUIA_SECRET` +### `VORTEX_ACQUIA_SECRET` Acquia Cloud API secret. Default value: `UNDEFINED` -Defined in: `.env.local.default`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/task-copy-db-acquia.sh`, `scripts/drevops/task-copy-files-acquia.sh`, `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `.env.local.default`, `scripts/vortex/download-db-acquia.sh`, `scripts/vortex/task-copy-db-acquia.sh`, `scripts/vortex/task-copy-files-acquia.sh`, `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_CI_ARTIFACTS` +### `VORTEX_CI_ARTIFACTS` Directory to store test artifacts in CI. @@ -76,7 +284,7 @@ Default value: `/tmp/artifacts` Defined in: `CI config` -### `DREVOPS_CI_BEHAT_IGNORE_FAILURE` +### `VORTEX_CI_BEHAT_IGNORE_FAILURE` Ignore Behat test failures. @@ -84,7 +292,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_BEHAT_PROFILE` +### `VORTEX_CI_BEHAT_PROFILE` Test Behat profile to use in CI. If not set, the `default` profile will be used. @@ -92,7 +300,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_COMPOSER_VALIDATE_IGNORE_FAILURE` +### `VORTEX_CI_COMPOSER_VALIDATE_IGNORE_FAILURE` Ignore `composer validate` failures. @@ -100,7 +308,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_GHERKIN_LINT_IGNORE_FAILURE` +### `VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE` Ignore Gherkin Lint failures. @@ -108,7 +316,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_HADOLINT_IGNORE_FAILURE` +### `VORTEX_CI_HADOLINT_IGNORE_FAILURE` Ignore Hadolint failures. @@ -116,7 +324,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_NPM_LINT_IGNORE_FAILURE` +### `VORTEX_CI_NPM_LINT_IGNORE_FAILURE` Ignore NPM linters failures. @@ -124,7 +332,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_PHPCS_IGNORE_FAILURE` +### `VORTEX_CI_PHPCS_IGNORE_FAILURE` Ignore PHPCS failures. @@ -132,7 +340,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_PHPMD_IGNORE_FAILURE` +### `VORTEX_CI_PHPMD_IGNORE_FAILURE` Ignore PHPMD failures. @@ -140,7 +348,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_PHPSTAN_IGNORE_FAILURE` +### `VORTEX_CI_PHPSTAN_IGNORE_FAILURE` Ignore PHPStan failures. @@ -148,7 +356,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_PHPUNIT_IGNORE_FAILURE` +### `VORTEX_CI_PHPUNIT_IGNORE_FAILURE` Ignore PHPUnit test failures. @@ -156,7 +364,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_RECTOR_IGNORE_FAILURE` +### `VORTEX_CI_RECTOR_IGNORE_FAILURE` Ignore Rector failures. @@ -164,7 +372,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_CI_TEST_RESULTS` +### `VORTEX_CI_TEST_RESULTS` Directory to store test results in CI. @@ -172,7 +380,7 @@ Default value: `/tmp/tests` Defined in: `CI config` -### `DREVOPS_CI_TWIG_CS_FIXER_IGNORE_FAILURE` +### `VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE` Ignore Twig CS Fixer failures. @@ -180,7 +388,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_COMPOSER_VERBOSE` +### `VORTEX_COMPOSER_VERBOSE` Print output from Composer install. @@ -188,7 +396,7 @@ Default value: `1` Defined in: `.env` -### `DREVOPS_CONTAINER_REGISTRY` +### `VORTEX_CONTAINER_REGISTRY` Container registry name. @@ -196,251 +404,251 @@ Provide port, if required as `:`. Default value: `docker.io` -Defined in: `.env`, `scripts/drevops/login-container-registry.sh` +Defined in: `.env`, `scripts/vortex/login-container-registry.sh` -### `DREVOPS_CONTAINER_REGISTRY_PASS` +### `VORTEX_CONTAINER_REGISTRY_PASS` The password (token) to log into the container registry. Default value: `${DOCKER_PASS}` -Defined in: `.env.local.default`, `scripts/drevops/login-container-registry.sh` +Defined in: `.env.local.default`, `scripts/vortex/login-container-registry.sh` -### `DREVOPS_CONTAINER_REGISTRY_USER` +### `VORTEX_CONTAINER_REGISTRY_USER` The username to log into the container registry. Default value: `${DOCKER_USER}` -Defined in: `.env.local.default`, `scripts/drevops/login-container-registry.sh` +Defined in: `.env.local.default`, `scripts/vortex/login-container-registry.sh` -### `DREVOPS_DB_DIR` +### `VORTEX_DB_DIR` Database dump directory. Default value: `./.data` -Defined in: `.env`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/download-db-container-registry.sh`, `scripts/drevops/download-db-curl.sh`, `scripts/drevops/download-db-ftp.sh`, `scripts/drevops/download-db-lagoon.sh`, `scripts/drevops/download-db.sh`, `scripts/drevops/provision.sh` +Defined in: `.env`, `scripts/vortex/download-db-acquia.sh`, `scripts/vortex/download-db-container-registry.sh`, `scripts/vortex/download-db-curl.sh`, `scripts/vortex/download-db-ftp.sh`, `scripts/vortex/download-db-lagoon.sh`, `scripts/vortex/download-db.sh`, `scripts/vortex/provision.sh` -### `DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME` +### `VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME` Acquia database name to download the database from. Default value: `your_site` -Defined in: `.env`, `scripts/drevops/download-db-acquia.sh` +Defined in: `.env`, `scripts/vortex/download-db-acquia.sh` -### `DREVOPS_DB_DOWNLOAD_CURL_URL` +### `VORTEX_DB_DOWNLOAD_CURL_URL` Database dump file sourced from CURL, with optional HTTP Basic Authentication
credentials embedded into the value. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/download-db-curl.sh` +Defined in: `.env`, `scripts/vortex/download-db-curl.sh` -### `DREVOPS_DB_DOWNLOAD_ENVIRONMENT` +### `VORTEX_DB_DOWNLOAD_ENVIRONMENT` Environment to download the database from. Default value: `prod` -Defined in: `.env`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/download-db-lagoon.sh` +Defined in: `.env`, `scripts/vortex/download-db-acquia.sh`, `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_FORCE` +### `VORTEX_DB_DOWNLOAD_FORCE` Always override existing downloaded DB dump. Default value: `1` -Defined in: `.env.local.default`, `.env.local.default`, `scripts/drevops/download-db.sh` +Defined in: `.env.local.default`, `.env.local.default`, `scripts/vortex/download-db.sh` -### `DREVOPS_DB_DOWNLOAD_FTP_FILE` +### `VORTEX_DB_DOWNLOAD_FTP_FILE` Database dump FTP file name. Default value: `db.sql` -Defined in: `.env`, `scripts/drevops/download-db-ftp.sh` +Defined in: `.env`, `scripts/vortex/download-db-ftp.sh` -### `DREVOPS_DB_DOWNLOAD_FTP_HOST` +### `VORTEX_DB_DOWNLOAD_FTP_HOST` Database dump FTP host. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/download-db-ftp.sh` +Defined in: `.env`, `scripts/vortex/download-db-ftp.sh` -### `DREVOPS_DB_DOWNLOAD_FTP_PASS` +### `VORTEX_DB_DOWNLOAD_FTP_PASS` Database dump FTP password. Default value: `UNDEFINED` -Defined in: `.env.local.default`, `scripts/drevops/download-db-ftp.sh` +Defined in: `.env.local.default`, `scripts/vortex/download-db-ftp.sh` -### `DREVOPS_DB_DOWNLOAD_FTP_PORT` +### `VORTEX_DB_DOWNLOAD_FTP_PORT` Database dump FTP port. Default value: `21` -Defined in: `.env`, `scripts/drevops/download-db-ftp.sh` +Defined in: `.env`, `scripts/vortex/download-db-ftp.sh` -### `DREVOPS_DB_DOWNLOAD_FTP_USER` +### `VORTEX_DB_DOWNLOAD_FTP_USER` Database dump FTP user. Default value: `UNDEFINED` -Defined in: `.env.local.default`, `scripts/drevops/download-db-ftp.sh` +Defined in: `.env.local.default`, `scripts/vortex/download-db-ftp.sh` -### `DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR` +### `VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR` Remote DB dump directory location. Default value: `/tmp` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE` +### `VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE` Remote DB dump file name. Cached by the date suffix. Default value: `db_$(date +%Y%m%d).sql` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP` +### `VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP` Wildcard file name to cleanup previously created dump files. -Cleanup runs only if the variable is set and [`$DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE`](#drevops_db_download_lagoon_remote_file)
does not exist. +Cleanup runs only if the variable is set and [`$VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE`](#vortex_db_download_lagoon_remote_file)
does not exist. Default value: `db_*.sql` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST` +### `VORTEX_DB_DOWNLOAD_LAGOON_SSH_HOST` The SSH host of the Lagoon environment. Default value: `ssh.lagoon.amazeeio.cloud` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_LAGOON_SSH_PORT` +### `VORTEX_DB_DOWNLOAD_LAGOON_SSH_PORT` The SSH port of the Lagoon environment. Default value: `32222` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_LAGOON_SSH_USER` +### `VORTEX_DB_DOWNLOAD_LAGOON_SSH_USER` The SSH user of the Lagoon environment. -Default value: `${LAGOON_PROJECT}-${DREVOPS_DB_DOWNLOAD_ENVIRONMENT}` +Default value: `${LAGOON_PROJECT}-${VORTEX_DB_DOWNLOAD_ENVIRONMENT}` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_PROCEED` +### `VORTEX_DB_DOWNLOAD_PROCEED` Proceed with download. Default value: `1` -Defined in: `scripts/drevops/download-db.sh` +Defined in: `scripts/vortex/download-db.sh` -### `DREVOPS_DB_DOWNLOAD_REFRESH` +### `VORTEX_DB_DOWNLOAD_REFRESH` Flag to download a fresh copy of the database. Default value: `UNDEFINED` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_SOURCE` +### `VORTEX_DB_DOWNLOAD_SOURCE` -Note that "container_registry" works only for database-in-image
database storage (when [`$DREVOPS_DB_IMAGE`](#drevops_db_image) variable has a value). +Note that "container_registry" works only for database-in-image
database storage (when [`$VORTEX_DB_IMAGE`](#vortex_db_image) variable has a value). Default value: `curl` -Defined in: `.env`, `scripts/drevops/download-db.sh` +Defined in: `.env`, `scripts/vortex/download-db.sh` -### `DREVOPS_DB_DOWNLOAD_SSH_FILE` +### `VORTEX_DB_DOWNLOAD_SSH_FILE` Default SSH file used if custom fingerprint is not provided. Default value: `${HOME}/.ssh/id_rsa` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT` +### `VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT` SSH key fingerprint used to connect to a remote. Default value: `UNDEFINED` -Defined in: `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/vortex/download-db-lagoon.sh` -### `DREVOPS_DB_EXPORT_CONTAINER_REGISTRY` +### `VORTEX_DB_EXPORT_CONTAINER_REGISTRY` Container registry name. Default value: `docker.io` -Defined in: `scripts/drevops/export-db-image.sh` +Defined in: `scripts/vortex/export-db-image.sh` -### `DREVOPS_DB_EXPORT_FILE_DIR` +### `VORTEX_DB_EXPORT_FILE_DIR` Directory with database dump file. Default value: `./.data` -Defined in: `scripts/drevops/export-db-file.sh` +Defined in: `scripts/vortex/export-db-file.sh` -### `DREVOPS_DB_EXPORT_IMAGE` +### `VORTEX_DB_EXPORT_IMAGE` Container image to store in a form of `/`. Default value: `UNDEFINED` -Defined in: `scripts/drevops/export-db-image.sh`, `scripts/drevops/export-db.sh` +Defined in: `scripts/vortex/export-db-image.sh`, `scripts/vortex/export-db.sh` -### `DREVOPS_DB_EXPORT_IMAGE_ARCHIVE_FILE` +### `VORTEX_DB_EXPORT_IMAGE_ARCHIVE_FILE` Container image archive file name. Default value: `UNDEFINED` -Defined in: `scripts/drevops/export-db-image.sh` +Defined in: `scripts/vortex/export-db-image.sh` -### `DREVOPS_DB_EXPORT_IMAGE_DIR` +### `VORTEX_DB_EXPORT_IMAGE_DIR` Directory with database image archive file. -Default value: `${DREVOPS_DB_DIR}` +Default value: `${VORTEX_DB_DIR}` -Defined in: `scripts/drevops/export-db-image.sh` +Defined in: `scripts/vortex/export-db-image.sh` -### `DREVOPS_DB_EXPORT_SERVICE_NAME` +### `VORTEX_DB_EXPORT_SERVICE_NAME` The service name to capture. Default value: `mariadb` -Defined in: `scripts/drevops/export-db-image.sh` +Defined in: `scripts/vortex/export-db-image.sh` -### `DREVOPS_DB_FILE` +### `VORTEX_DB_FILE` Database dump file name. Default value: `db.sql` -Defined in: `.env`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/download-db-curl.sh`, `scripts/drevops/download-db-ftp.sh`, `scripts/drevops/download-db-lagoon.sh`, `scripts/drevops/provision.sh` +Defined in: `.env`, `scripts/vortex/download-db-acquia.sh`, `scripts/vortex/download-db-curl.sh`, `scripts/vortex/download-db-ftp.sh`, `scripts/vortex/download-db-lagoon.sh`, `scripts/vortex/provision.sh` -### `DREVOPS_DB_IMAGE` +### `VORTEX_DB_IMAGE` Name of the database container image to use. @@ -448,27 +656,27 @@ See https://github.com/drevops/mariadb-drupal-data to seed your DB image. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/download-db-container-registry.sh`, `scripts/drevops/export-db.sh`, `scripts/drevops/info.sh`, `scripts/drevops/provision.sh` +Defined in: `.env`, `scripts/vortex/download-db-container-registry.sh`, `scripts/vortex/export-db.sh`, `scripts/vortex/info.sh`, `scripts/vortex/provision.sh` -### `DREVOPS_DB_IMAGE_BASE` +### `VORTEX_DB_IMAGE_BASE` Name of the database fall-back container image to use. -If the image specified in [`$DREVOPS_DB_IMAGE`](#drevops_db_image) does not exist and base
image was provided - it will be used as a "clean slate" for the database. +If the image specified in [`$VORTEX_DB_IMAGE`](#vortex_db_image) does not exist and base
image was provided - it will be used as a "clean slate" for the database. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/download-db-container-registry.sh` +Defined in: `.env`, `scripts/vortex/download-db-container-registry.sh` -### `DREVOPS_DEBUG` +### `VORTEX_DEBUG` -Set to `1` to print debug information in Scaffold scripts. +Set to `1` to print debug information in Vortex scripts. Default value: `UNDEFINED` Defined in: `.env.local.default` -### `DREVOPS_DEPLOY_ACTION` +### `VORTEX_DEPLOY_ACTION` Deployment action. @@ -479,81 +687,81 @@ Values can be one of: deploy, deploy_override_db, destroy. Default value: `create` -Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/deploy.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/deploy.sh` -### `DREVOPS_DEPLOY_ALLOW_SKIP` +### `VORTEX_DEPLOY_ALLOW_SKIP` Flag to allow skipping of a deployment using additional flags. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy.sh` +Defined in: `scripts/vortex/deploy.sh` -### `DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH` +### `VORTEX_DEPLOY_ARTIFACT_DST_BRANCH` Remote repository branch. Can be a specific branch or a token.
@see https://github.com/drevops/git-artifact#token-support Default value: `[branch]` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE` +### `VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE` Remote repository to push code to. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL` +### `VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL` Name of the user who will be committing to a remote repository. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME` +### `VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME` Email address of the user who will be committing to a remote repository. Default value: `Deployment Robot` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_ARTIFACT_LOG` +### `VORTEX_DEPLOY_ARTIFACT_LOG` Deployment log file name. -Default value: `${DREVOPS_DEPLOY_ARTIFACT_ROOT}/deployment_log.txt` +Default value: `${VORTEX_DEPLOY_ARTIFACT_ROOT}/deployment_log.txt` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_ARTIFACT_ROOT` +### `VORTEX_DEPLOY_ARTIFACT_ROOT` The root directory where the deployment script should run from. Defaults to
the current directory. Default value: `$(pwd)` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_ARTIFACT_SRC` +### `VORTEX_DEPLOY_ARTIFACT_SRC` Source of the code to be used for artifact building. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-artifact.sh` +Defined in: `scripts/vortex/deploy-artifact.sh` -### `DREVOPS_DEPLOY_BRANCH` +### `VORTEX_DEPLOY_BRANCH` The Lagoon branch to deploy. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/deploy.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/deploy.sh` -### `DREVOPS_DEPLOY_CONTAINER_REGISTRY` +### `VORTEX_DEPLOY_CONTAINER_REGISTRY` Container registry name. @@ -561,73 +769,73 @@ Provide port, if required as `:`. Default value: `docker.io` -Defined in: `scripts/drevops/deploy-container-registry.sh` +Defined in: `scripts/vortex/deploy-container-registry.sh` -### `DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG` +### `VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG` The tag of the container image. Default value: `latest` -Defined in: `scripts/drevops/deploy-container-registry.sh` +Defined in: `scripts/vortex/deploy-container-registry.sh` -### `DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP` +### `VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP` Comma-separated map of container services and images to use for deployment in
format "service1=org/image1,service2=org/image2". Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-container-registry.sh`, `scripts/drevops/export-db.sh` +Defined in: `scripts/vortex/deploy-container-registry.sh`, `scripts/vortex/export-db.sh` -### `DREVOPS_DEPLOY_CONTAINER_REGISTRY_PASS` +### `VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS` The password to login into the container registry. -Default value: `${DREVOPS_CONTAINER_REGISTRY_PASS}` +Default value: `${VORTEX_CONTAINER_REGISTRY_PASS}` -Defined in: `scripts/drevops/deploy-container-registry.sh` +Defined in: `scripts/vortex/deploy-container-registry.sh` -### `DREVOPS_DEPLOY_CONTAINER_REGISTRY_USER` +### `VORTEX_DEPLOY_CONTAINER_REGISTRY_USER` The username to login into the container registry. -Default value: `${DREVOPS_CONTAINER_REGISTRY_USER}` +Default value: `${VORTEX_CONTAINER_REGISTRY_USER}` -Defined in: `scripts/drevops/deploy-container-registry.sh` +Defined in: `scripts/vortex/deploy-container-registry.sh` -### `DREVOPS_DEPLOY_LAGOON_INSTANCE` +### `VORTEX_DEPLOY_LAGOON_INSTANCE` The Lagoon instance name to interact with. Default value: `amazeeio` -Defined in: `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_LAGOON_INSTANCE_GRAPHQL` +### `VORTEX_DEPLOY_LAGOON_INSTANCE_GRAPHQL` The Lagoon instance GraphQL endpoint to interact with. Default value: `https://api.lagoon.amazeeio.cloud/graphql` -Defined in: `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_LAGOON_INSTANCE_HOSTNAME` +### `VORTEX_DEPLOY_LAGOON_INSTANCE_HOSTNAME` The Lagoon instance hostname to interact with. Default value: `ssh.lagoon.amazeeio.cloud` -Defined in: `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_LAGOON_INSTANCE_PORT` +### `VORTEX_DEPLOY_LAGOON_INSTANCE_PORT` The Lagoon instance port to interact with. Default value: `32222` -Defined in: `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_MODE` +### `VORTEX_DEPLOY_MODE` Deployment mode. @@ -635,49 +843,49 @@ Values can be one of: branch, tag. Default value: `branch` -Defined in: `scripts/drevops/deploy.sh` +Defined in: `scripts/vortex/deploy.sh` -### `DREVOPS_DEPLOY_PR` +### `VORTEX_DEPLOY_PR` The PR number to deploy. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/deploy.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/deploy.sh` -### `DREVOPS_DEPLOY_PR_BASE_BRANCH` +### `VORTEX_DEPLOY_PR_BASE_BRANCH` The PR base branch (the branch the PR is raised against). Defaults to 'develop'. Default value: `develop` -Defined in: `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_PR_HEAD` +### `VORTEX_DEPLOY_PR_HEAD` The PR head branch to deploy. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_SSH_FILE` +### `VORTEX_DEPLOY_SSH_FILE` Default SSH file used if custom fingerprint is not provided. Default value: `${HOME}/.ssh/id_rsa` -Defined in: `scripts/drevops/deploy-artifact.sh`, `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-artifact.sh`, `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_SSH_FINGERPRINT` +### `VORTEX_DEPLOY_SSH_FINGERPRINT` SSH key fingerprint used to connect to remote. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-artifact.sh`, `scripts/drevops/deploy-lagoon.sh` +Defined in: `scripts/vortex/deploy-artifact.sh`, `scripts/vortex/deploy-lagoon.sh` -### `DREVOPS_DEPLOY_TYPES` +### `VORTEX_DEPLOY_TYPES` The type of deployment. @@ -687,83 +895,83 @@ See https://docs.drevops.com/workflows/deploy Default value: `artifact` -Defined in: `.env`, `scripts/drevops/deploy.sh` +Defined in: `.env`, `scripts/vortex/deploy.sh` -### `DREVOPS_DEPLOY_WEBHOOK_METHOD` +### `VORTEX_DEPLOY_WEBHOOK_METHOD` Webhook call method. Default value: `GET` -Defined in: `scripts/drevops/deploy-webhook.sh` +Defined in: `scripts/vortex/deploy-webhook.sh` -### `DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS` +### `VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS` The status code of the expected response. Default value: `200` -Defined in: `scripts/drevops/deploy-webhook.sh` +Defined in: `scripts/vortex/deploy-webhook.sh` -### `DREVOPS_DEPLOY_WEBHOOK_URL` +### `VORTEX_DEPLOY_WEBHOOK_URL` The URL of the webhook to call. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-webhook.sh` +Defined in: `scripts/vortex/deploy-webhook.sh` -### `DREVOPS_DOCTOR_CHECK_BOOTSTRAP` +### `VORTEX_DOCTOR_CHECK_BOOTSTRAP` Default value: `UNDEFINED` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_CONTAINERS` +### `VORTEX_DOCTOR_CHECK_CONTAINERS` Default value: `0` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_MINIMAL` +### `VORTEX_DOCTOR_CHECK_MINIMAL` Check minimal Doctor requirements. Default value: `0` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_PORT` +### `VORTEX_DOCTOR_CHECK_PORT` Default value: `UNDEFINED` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_PYGMY` +### `VORTEX_DOCTOR_CHECK_PYGMY` Default value: `UNDEFINED` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_SSH` +### `VORTEX_DOCTOR_CHECK_SSH` Default value: `UNDEFINED` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_TOOLS` +### `VORTEX_DOCTOR_CHECK_TOOLS` Default value: `1` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOCTOR_CHECK_WEBSERVER` +### `VORTEX_DOCTOR_CHECK_WEBSERVER` Default value: `UNDEFINED` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY` +### `VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY` Container registry name. @@ -771,25 +979,25 @@ Provide port, if required as `:`. Default value: `docker.io` -Defined in: `scripts/drevops/download-db-container-registry.sh` +Defined in: `scripts/vortex/download-db-container-registry.sh` -### `DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS` +### `VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS` The password to login into the container registry. -Default value: `${DREVOPS_CONTAINER_REGISTRY_PASS}` +Default value: `${VORTEX_CONTAINER_REGISTRY_PASS}` -Defined in: `scripts/drevops/download-db-container-registry.sh` +Defined in: `scripts/vortex/download-db-container-registry.sh` -### `DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_USER` +### `VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_USER` The username to login into the container registry. -Default value: `${DREVOPS_CONTAINER_REGISTRY_USER}` +Default value: `${VORTEX_CONTAINER_REGISTRY_USER}` -Defined in: `scripts/drevops/download-db-container-registry.sh` +Defined in: `scripts/vortex/download-db-container-registry.sh` -### `DREVOPS_EXPORT_CODE_DIR` +### `VORTEX_EXPORT_CODE_DIR` Directory to store exported code. @@ -797,7 +1005,7 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED` +### `VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED` Proceed with container image deployment after it was exported. @@ -805,63 +1013,63 @@ Default value: `UNDEFINED` Defined in: `CI config` -### `DREVOPS_GITHUB_DELETE_EXISTING_LABELS` +### `VORTEX_GITHUB_DELETE_EXISTING_LABELS` Delete existing labels to mirror the list below. Default value: `1` -Defined in: `scripts/drevops/github-labels.sh` +Defined in: `scripts/vortex/github-labels.sh` -### `DREVOPS_GITHUB_REPO` +### `VORTEX_GITHUB_REPO` GitHub repository as "org/name" to perform operations on. Default value: `UNDEFINED` -Defined in: `scripts/drevops/github-labels.sh` +Defined in: `scripts/vortex/github-labels.sh` -### `DREVOPS_INSTALLER_URL` +### `VORTEX_INSTALLER_URL` The URL of the installer script. Default value: `https://install.drevops.com` -Defined in: `scripts/drevops/update-scaffold.sh` +Defined in: `scripts/vortex/update-vortex.sh` -### `DREVOPS_INSTALL_COMMIT` +### `VORTEX_INSTALL_COMMIT` -Allow providing custom Scaffold commit hash to download the sources from. +Allow providing custom Vortex commit hash to download the sources from. Default value: `UNDEFINED` -Defined in: `scripts/drevops/update-scaffold.sh` +Defined in: `scripts/vortex/update-vortex.sh` -### `DREVOPS_LAGOONCLI_FORCE_INSTALL` +### `VORTEX_LAGOONCLI_FORCE_INSTALL` Flag to force the installation of Lagoon CLI. Default value: `UNDEFINED` -Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_LAGOONCLI_PATH` +### `VORTEX_LAGOONCLI_PATH` Location of the Lagoon CLI binary. Default value: `/tmp` -Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_LAGOONCLI_VERSION` +### `VORTEX_LAGOONCLI_VERSION` Lagoon CLI version to use. Default value: `latest` -Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/deploy-lagoon.sh`, `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_LAGOON_PRODUCTION_BRANCH` +### `VORTEX_LAGOON_PRODUCTION_BRANCH` Dedicated branch to identify the production environment. @@ -869,87 +1077,87 @@ Default value: `main` Defined in: `.env` -### `DREVOPS_LOCALDEV_URL` +### `VORTEX_LOCALDEV_URL` Local development URL.
Override only if you need to use a different URL than the default. Default value: `.docker.amazee.io` -Defined in: `.env.local.default`, `scripts/drevops/info.sh` +Defined in: `.env.local.default`, `scripts/vortex/info.sh` -### `DREVOPS_MIRROR_CODE_BRANCH_DST` +### `VORTEX_MIRROR_CODE_BRANCH_DST` Destination branch name to mirror code. Default value: `UNDEFINED` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_BRANCH_SRC` +### `VORTEX_MIRROR_CODE_BRANCH_SRC` Source branch name to mirror code. Default value: `UNDEFINED` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_GIT_USER_EMAIL` +### `VORTEX_MIRROR_CODE_GIT_USER_EMAIL` Name of the user who will be committing to a remote repository. Default value: `UNDEFINED` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_GIT_USER_NAME` +### `VORTEX_MIRROR_CODE_GIT_USER_NAME` Email address of the user who will be committing to a remote repository. Default value: `Deployment Robot` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_PUSH` +### `VORTEX_MIRROR_CODE_PUSH` Flag to push the branch. Default value: `UNDEFINED` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_REMOTE_DST` +### `VORTEX_MIRROR_CODE_REMOTE_DST` Destination remote name. Default value: `origin` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_SSH_FILE` +### `VORTEX_MIRROR_CODE_SSH_FILE` Default SSH file used if custom fingerprint is not provided. Default value: `UNDEFINED` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_MIRROR_CODE_SSH_FINGERPRINT` +### `VORTEX_MIRROR_CODE_SSH_FINGERPRINT` SSH key fingerprint used to connect to a remote. Default value: `UNDEFINED` -Defined in: `scripts/drevops/mirror-code.sh` +Defined in: `scripts/vortex/mirror-code.sh` -### `DREVOPS_NOTIFY_BRANCH` +### `VORTEX_NOTIFY_BRANCH` Deployment reference branch. Default value: `UNDEFINED` -Defined in: `scripts/drevops/notify-github.sh`, `scripts/drevops/notify-jira.sh` +Defined in: `scripts/vortex/notify-github.sh`, `scripts/vortex/notify-jira.sh` -### `DREVOPS_NOTIFY_CHANNELS` +### `VORTEX_NOTIFY_CHANNELS` The channels of the notifications. @@ -957,33 +1165,33 @@ Can be a combination of comma-separated values: email,newrelic,github,jira Default value: `email` -Defined in: `.env`, `scripts/drevops/notify.sh` +Defined in: `.env`, `scripts/vortex/notify.sh` -### `DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL` +### `VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL` Environment URL to notify about. -Default value: `${DREVOPS_NOTIFY_ENVIRONMENT_URL}` +Default value: `${VORTEX_NOTIFY_ENVIRONMENT_URL}` -Defined in: `scripts/drevops/notify-email.sh` +Defined in: `scripts/vortex/notify-email.sh` -### `DREVOPS_NOTIFY_EMAIL_FROM` +### `VORTEX_NOTIFY_EMAIL_FROM` Email to send notifications from. Default value: `webmaster@your-site-url.example` -Defined in: `.env`, `scripts/drevops/notify-email.sh` +Defined in: `.env`, `scripts/vortex/notify-email.sh` -### `DREVOPS_NOTIFY_EMAIL_PROJECT` +### `VORTEX_NOTIFY_EMAIL_PROJECT` Project name to notify. -Default value: `${DREVOPS_NOTIFY_PROJECT}` +Default value: `${VORTEX_NOTIFY_PROJECT}` -Defined in: `scripts/drevops/notify-email.sh` +Defined in: `scripts/vortex/notify-email.sh` -### `DREVOPS_NOTIFY_EMAIL_RECIPIENTS` +### `VORTEX_NOTIFY_EMAIL_RECIPIENTS` Email address(es) to send notifications to. @@ -991,49 +1199,49 @@ Multiple names can be specified as a comma-separated list of email addresses
Separate multiple headers with a pipe `|`.
Example: `Content-type: application/json|Authorization: Bearer API_KEY`. Default value: `Content-type: application/json` -Defined in: `scripts/drevops/notify-webhook.sh` +Defined in: `scripts/vortex/notify-webhook.sh` -### `DREVOPS_NOTIFY_WEBHOOK_METHOD` +### `VORTEX_NOTIFY_WEBHOOK_METHOD` Webhook method like POST, GET, PUT. Default value: `POST` -Defined in: `scripts/drevops/notify-webhook.sh` +Defined in: `scripts/vortex/notify-webhook.sh` -### `DREVOPS_NOTIFY_WEBHOOK_PAYLOAD` +### `VORTEX_NOTIFY_WEBHOOK_PAYLOAD` Webhook message body as json format. -Default value: `${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD:-{\"channel\": \"Channel 1\", \"message\": \"%message%\", \"project\": \"%project%\", \"ref\": \"%ref%\", \"timestamp\": \"%timestamp%\", \"environment_url\": \"%environment_url%\"}}` +Default value: `${VORTEX_NOTIFY_WEBHOOK_PAYLOAD:-{\"channel\": \"Channel 1\", \"message\": \"%message%\", \"project\": \"%project%\", \"ref\": \"%ref%\", \"timestamp\": \"%timestamp%\", \"environment_url\": \"%environment_url%\"}}` -Defined in: `scripts/drevops/notify-webhook.sh` +Defined in: `scripts/vortex/notify-webhook.sh` -### `DREVOPS_NOTIFY_WEBHOOK_RESPONSE_STATUS` +### `VORTEX_NOTIFY_WEBHOOK_RESPONSE_STATUS` The pattern of response code return by curl. Default value: `200` -Defined in: `scripts/drevops/notify-webhook.sh` +Defined in: `scripts/vortex/notify-webhook.sh` -### `DREVOPS_NOTIFY_WEBHOOK_URL` +### `VORTEX_NOTIFY_WEBHOOK_URL` Webhook URL. Default value: `UNDEFINED` -Defined in: `scripts/drevops/notify-webhook.sh` +Defined in: `scripts/vortex/notify-webhook.sh` -### `DREVOPS_NPM_VERBOSE` +### `VORTEX_NPM_VERBOSE` Print output from NPM install. @@ -1249,7 +1457,7 @@ Default value: `UNDEFINED` Defined in: `.env` -### `DREVOPS_PROJECT` +### `VORTEX_PROJECT` Project name. @@ -1257,9 +1465,9 @@ Drives internal naming within the codebase.
Does not affect the names of co Default value: `your_site` -Defined in: `.env`, `scripts/drevops/info.sh` +Defined in: `.env`, `scripts/vortex/info.sh` -### `DREVOPS_PROVISION_ACQUIA_SKIP` +### `VORTEX_PROVISION_ACQUIA_SKIP` Skip Drupal site provisioning in Acquia environment. @@ -1267,15 +1475,15 @@ Default value: `UNDEFINED` Defined in: `ACQUIA ENVIRONMENT` -### `DREVOPS_PROVISION_ENVIRONMENT` +### `VORTEX_PROVISION_ENVIRONMENT` Current environment name discovered during site provisioning. Default value: `UNDEFINED` -Defined in: `scripts/drevops/provision.sh` +Defined in: `scripts/vortex/provision.sh` -### `DREVOPS_PROVISION_OVERRIDE_DB` +### `VORTEX_PROVISION_OVERRIDE_DB` Overwrite existing database if it exists. @@ -1283,51 +1491,51 @@ Usually set to `0` in deployed environments and can be temporary set to `1` for< Default value: `UNDEFINED` -Defined in: `.env`, `.env.local.default`, `scripts/drevops/provision.sh` +Defined in: `.env`, `.env.local.default`, `scripts/vortex/provision.sh` -### `DREVOPS_PROVISION_POST_OPERATIONS_SKIP` +### `VORTEX_PROVISION_POST_OPERATIONS_SKIP` Flag to skip running of operations after site provision is complete.
Useful to only import the database from file (or install from profile) and not
perform any additional operations. For example, when need to capture database
state before any updates ran (for example, DB caching in CI). Default value: `0` -Defined in: `scripts/drevops/provision.sh` +Defined in: `scripts/vortex/provision.sh` -### `DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE` +### `VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE` Path to file with custom sanitization SQL queries. -To skip custom sanitization, remove the file defined in
DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE variable from the codebase. +To skip custom sanitization, remove the file defined in
VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE variable from the codebase. Default value: `./scripts/sanitize.sql` -Defined in: `scripts/drevops/provision-sanitize-db.sh` +Defined in: `scripts/vortex/provision-sanitize-db.sh` -### `DREVOPS_PROVISION_SANITIZE_DB_EMAIL` +### `VORTEX_PROVISION_SANITIZE_DB_EMAIL` Sanitization email pattern. Sanitization is enabled by default in all
non-production environments.
@see https://docs.drevops.com/workflows/build#sanitization Default value: `user_%uid@your-site-url.example` -Defined in: `.env`, `scripts/drevops/provision-sanitize-db.sh` +Defined in: `.env`, `scripts/vortex/provision-sanitize-db.sh` -### `DREVOPS_PROVISION_SANITIZE_DB_PASSWORD` +### `VORTEX_PROVISION_SANITIZE_DB_PASSWORD` Password replacement used for sanitised database. Default value: `` -Defined in: `.env`, `scripts/drevops/provision-sanitize-db.sh` +Defined in: `.env`, `scripts/vortex/provision-sanitize-db.sh` -### `DREVOPS_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL` +### `VORTEX_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL` Replace username with email after database sanitization. Useful when email
is used as username. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/provision-sanitize-db.sh` +Defined in: `.env`, `scripts/vortex/provision-sanitize-db.sh` -### `DREVOPS_PROVISION_SANITIZE_DB_SKIP` +### `VORTEX_PROVISION_SANITIZE_DB_SKIP` Skip database sanitization. @@ -1335,33 +1543,33 @@ Database sanitization is enabled by default in all non-production
environme Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/provision.sh` +Defined in: `.env`, `scripts/vortex/provision.sh` -### `DREVOPS_PROVISION_SKIP` +### `VORTEX_PROVISION_SKIP` Flag to skip site provisioning. Default value: `UNDEFINED` -Defined in: `scripts/drevops/provision.sh` +Defined in: `scripts/vortex/provision.sh` -### `DREVOPS_PROVISION_USE_MAINTENANCE_MODE` +### `VORTEX_PROVISION_USE_MAINTENANCE_MODE` Put the site into a maintenance mode during site provisioning. Default value: `1` -Defined in: `.env`, `scripts/drevops/provision.sh` +Defined in: `.env`, `scripts/vortex/provision.sh` -### `DREVOPS_PROVISION_USE_PROFILE` +### `VORTEX_PROVISION_USE_PROFILE` Set to `1` to install a site from profile instead of the database file dump. Default value: `UNDEFINED` -Defined in: `.env`, `scripts/drevops/provision.sh` +Defined in: `.env`, `scripts/vortex/provision.sh` -### `DREVOPS_PURGE_CACHE_ACQUIA_SKIP` +### `VORTEX_PURGE_CACHE_ACQUIA_SKIP` Skip purging of edge cache in Acquia environment. @@ -1369,50 +1577,50 @@ Default value: `UNDEFINED` Defined in: `ACQUIA ENVIRONMENT` -### `DREVOPS_SHOW_LOGIN` +### `VORTEX_SHOW_LOGIN` Show one-time login link. Default value: `UNDEFINED` -Defined in: `scripts/drevops/info.sh` +Defined in: `scripts/vortex/info.sh` -### `DREVOPS_SSH_FILE` +### `VORTEX_SSH_FILE` Default SSH key file. Default value: `${HOME}/.ssh/id_rsa` -Defined in: `scripts/drevops/doctor.sh` +Defined in: `scripts/vortex/doctor.sh` -### `DREVOPS_SSH_PREFIX` +### `VORTEX_SSH_PREFIX` Prefix used to load SSH key from prefixes environment variables: -- DREVOPS_[`${DREVOPS_SSH_PREFIX}`](#drevops_ssh_prefix)_SSH_FINGERPRINT - the variable name with the
SSH key fingerprint value. -- DREVOPS_[`${DREVOPS_SSH_PREFIX}`](#drevops_ssh_prefix)_SSH_FILE - the variable name with the SSH +- VORTEX_[`${VORTEX_SSH_PREFIX}`](#vortex_ssh_prefix)_SSH_FINGERPRINT - the variable name with the
SSH key fingerprint value. +- VORTEX_[`${VORTEX_SSH_PREFIX}`](#vortex_ssh_prefix)_SSH_FILE - the variable name with the SSH key file path. Default value: `UNDEFINED` -Defined in: `scripts/drevops/setup-ssh.sh` +Defined in: `scripts/vortex/setup-ssh.sh` -### `DREVOPS_TASK_COPY_DB_ACQUIA_DST` +### `VORTEX_TASK_COPY_DB_ACQUIA_DST` Destination environment name to copy DB to. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-copy-db-acquia.sh` +Defined in: `scripts/vortex/task-copy-db-acquia.sh` -### `DREVOPS_TASK_COPY_DB_ACQUIA_NAME` +### `VORTEX_TASK_COPY_DB_ACQUIA_NAME` Database name to copy. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-copy-db-acquia.sh` +Defined in: `scripts/vortex/task-copy-db-acquia.sh` -### `DREVOPS_TASK_COPY_DB_ACQUIA_SKIP` +### `VORTEX_TASK_COPY_DB_ACQUIA_SKIP` Skip copying of database between Acquia environment. @@ -1420,39 +1628,39 @@ Default value: `UNDEFINED` Defined in: `ACQUIA ENVIRONMENT` -### `DREVOPS_TASK_COPY_DB_ACQUIA_SRC` +### `VORTEX_TASK_COPY_DB_ACQUIA_SRC` Source environment name to copy DB from. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-copy-db-acquia.sh` +Defined in: `scripts/vortex/task-copy-db-acquia.sh` -### `DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL` +### `VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL` Interval in seconds to check task status. Default value: `10` -Defined in: `scripts/drevops/task-copy-db-acquia.sh` +Defined in: `scripts/vortex/task-copy-db-acquia.sh` -### `DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_RETRIES` +### `VORTEX_TASK_COPY_DB_ACQUIA_STATUS_RETRIES` Number of status retrieval retries. If this limit reached and task has not
yet finished, the task is considered failed. Default value: `600` -Defined in: `scripts/drevops/task-copy-db-acquia.sh` +Defined in: `scripts/vortex/task-copy-db-acquia.sh` -### `DREVOPS_TASK_COPY_FILES_ACQUIA_DST` +### `VORTEX_TASK_COPY_FILES_ACQUIA_DST` Destination environment name to copy to. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-copy-files-acquia.sh` +Defined in: `scripts/vortex/task-copy-files-acquia.sh` -### `DREVOPS_TASK_COPY_FILES_ACQUIA_SKIP` +### `VORTEX_TASK_COPY_FILES_ACQUIA_SKIP` Skip copying of files between Acquia environment. @@ -1460,143 +1668,143 @@ Default value: `UNDEFINED` Defined in: `ACQUIA ENVIRONMENT` -### `DREVOPS_TASK_COPY_FILES_ACQUIA_SRC` +### `VORTEX_TASK_COPY_FILES_ACQUIA_SRC` Source environment name to copy from. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-copy-files-acquia.sh` +Defined in: `scripts/vortex/task-copy-files-acquia.sh` -### `DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL` +### `VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL` Interval in seconds to check task status. Default value: `10` -Defined in: `scripts/drevops/task-copy-files-acquia.sh` +Defined in: `scripts/vortex/task-copy-files-acquia.sh` -### `DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES` +### `VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES` Number of status retrieval retries. If this limit reached and task has not
yet finished, the task is considered failed. Default value: `300` -Defined in: `scripts/drevops/task-copy-files-acquia.sh` +Defined in: `scripts/vortex/task-copy-files-acquia.sh` -### `DREVOPS_TASK_LAGOON_BRANCH` +### `VORTEX_TASK_LAGOON_BRANCH` The Lagoon branch to run the task on. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_COMMAND` +### `VORTEX_TASK_LAGOON_COMMAND` The task command to execute. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_INSTANCE` +### `VORTEX_TASK_LAGOON_INSTANCE` The Lagoon instance name to interact with. Default value: `amazeeio` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_INSTANCE_GRAPHQL` +### `VORTEX_TASK_LAGOON_INSTANCE_GRAPHQL` The Lagoon instance GraphQL endpoint to interact with. Default value: `https://api.lagoon.amazeeio.cloud/graphql` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_INSTANCE_HOSTNAME` +### `VORTEX_TASK_LAGOON_INSTANCE_HOSTNAME` The Lagoon instance hostname to interact with. Default value: `ssh.lagoon.amazeeio.cloud` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_INSTANCE_PORT` +### `VORTEX_TASK_LAGOON_INSTANCE_PORT` The Lagoon instance port to interact with. Default value: `32222` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_NAME` +### `VORTEX_TASK_LAGOON_NAME` The task name. Default value: `Automation task` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_LAGOON_PROJECT` +### `VORTEX_TASK_LAGOON_PROJECT` The Lagoon project to run tasks for. Default value: `${LAGOON_PROJECT}` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE` +### `VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE` File with a list of domains that should be purged. Default value: `domains.txt` -Defined in: `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV` +### `VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV` An environment name to purge cache for. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL` +### `VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL` Interval in seconds to check task status. Default value: `10` -Defined in: `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES` +### `VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES` Number of status retrieval retries. If this limit reached and task has not
yet finished, the task is considered failed. Default value: `300` -Defined in: `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `scripts/vortex/task-purge-cache-acquia.sh` -### `DREVOPS_TASK_SSH_FILE` +### `VORTEX_TASK_SSH_FILE` Default SSH file used if custom fingerprint is not provided. Default value: `${HOME}/.ssh/id_rsa` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TASK_SSH_FINGERPRINT` +### `VORTEX_TASK_SSH_FINGERPRINT` SSH key fingerprint used to connect to a remote. Default value: `UNDEFINED` -Defined in: `scripts/drevops/task-custom-lagoon.sh` +Defined in: `scripts/vortex/task-custom-lagoon.sh` -### `DREVOPS_TZ` +### `VORTEX_TZ` The timezone for the containers. @@ -1604,221 +1812,13 @@ Default value: `Australia/Melbourne` Defined in: `.env` -### `DREVOPS_WEBROOT` +### `VORTEX_WEBROOT` Name of the webroot directory with Drupal codebase. Default value: `web` -Defined in: `.env`, `scripts/drevops/download-db-lagoon.sh`, `scripts/drevops/info.sh`, `scripts/drevops/provision.sh`, `scripts/drevops/reset.sh` - -### `DRUPAL_ADMIN_EMAIL` - -Drupal admin email. May need to be reset if database was sanitized. - -Default value: `webmaster@your-site-url.example` - -Defined in: `.env` - -### `DRUPAL_CLAMAV_ENABLED` - -Enable ClamAV integration. - -Default value: `1` - -Defined in: `.env` - -### `DRUPAL_CLAMAV_MODE` - -ClamAV mode. - -Run ClamAV in either daemon mode by setting it to `0` (or 'daemon') or in
executable mode by setting it to `1`. - -Default value: `daemon` - -Defined in: `.env` - -### `DRUPAL_CONFIG_PATH` - -Path to configuration directory relative to the project root.
Auto-discovered from site's `settings.php` file if not set. - -Default value: `UNDEFINED` - -Defined in: `scripts/drevops/provision.sh` - -### `DRUPAL_ENVIRONMENT` - -Override detected Drupal environment type. - -Used in the application to override the automatically detected environment type. - -Default value: `UNDEFINED` - -Defined in: `ENVIRONMENT` - -### `DRUPAL_PRIVATE_FILES` - -Path to private files. - -Default value: `${DRUPAL_PUBLIC_FILES}/private` - -Defined in: `.env` - -### `DRUPAL_PROFILE` - -Drupal profile name (used only when installing from profile). - -Default value: `standard` - -Defined in: `.env`, `scripts/drevops/provision.sh` - -### `DRUPAL_PUBLIC_FILES` - -Path to public files. - -Default value: `./${DREVOPS_WEBROOT}/sites/default/files` - -Defined in: `.env` - -### `DRUPAL_REDIS_ENABLED` - -Enable Redis integration.
See settings.redis.php for details. - -Default value: `UNDEFINED` - -Defined in: `.env` - -### `DRUPAL_SHIELD_PRINT` - -Shield print message. - -Default value: `Restricted access.` - -Defined in: `.env` - -### `DRUPAL_SITE_EMAIL` - -Drupal site email.
Used only when installing from profile. - -Default value: `webmaster@your-site-url.example` - -Defined in: `.env`, `scripts/drevops/provision.sh` - -### `DRUPAL_SITE_NAME` - -Drupal site name.
Used only when installing from profile. - -Default value: `${DREVOPS_PROJECT}` - -Defined in: `.env`, `scripts/drevops/provision.sh` - -### `DRUPAL_STAGE_FILE_PROXY_ORIGIN` - -Stage file proxy origin. Note that HTTP Auth provided by Shield will be
automatically added to the origin URL. - -Default value: `https://www.your-site-url.example/` - -Defined in: `.env` - -### `DRUPAL_TEMPORARY_FILES` - -Path to temporary files. - -Default value: `${DRUPAL_PRIVATE_FILES}/tmp` - -Defined in: `.env` - -### `DRUPAL_THEME` - -Drupal theme name. - -Default value: `your_site_theme` - -Defined in: `.env` - -### `DRUPAL_UNBLOCK_ADMIN` - -Unblock admin account when logging in. - -Default value: `1` - -Defined in: `.env`, `scripts/drevops/login.sh`, `scripts/drevops/logout.sh` - -### `GITHUB_TOKEN` - -GitHub token used to overcome API rate limits or access private repositories.
@see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token - -Default value: `UNDEFINED` - -Defined in: `.env.local.default`, `scripts/drevops/github-labels.sh` - -### `LAGOON_PROJECT` - -Lagoon project name. May be different from [`$DREVOPS_PROJECT`](#drevops_project). - -Default value: `your_site` - -Defined in: `.env`, `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/download-db-lagoon.sh` - -### `NEWRELIC_ENABLED` - -Enable New Relic in Lagoon environment. - -Set as project-wide variable. - -Default value: `UNDEFINED` - -Defined in: `LAGOON ENVIRONMENT` - -### `NEWRELIC_LICENSE` - -New Relic license. - -Set as project-wide variable. - -Default value: `UNDEFINED` - -Defined in: `LAGOON ENVIRONMENT` - -### `RENOVATE_DEPENDENCY_DASHBOARD` - -Whether to enable self-hosted Renovate bot dashboard. - -Default value: `false` - -Defined in: `CI config` - -### `RENOVATE_DRY_RUN` - -Whether to allow self-hosted Renovate bot make changes to the repository. - -Default value: `false` - -Defined in: `CI config` - -### `RENOVATE_GIT_AUTHOR` - -Commit author for self-hosted Renovate bot. - -Default value: `'Renovate Self Hosted '` - -Defined in: `CI config` - -### `RENOVATE_TOKEN` - -Self-hosted Renovate bot token.
Create a GitHub token with a permission to write to a repository. - -Default value: `UNDEFINED` - -Defined in: `CI config` - -### `TARGET_ENV_REMAP` - -Special variable to remap target env to the sub-domain prefix based on UI name. - -Default value: `${target_env}` - -Defined in: `scripts/drevops/task-purge-cache-acquia.sh` +Defined in: `.env`, `scripts/vortex/download-db-lagoon.sh`, `scripts/vortex/info.sh`, `scripts/vortex/provision.sh`, `scripts/vortex/reset.sh` --- Variable list generated with [Shellvar - Utility to work with shell variables](https://github.com/AlexSkrypnyk/shellvar) diff --git a/.scaffold/docs/cspell.json b/.vortex/docs/cspell.json similarity index 100% rename from .scaffold/docs/cspell.json rename to .vortex/docs/cspell.json diff --git a/.scaffold/docs/docusaurus.config.js b/.vortex/docs/docusaurus.config.js similarity index 93% rename from .scaffold/docs/docusaurus.config.js rename to .vortex/docs/docusaurus.config.js index 96fc2712e..8772aaad4 100644 --- a/.scaffold/docs/docusaurus.config.js +++ b/.vortex/docs/docusaurus.config.js @@ -8,8 +8,8 @@ import {themes as prismThemes} from 'prism-react-renderer'; /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'Scaffold - Drupal project template', - tagline: 'Scaffold documentation', + title: 'Vortex - Drupal project template', + tagline: 'Vortex documentation', favicon: 'img/favicon.ico', // Set the production url of your site here @@ -45,7 +45,7 @@ const config = { path: 'content', // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: 'https://github.com/drevops/scaffold/tree/develop/.scaffold/docs/', + editUrl: 'https://github.com/drevops/scaffold/tree/develop/.vortex/docs/', }, blog: false, theme: { @@ -86,11 +86,11 @@ const config = { ({ image: 'img/drevops_services_dark.png', navbar: { - title: 'Scaffold', + title: 'Vortex', logo: { - alt: 'Scaffold Logo', - src: 'img/logo-scaffold-dark.svg', - srcDark: 'img/logo-scaffold-light.svg', + alt: 'Vortex Logo', + src: 'img/logo-vortex-dark.svg', + srcDark: 'img/logo-vortex-light.svg', }, items: [ { diff --git a/.scaffold/docs/package-lock.json b/.vortex/docs/package-lock.json similarity index 100% rename from .scaffold/docs/package-lock.json rename to .vortex/docs/package-lock.json diff --git a/.scaffold/docs/package.json b/.vortex/docs/package.json similarity index 100% rename from .scaffold/docs/package.json rename to .vortex/docs/package.json diff --git a/.scaffold/docs/sidebars.js b/.vortex/docs/sidebars.js similarity index 100% rename from .scaffold/docs/sidebars.js rename to .vortex/docs/sidebars.js diff --git a/.scaffold/docs/src/css/custom.css b/.vortex/docs/src/css/custom.css similarity index 100% rename from .scaffold/docs/src/css/custom.css rename to .vortex/docs/src/css/custom.css diff --git a/.scaffold/docs/static/.nojekyll b/.vortex/docs/static/.nojekyll similarity index 100% rename from .scaffold/docs/static/.nojekyll rename to .vortex/docs/static/.nojekyll diff --git a/.scaffold/docs/static/CNAME b/.vortex/docs/static/CNAME similarity index 100% rename from .scaffold/docs/static/CNAME rename to .vortex/docs/static/CNAME diff --git a/.scaffold/docs/static/README.md b/.vortex/docs/static/README.md similarity index 100% rename from .scaffold/docs/static/README.md rename to .vortex/docs/static/README.md diff --git a/.scaffold/docs/static/img/behat-novnc.gif b/.vortex/docs/static/img/behat-novnc.gif similarity index 100% rename from .scaffold/docs/static/img/behat-novnc.gif rename to .vortex/docs/static/img/behat-novnc.gif diff --git a/.scaffold/docs/static/img/diagram-dark.png b/.vortex/docs/static/img/diagram-dark.png similarity index 100% rename from .scaffold/docs/static/img/diagram-dark.png rename to .vortex/docs/static/img/diagram-dark.png diff --git a/.scaffold/docs/static/img/diagram-light.png b/.vortex/docs/static/img/diagram-light.png similarity index 100% rename from .scaffold/docs/static/img/diagram-light.png rename to .vortex/docs/static/img/diagram-light.png diff --git a/.scaffold/docs/static/img/drevops_services_dark.png b/.vortex/docs/static/img/drevops_services_dark.png similarity index 100% rename from .scaffold/docs/static/img/drevops_services_dark.png rename to .vortex/docs/static/img/drevops_services_dark.png diff --git a/.vortex/docs/static/img/favicon.ico b/.vortex/docs/static/img/favicon.ico new file mode 100644 index 000000000..e2499554c Binary files /dev/null and b/.vortex/docs/static/img/favicon.ico differ diff --git a/.scaffold/docs/static/img/logo-light.svg b/.vortex/docs/static/img/logo-light.svg similarity index 100% rename from .scaffold/docs/static/img/logo-light.svg rename to .vortex/docs/static/img/logo-light.svg diff --git a/.vortex/docs/static/img/logo-vortex-dark.png b/.vortex/docs/static/img/logo-vortex-dark.png new file mode 100644 index 000000000..1b5f3722e Binary files /dev/null and b/.vortex/docs/static/img/logo-vortex-dark.png differ diff --git a/.vortex/docs/static/img/logo-vortex-dark.svg b/.vortex/docs/static/img/logo-vortex-dark.svg new file mode 100644 index 000000000..d7f5b4a70 --- /dev/null +++ b/.vortex/docs/static/img/logo-vortex-dark.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.vortex/docs/static/img/logo-vortex-light.png b/.vortex/docs/static/img/logo-vortex-light.png new file mode 100644 index 000000000..4591bcb9a Binary files /dev/null and b/.vortex/docs/static/img/logo-vortex-light.png differ diff --git a/.vortex/docs/static/img/logo-vortex-light.svg b/.vortex/docs/static/img/logo-vortex-light.svg new file mode 100644 index 000000000..8f1a47f9e --- /dev/null +++ b/.vortex/docs/static/img/logo-vortex-light.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.scaffold/docs/static/img/xdebug-phpstorm.png b/.vortex/docs/static/img/xdebug-phpstorm.png similarity index 100% rename from .scaffold/docs/static/img/xdebug-phpstorm.png rename to .vortex/docs/static/img/xdebug-phpstorm.png diff --git a/.scaffold/docs/terminalizer.yml b/.vortex/docs/terminalizer.yml similarity index 99% rename from .scaffold/docs/terminalizer.yml rename to .vortex/docs/terminalizer.yml index ff369fed9..865d97efb 100644 --- a/.scaffold/docs/terminalizer.yml +++ b/.vortex/docs/terminalizer.yml @@ -52,7 +52,7 @@ config: # Don't forget to add a backgroundColor style with a null as type frameBox: type: floating - title: Scaffold init + title: Vortex init style: border: 0px black solid # boxShadow: none diff --git a/.scaffold/tests/.gitignore b/.vortex/tests/.gitignore similarity index 100% rename from .scaffold/tests/.gitignore rename to .vortex/tests/.gitignore diff --git a/.scaffold/tests/.yamllint-for-gha.yml b/.vortex/tests/.yamllint-for-gha.yml similarity index 100% rename from .scaffold/tests/.yamllint-for-gha.yml rename to .vortex/tests/.yamllint-for-gha.yml diff --git a/.scaffold/tests/bats/_helper.bash b/.vortex/tests/bats/_helper.bash similarity index 83% rename from .scaffold/tests/bats/_helper.bash rename to .vortex/tests/bats/_helper.bash index 563612433..9d12cb5b7 100644 --- a/.scaffold/tests/bats/_helper.bash +++ b/.vortex/tests/bats/_helper.bash @@ -16,7 +16,7 @@ setup() { # The root directory of the project. export ROOT_DIR="$(dirname "$(cd "$(dirname "${BATS_TEST_DIRNAME}")/.." && pwd)")" - [ ! -d "${ROOT_DIR}/.scaffold" ] && echo 'ERROR: The test should be run from the ".scaffold" directory.' && exit 1 + [ ! -d "${ROOT_DIR}/.vortex" ] && echo 'ERROR: The test should be run from the ".vortex" directory.' && exit 1 ## ## Phase 1: Framework setup. @@ -56,8 +56,8 @@ setup() { # Set test secrets. # For local test development, export these variables in your shell. export TEST_GITHUB_TOKEN="${TEST_GITHUB_TOKEN:-}" - export TEST_DREVOPS_CONTAINER_REGISTRY_USER="${TEST_DREVOPS_CONTAINER_REGISTRY_USER:-}" - export TEST_DREVOPS_CONTAINER_REGISTRY_PASS="${TEST_DREVOPS_CONTAINER_REGISTRY_PASS:-}" + export TEST_VORTEX_CONTAINER_REGISTRY_USER="${TEST_VORTEX_CONTAINER_REGISTRY_USER:-}" + export TEST_VORTEX_CONTAINER_REGISTRY_PASS="${TEST_VORTEX_CONTAINER_REGISTRY_PASS:-}" # The installer reference to use for tests. export TEST_INSTALLER_REF="${TEST_INSTALLER_REF:-main}" @@ -118,13 +118,13 @@ setup() { ## # Isolate variables set in CI. - unset DREVOPS_DB_DOWNLOAD_SOURCE - unset DREVOPS_DB_IMAGE - unset DREVOPS_DB_DOWNLOAD_FORCE + unset VORTEX_DB_DOWNLOAD_SOURCE + unset VORTEX_DB_IMAGE + unset VORTEX_DB_DOWNLOAD_FORCE # Tokens required for tests are set explicitly within each tests with a TEST_ prefix. unset GITHUB_TOKEN - unset DREVOPS_CONTAINER_REGISTRY_USER - unset DREVOPS_CONTAINER_REGISTRY_PASS + unset VORTEX_CONTAINER_REGISTRY_USER + unset VORTEX_CONTAINER_REGISTRY_PASS # Disable interactive prompts during tests. export AHOY_CONFIRM_RESPONSE=y @@ -132,22 +132,22 @@ setup() { export AHOY_CONFIRM_WAIT_SKIP=1 # Disable Doctor checks used on host machine. - export DREVOPS_DOCTOR_CHECK_TOOLS=0 - export DREVOPS_DOCTOR_CHECK_PYGMY=0 - export DREVOPS_DOCTOR_CHECK_PORT=0 - export DREVOPS_DOCTOR_CHECK_SSH=0 - export DREVOPS_DOCTOR_CHECK_WEBSERVER=0 - export DREVOPS_DOCTOR_CHECK_BOOTSTRAP=0 + export VORTEX_DOCTOR_CHECK_TOOLS=0 + export VORTEX_DOCTOR_CHECK_PYGMY=0 + export VORTEX_DOCTOR_CHECK_PORT=0 + export VORTEX_DOCTOR_CHECK_SSH=0 + export VORTEX_DOCTOR_CHECK_WEBSERVER=0 + export VORTEX_DOCTOR_CHECK_BOOTSTRAP=0 # Allow to override debug variables from environment when developing tests. - export DREVOPS_DEBUG="${TEST_DREVOPS_DEBUG:-}" - export DREVOPS_INSTALL_DEBUG="${TEST_DREVOPS_INSTALL_DEBUG:-}" + export VORTEX_DEBUG="${TEST_VORTEX_DEBUG:-}" + export VORTEX_INSTALL_DEBUG="${TEST_VORTEX_INSTALL_DEBUG:-}" # Switch to using test demo DB. # Demo DB is what is being downloaded when the installer runs for the first # time do demonstrate downloading from CURL and importing from the DB dump # functionality. - export DREVOPS_INSTALL_DEMO_DB_TEST=https://github.com/drevops/scaffold/releases/download/1.18.0/db_d10.test.sql + export VORTEX_INSTALL_DEMO_DB_TEST=https://github.com/drevops/scaffold/releases/download/1.18.0/db_d10.test.sql ## ## Phase 5: SUT files setup. @@ -164,8 +164,8 @@ setup() { ## Phase 6: Setting debug mode. ## - # Print debug if "--verbose-run" is passed or TEST_DREVOPS_DEBUG is set to "1". - if [ "${BATS_VERBOSE_RUN:-}" = "1" ] || [ "${TEST_DREVOPS_DEBUG:-}" = "1" ]; then + # Print debug if "--verbose-run" is passed or TEST_VORTEX_DEBUG is set to "1". + if [ "${BATS_VERBOSE_RUN:-}" = "1" ] || [ "${TEST_VORTEX_DEBUG:-}" = "1" ]; then echo "Verbose run enabled." >&3 echo "BUILD_DIR: ${BUILD_DIR}" >&3 export RUN_STEPS_DEBUG=1 @@ -246,16 +246,16 @@ assert_files_present_common() { assert_files_present_drevops "${dir}" # Assert that project name is correct. - assert_file_contains .env "DREVOPS_PROJECT=${suffix}" + assert_file_contains .env "VORTEX_PROJECT=${suffix}" - # Assert that Scaffold version was replaced. - assert_file_contains "README.md" "badge/DrevOps-${DREVOPS_VERSION:-develop}-blue.svg" - assert_file_contains "README.md" "https://github.com/drevops/scaffold/tree/${DREVOPS_VERSION:-develop}" + # Assert that Vortex version was replaced. + assert_file_contains "README.md" "badge/DrevOps-${VORTEX_VERSION:-develop}-blue.svg" + assert_file_contains "README.md" "https://github.com/drevops/scaffold/tree/${VORTEX_VERSION:-develop}" assert_file_not_contains "README.md" "The following list includes" assert_file_not_exists "README.dist.md" - # Assert that Scaffold footnote remains. - assert_file_contains "README.md" "This repository was created using the [DrevOps Scaffold](https://github.com/drevops/scaffold) project template" + # Assert that Vortex footnote remains. + assert_file_contains "README.md" "This repository was created using the [DrevOps Vortex](https://github.com/drevops/scaffold) project template" assert_files_present_drupal "${dir}" "${suffix}" "${suffix_abbreviated}" "${suffix_abbreviated_camel_cased}" "${suffix_camel_cased}" "${webroot}" @@ -353,37 +353,37 @@ assert_files_present_drevops() { assert_file_exists "scripts/custom/.gitkeep" # Core DrevOps files. - assert_file_exists "scripts/drevops/deploy.sh" - assert_file_exists "scripts/drevops/deploy-artifact.sh" - assert_file_exists "scripts/drevops/deploy-container-registry.sh" - assert_file_exists "scripts/drevops/deploy-lagoon.sh" - assert_file_exists "scripts/drevops/deploy-webhook.sh" - assert_file_exists "scripts/drevops/login-container-registry.sh" - assert_file_exists "scripts/drevops/doctor.sh" - assert_file_exists "scripts/drevops/download-db.sh" - assert_file_exists "scripts/drevops/download-db-acquia.sh" - assert_file_exists "scripts/drevops/download-db-curl.sh" - assert_file_exists "scripts/drevops/download-db-ftp.sh" - assert_file_exists "scripts/drevops/download-db-container-registry.sh" - assert_file_exists "scripts/drevops/download-db-lagoon.sh" - assert_file_exists "scripts/drevops/export-db-file.sh" - assert_file_exists "scripts/drevops/export-db-image.sh" - assert_file_exists "scripts/drevops/provision.sh" - assert_file_exists "scripts/drevops/login.sh" - assert_file_exists "scripts/drevops/login-container-registry.sh" - assert_file_exists "scripts/drevops/provision-sanitize-db.sh" - assert_file_exists "scripts/drevops/github-labels.sh" - assert_file_exists "scripts/drevops/info.sh" - assert_file_exists "scripts/drevops/notify.sh" - assert_file_exists "scripts/drevops/notify-email.sh" - assert_file_exists "scripts/drevops/notify-github.sh" - assert_file_exists "scripts/drevops/notify-jira.sh" - assert_file_exists "scripts/drevops/notify-newrelic.sh" - assert_file_exists "scripts/drevops/reset.sh" - assert_file_exists "scripts/drevops/task-copy-db-acquia.sh" - assert_file_exists "scripts/drevops/task-copy-files-acquia.sh" - assert_file_exists "scripts/drevops/task-purge-cache-acquia.sh" - assert_file_exists "scripts/drevops/update-scaffold.sh" + assert_file_exists "scripts/vortex/deploy.sh" + assert_file_exists "scripts/vortex/deploy-artifact.sh" + assert_file_exists "scripts/vortex/deploy-container-registry.sh" + assert_file_exists "scripts/vortex/deploy-lagoon.sh" + assert_file_exists "scripts/vortex/deploy-webhook.sh" + assert_file_exists "scripts/vortex/login-container-registry.sh" + assert_file_exists "scripts/vortex/doctor.sh" + assert_file_exists "scripts/vortex/download-db.sh" + assert_file_exists "scripts/vortex/download-db-acquia.sh" + assert_file_exists "scripts/vortex/download-db-curl.sh" + assert_file_exists "scripts/vortex/download-db-ftp.sh" + assert_file_exists "scripts/vortex/download-db-container-registry.sh" + assert_file_exists "scripts/vortex/download-db-lagoon.sh" + assert_file_exists "scripts/vortex/export-db-file.sh" + assert_file_exists "scripts/vortex/export-db-image.sh" + assert_file_exists "scripts/vortex/provision.sh" + assert_file_exists "scripts/vortex/login.sh" + assert_file_exists "scripts/vortex/login-container-registry.sh" + assert_file_exists "scripts/vortex/provision-sanitize-db.sh" + assert_file_exists "scripts/vortex/github-labels.sh" + assert_file_exists "scripts/vortex/info.sh" + assert_file_exists "scripts/vortex/notify.sh" + assert_file_exists "scripts/vortex/notify-email.sh" + assert_file_exists "scripts/vortex/notify-github.sh" + assert_file_exists "scripts/vortex/notify-jira.sh" + assert_file_exists "scripts/vortex/notify-newrelic.sh" + assert_file_exists "scripts/vortex/reset.sh" + assert_file_exists "scripts/vortex/task-copy-db-acquia.sh" + assert_file_exists "scripts/vortex/task-copy-files-acquia.sh" + assert_file_exists "scripts/vortex/task-purge-cache-acquia.sh" + assert_file_exists "scripts/vortex/update-vortex.sh" assert_file_exists "scripts/sanitize.sql" @@ -415,31 +415,31 @@ assert_files_present_drevops() { assert_file_exists "docs/testing.md" # Assert that DrevOps files removed. - assert_dir_not_exists ".scaffold" + assert_dir_not_exists ".vortex" assert_file_not_exists "LICENSE" assert_file_not_exists "CODE_OF_CONDUCT.md" assert_file_not_exists ".github/FUNDING.yml" - assert_file_not_exists ".github/scaffold-publish-docs.yml" - assert_file_not_exists ".github/scaffold-test-docs.yml" - - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-test" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-test-workflow" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-test-deployment" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-deploy" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-deploy-tags" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-didi-database-fi" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-database-ii" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-didi-build-fi" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-didi-build-ii" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-docs" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-didi-fi" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-didi-ii" - assert_file_not_contains ".circleci/config.yml" "scaffold-dev-installer" + assert_file_not_exists ".github/vortex-publish-docs.yml" + assert_file_not_exists ".github/vortex-test-docs.yml" + + assert_file_not_contains ".circleci/config.yml" "vortex-dev-test" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-test-workflow" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-test-deployment" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-deploy" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-deploy-tags" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-didi-database-fi" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-database-ii" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-didi-build-fi" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-didi-build-ii" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-docs" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-didi-fi" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-didi-ii" + assert_file_not_contains ".circleci/config.yml" "vortex-dev-installer" # Assert that documentation was processed correctly. assert_file_not_contains README.md "# DrevOps" - assert_dir_not_contains_string "${dir}" "/\.scaffold" + assert_dir_not_contains_string "${dir}" "/\.vortex" popd >/dev/null || exit 1 } @@ -583,18 +583,18 @@ assert_files_present_provision_use_profile() { pushd "${dir}" >/dev/null || exit 1 - assert_file_contains ".env" "DREVOPS_PROVISION_USE_PROFILE=1" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_ENVIRONMENT" + assert_file_contains ".env" "VORTEX_PROVISION_USE_PROFILE=1" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_ENVIRONMENT" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FORCE" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_USER" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_PASS" - assert_file_not_contains ".env.local.default" "DREVOPS_ACQUIA_KEY" - assert_file_not_contains ".env.local.default" "DREVOPS_ACQUIA_SECRET" - assert_file_not_contains ".env.local.default" "DREVOPS_CONTAINER_REGISTRY_USER" - assert_file_not_contains ".env.local.default" "DREVOPS_CONTAINER_REGISTRY_PASS" + assert_file_not_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FORCE" + assert_file_not_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FTP_USER" + assert_file_not_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FTP_PASS" + assert_file_not_contains ".env.local.default" "VORTEX_ACQUIA_KEY" + assert_file_not_contains ".env.local.default" "VORTEX_ACQUIA_SECRET" + assert_file_not_contains ".env.local.default" "VORTEX_CONTAINER_REGISTRY_USER" + assert_file_not_contains ".env.local.default" "VORTEX_CONTAINER_REGISTRY_PASS" assert_file_exists ".ahoy.yml" assert_file_not_contains ".ahoy.yml" "download-db:" @@ -604,10 +604,10 @@ assert_files_present_provision_use_profile() { assert_file_not_contains ".circleci/config.yml" "db_ssh_fingerprint" assert_file_not_contains ".circleci/config.yml" "/root/project/.data" assert_file_not_contains ".circleci/config.yml" "nightly_db_schedule" - assert_file_not_contains ".circleci/config.yml" "DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT" - assert_file_not_contains ".circleci/config.yml" "DREVOPS_CI_DB_CACHE_TIMESTAMP" - assert_file_not_contains ".circleci/config.yml" "DREVOPS_CI_DB_CACHE_FALLBACK" - assert_file_not_contains ".circleci/config.yml" "DREVOPS_CI_DB_CACHE_BRANCH" + assert_file_not_contains ".circleci/config.yml" "VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT" + assert_file_not_contains ".circleci/config.yml" "VORTEX_CI_DB_CACHE_TIMESTAMP" + assert_file_not_contains ".circleci/config.yml" "VORTEX_CI_DB_CACHE_FALLBACK" + assert_file_not_contains ".circleci/config.yml" "VORTEX_CI_DB_CACHE_BRANCH" assert_file_not_contains ".circleci/config.yml" "database: &job-database" assert_file_not_contains ".circleci/config.yml" "database-nightly" assert_file_not_contains ".circleci/config.yml" "name: Set cache keys for database caching" @@ -622,7 +622,7 @@ assert_files_present_no_provision_use_profile() { pushd "${dir}" >/dev/null || exit 1 - assert_file_contains ".env" "DREVOPS_PROVISION_USE_PROFILE=0" + assert_file_contains ".env" "VORTEX_PROVISION_USE_PROFILE=0" assert_file_exists ".ahoy.yml" assert_file_contains ".ahoy.yml" "download-db:" @@ -632,10 +632,10 @@ assert_files_present_no_provision_use_profile() { assert_file_contains ".circleci/config.yml" "db_ssh_fingerprint" assert_file_contains ".circleci/config.yml" "/root/project/.data" assert_file_contains ".circleci/config.yml" "nightly_db_schedule" - assert_file_contains ".circleci/config.yml" "DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT" - assert_file_contains ".circleci/config.yml" "DREVOPS_CI_DB_CACHE_TIMESTAMP" - assert_file_contains ".circleci/config.yml" "DREVOPS_CI_DB_CACHE_FALLBACK" - assert_file_contains ".circleci/config.yml" "DREVOPS_CI_DB_CACHE_BRANCH" + assert_file_contains ".circleci/config.yml" "VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT" + assert_file_contains ".circleci/config.yml" "VORTEX_CI_DB_CACHE_TIMESTAMP" + assert_file_contains ".circleci/config.yml" "VORTEX_CI_DB_CACHE_FALLBACK" + assert_file_contains ".circleci/config.yml" "VORTEX_CI_DB_CACHE_BRANCH" assert_file_contains ".circleci/config.yml" "database: &job-database" assert_file_contains ".circleci/config.yml" "database-nightly" assert_file_contains ".circleci/config.yml" "name: Set cache keys for database caching" @@ -650,7 +650,7 @@ assert_files_present_override_existing_db() { pushd "${dir}" >/dev/null || exit 1 - assert_file_contains ".env" "DREVOPS_PROVISION_OVERRIDE_DB=1" + assert_file_contains ".env" "VORTEX_PROVISION_OVERRIDE_DB=1" popd >/dev/null || exit 1 } @@ -661,7 +661,7 @@ assert_files_present_no_override_existing_db() { pushd "${dir}" >/dev/null || exit 1 - assert_file_contains ".env" "DREVOPS_PROVISION_OVERRIDE_DB=0" + assert_file_contains ".env" "VORTEX_PROVISION_OVERRIDE_DB=0" popd >/dev/null || exit 1 } @@ -737,9 +737,9 @@ assert_files_present_integration_acquia() { if [ "${include_scripts:-}" -eq 1 ]; then assert_dir_exists "scripts" - assert_file_contains ".env" "DREVOPS_ACQUIA_APP_NAME=" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_ENVIRONMENT=" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME=" + assert_file_contains ".env" "VORTEX_ACQUIA_APP_NAME=" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_ENVIRONMENT=" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME=" fi popd >/dev/null || exit 1 @@ -756,12 +756,12 @@ assert_files_present_no_integration_acquia() { assert_dir_not_exists "hooks/library" assert_file_not_exists "${webroot}sites/default/includes/providers/settings.acquia.php" assert_file_not_contains "${webroot}/.htaccess" "RewriteCond %{ENV:AH_SITE_ENVIRONMENT} prod [NC]" - assert_file_not_contains ".env" "DREVOPS_ACQUIA_APP_NAME=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME=" - assert_file_not_contains ".ahoy.yml" "DREVOPS_ACQUIA_APP_NAME=" - assert_file_not_contains ".ahoy.yml" "DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME=" - assert_dir_not_contains_string "${dir}" "DREVOPS_ACQUIA_KEY" - assert_dir_not_contains_string "${dir}" "DREVOPS_ACQUIA_SECRET" + assert_file_not_contains ".env" "VORTEX_ACQUIA_APP_NAME=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME=" + assert_file_not_contains ".ahoy.yml" "VORTEX_ACQUIA_APP_NAME=" + assert_file_not_contains ".ahoy.yml" "VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME=" + assert_dir_not_contains_string "${dir}" "VORTEX_ACQUIA_KEY" + assert_dir_not_contains_string "${dir}" "VORTEX_ACQUIA_SECRET" popd >/dev/null || exit 1 } @@ -820,13 +820,13 @@ assert_files_present_integration_ftp() { pushd "${dir}" >/dev/null || exit 1 - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_HOST=" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_PORT=" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_FILE=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_USER=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_PASS=" - assert_file_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_USER=" - assert_file_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_PASS=" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_HOST=" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_PORT=" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_FILE=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_USER=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_PASS=" + assert_file_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FTP_USER=" + assert_file_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FTP_PASS=" popd >/dev/null || exit 1 } @@ -837,13 +837,13 @@ assert_files_present_no_integration_ftp() { pushd "${dir}" >/dev/null || exit 1 - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_HOST=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_PORT=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_FILE=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_USER=" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_FTP_PASS=" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_USER=" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_PASS=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_HOST=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_PORT=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_FILE=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_USER=" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_FTP_PASS=" + assert_file_not_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FTP_USER=" + assert_file_not_contains ".env.local.default" "VORTEX_DB_DOWNLOAD_FTP_PASS=" popd >/dev/null || exit 1 } @@ -905,7 +905,7 @@ Drupal 10 implementation of ${name} for ${org} [//]: # (DO NOT REMOVE THE BADGE BELOW. IT IS USED BY DREVOPS TO TRACK INTEGRATION) -[![DrevOps](https://img.shields.io/badge/DrevOps-DREVOPS_VERSION_URLENCODED-blue.svg)](https://github.com/drevops/scaffold/tree/DREVOPS_VERSION) +[![DrevOps](https://img.shields.io/badge/DrevOps-VORTEX_VERSION_URLENCODED-blue.svg)](https://github.com/drevops/scaffold/tree/VORTEX_VERSION) some other text EOT @@ -936,13 +936,13 @@ run_installer_quiet() { pushd "${CURRENT_PROJECT_DIR}" >/dev/null || exit 1 # Force the installer script to be downloaded from the local repo for testing. - export DREVOPS_INSTALL_LOCAL_REPO="${LOCAL_REPO_DIR}" + export VORTEX_INSTALL_LOCAL_REPO="${LOCAL_REPO_DIR}" # Use unique installer temporary directory for each run. This is where # the installer script downloads the DrevOps codebase for processing. - DREVOPS_INSTALL_TMP_DIR="${APP_TMP_DIR}/$(random_string)" - fixture_prepare_dir "${DREVOPS_INSTALL_TMP_DIR}" - export DREVOPS_INSTALL_TMP_DIR + VORTEX_INSTALL_TMP_DIR="${APP_TMP_DIR}/$(random_string)" + fixture_prepare_dir "${VORTEX_INSTALL_TMP_DIR}" + export VORTEX_INSTALL_TMP_DIR # Tests are using demo database and 'ahoy download-db' command, so we need # to set the CURL DB to test DB. @@ -952,7 +952,7 @@ run_installer_quiet() { # # Installer will load environment variable and it will take precedence over # the value in .env file. - export DREVOPS_DB_DOWNLOAD_CURL_URL="${DREVOPS_INSTALL_DEMO_DB_TEST}" + export VORTEX_DB_DOWNLOAD_CURL_URL="${VORTEX_INSTALL_DEMO_DB_TEST}" opt_quiet="--quiet" [ "${TEST_RUN_INSTALL_INTERACTIVE:-}" = "1" ] && opt_quiet="" @@ -1010,7 +1010,7 @@ run_installer_interactive() { export TEST_RUN_INSTALL_INTERACTIVE=1 # Force TTY to get answers through pipe. - export DREVOPS_INSTALLER_FORCE_TTY=1 + export VORTEX_INSTALLER_FORCE_TTY=1 for i in "${answers[@]}"; do val="${i}" @@ -1036,7 +1036,7 @@ install_dependencies_stub() { pushd "${dir}" >/dev/null || exit 1 - mktouch "${webroot}/core/.scaffold/installer/install" + mktouch "${webroot}/core/.vortex/installer/install" mktouch "${webroot}/modules/contrib/somemodule/somemodule.info.yml" mktouch "${webroot}/themes/contrib/sometheme/sometheme.info.yml" mktouch "${webroot}/profiles/contrib/someprofile/someprofile.info.yml" @@ -1251,15 +1251,15 @@ sync_to_container() { # Special treatment for cases where volumes are not mounted from the host. fix_host_dependencies() { - # Replicate behaviour of .scaffold/installer/install script to extract destination directory + # Replicate behaviour of .vortex/installer/install script to extract destination directory # passed as an argument. # shellcheck disable=SC2235 ([ "${1:-}" = "--quiet" ] || [ "${1:-}" = "-q" ]) && shift # Destination directory, that can be overridden with the first argument to this script. - DREVOPS_INSTALL_DST_DIR="${DREVOPS_INSTALL_DST_DIR:-$(pwd)}" - DREVOPS_INSTALL_DST_DIR=${1:-${DREVOPS_INSTALL_DST_DIR}} + VORTEX_INSTALL_DST_DIR="${VORTEX_INSTALL_DST_DIR:-$(pwd)}" + VORTEX_INSTALL_DST_DIR=${1:-${VORTEX_INSTALL_DST_DIR}} - pushd "${DREVOPS_INSTALL_DST_DIR}" >/dev/null || exit 1 + pushd "${VORTEX_INSTALL_DST_DIR}" >/dev/null || exit 1 if [ -f docker-compose.yml ] && [ "${SCAFFOLD_DEV_VOLUMES_MOUNTED:-1}" != "1" ]; then sed -i -e "/###/d" docker-compose.yml @@ -1348,7 +1348,7 @@ process_ahoyyml() { # when they run `ahoy build` locally. local sed_opts sed_opts=(-i) && [ "$(uname)" = "Darwin" ] && sed_opts=(-i '') - sed "${sed_opts[@]}" 's|cmd: ahoy cli ./scripts/drevops/provision.sh|cmd: if [ -f .data/db.sql ]; then docker compose exec cli mkdir -p .data; docker compose cp -L .data/db.sql cli:/app/.data/db.sql; fi; ahoy cli \.\/scripts\/drevops\/provision\.sh|g' .ahoy.yml + sed "${sed_opts[@]}" 's|cmd: ahoy cli ./scripts/vortex/provision.sh|cmd: if [ -f .data/db.sql ]; then docker compose exec cli mkdir -p .data; docker compose cp -L .data/db.sql cli:/app/.data/db.sql; fi; ahoy cli \.\/scripts\/drevops\/provision\.sh|g' .ahoy.yml } setup_ssh_key_fixture() { diff --git a/.scaffold/tests/bats/_helper.circleci.bash b/.vortex/tests/bats/_helper.circleci.bash similarity index 100% rename from .scaffold/tests/bats/_helper.circleci.bash rename to .vortex/tests/bats/_helper.circleci.bash diff --git a/.scaffold/tests/bats/_helper.deployment.bash b/.vortex/tests/bats/_helper.deployment.bash similarity index 95% rename from .scaffold/tests/bats/_helper.deployment.bash rename to .vortex/tests/bats/_helper.deployment.bash index e640fcbd7..b468e8186 100644 --- a/.scaffold/tests/bats/_helper.deployment.bash +++ b/.vortex/tests/bats/_helper.deployment.bash @@ -136,10 +136,10 @@ install_and_build_site() { if [ "${should_build:-}" = "1" ]; then step "Build project" - export DREVOPS_CONTAINER_REGISTRY_USER="${TEST_DREVOPS_CONTAINER_REGISTRY_USER?Test Docker user is not set}" - export DREVOPS_CONTAINER_REGISTRY_PASS="${TEST_DREVOPS_CONTAINER_REGISTRY_PASS?Test Docker pass is not set}" + export VORTEX_CONTAINER_REGISTRY_USER="${TEST_VORTEX_CONTAINER_REGISTRY_USER?Test Docker user is not set}" + export VORTEX_CONTAINER_REGISTRY_PASS="${TEST_VORTEX_CONTAINER_REGISTRY_PASS?Test Docker pass is not set}" - export DREVOPS_PROVISION_POST_OPERATIONS_SKIP=1 + export VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 process_ahoyyml ahoy build diff --git a/.scaffold/tests/bats/_helper.workflow.bash b/.vortex/tests/bats/_helper.workflow.bash similarity index 97% rename from .scaffold/tests/bats/_helper.workflow.bash rename to .vortex/tests/bats/_helper.workflow.bash index 02a630909..42717ca55 100644 --- a/.scaffold/tests/bats/_helper.workflow.bash +++ b/.vortex/tests/bats/_helper.workflow.bash @@ -17,7 +17,7 @@ prepare_sut() { substep "Initialise the project with default settings" # Run default install - export DREVOPS_WEBROOT="${webroot}" + export VORTEX_WEBROOT="${webroot}" run_installer_quiet assert_files_present_common "" "" "" "" "" "${webroot}" @@ -56,13 +56,13 @@ assert_ahoy_download_db() { # # Ahoy will load environment variable and it will take precedence over # the value in .env file. - export DREVOPS_DB_DOWNLOAD_CURL_URL="${DREVOPS_INSTALL_DEMO_DB_TEST}" + export VORTEX_DB_DOWNLOAD_CURL_URL="${VORTEX_INSTALL_DEMO_DB_TEST}" # Remove any previously downloaded DB dumps. rm -Rf .data/db.sql # In this test, the database is downloaded from the public URL specified in - # DREVOPS_DB_DOWNLOAD_CURL_URL variable. + # VORTEX_DB_DOWNLOAD_CURL_URL variable. assert_file_not_exists .data/db.sql ahoy download-db assert_file_exists .data/db.sql @@ -83,14 +83,14 @@ assert_ahoy_build() { # # Ahoy will load environment variable and it will take precedence over # the value in .env file. - export DREVOPS_DB_DOWNLOAD_CURL_URL="${DREVOPS_INSTALL_DEMO_DB_TEST}" + export VORTEX_DB_DOWNLOAD_CURL_URL="${VORTEX_INSTALL_DEMO_DB_TEST}" # Check that database file exists before build. db_file_exists=0 [ -f ".data/db.sql" ] && db_file_exists=1 - export DREVOPS_CONTAINER_REGISTRY_USER="${TEST_DREVOPS_CONTAINER_REGISTRY_USER?Test container registry user is not set}" - export DREVOPS_CONTAINER_REGISTRY_PASS="${TEST_DREVOPS_CONTAINER_REGISTRY_PASS?Test container registry pass is not set}" + export VORTEX_CONTAINER_REGISTRY_USER="${TEST_VORTEX_CONTAINER_REGISTRY_USER?Test container registry user is not set}" + export VORTEX_CONTAINER_REGISTRY_PASS="${TEST_VORTEX_CONTAINER_REGISTRY_PASS?Test container registry pass is not set}" process_ahoyyml run ahoy build @@ -232,7 +232,7 @@ assert_timezone() { # Assert that .env contains a default value. # Note that AEDT changes to AEST during winter. - assert_file_contains ".env" 'DREVOPS_TZ="Australia/Melbourne"' + assert_file_contains ".env" 'VORTEX_TZ="Australia/Melbourne"' run docker compose exec cli date assert_output_contains "AE" run docker compose exec php date @@ -243,7 +243,7 @@ assert_timezone() { assert_output_contains "AE" # Add variable to the .env file and apply the change to container. - add_var_to_file .env "DREVOPS_TZ" '"Australia/Perth"' + add_var_to_file .env "VORTEX_TZ" '"Australia/Perth"' sync_to_container run ahoy up diff --git a/.scaffold/tests/bats/circleci.bats b/.vortex/tests/bats/circleci.bats similarity index 100% rename from .scaffold/tests/bats/circleci.bats rename to .vortex/tests/bats/circleci.bats diff --git a/.vortex/tests/bats/deploy-artifact.bats b/.vortex/tests/bats/deploy-artifact.bats new file mode 100644 index 000000000..f7344a793 --- /dev/null +++ b/.vortex/tests/bats/deploy-artifact.bats @@ -0,0 +1,102 @@ +#!/usr/bin/env bats +# +# Test for CircleCI lifecycle. +# +# shellcheck disable=SC2030,SC2031,SC2129,SC2155 + +load _helper.bash +load _helper.deployment.bash + +@test "Missing or Invalid VORTEX_DEPLOY_TYPES" { + substep "Swap to ${LOCAL_REPO_DIR}" + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + export VORTEX_DEPLOY_TYPES="" + run ahoy deploy + assert_failure + + assert_output_contains "Missing required value for VORTEX_DEPLOY_TYPES. Must be a combination of comma-separated values (to support multiple deployments): code, container_registry, webhook, lagoon." + + popd >/dev/null +} + +@test "Check setting and default values for required variables" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + # Note the following variables have default values + # so the check for empty string is redundant: + # - VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME + # - VORTEX_DEPLOY_ARTIFACT_ROOT + # - VORTEX_DEPLOY_ARTIFACT_LOG + + unset VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE + unset VORTEX_DEPLOY_ARTIFACT_DST_BRANCH + unset VORTEX_DEPLOY_ARTIFACT_SRC + unset VORTEX_DEPLOY_ARTIFACT_ROOT + unset VORTEX_DEPLOY_ARTIFACT_LOG + + run scripts/vortex/deploy-artifact.sh + assert_failure + assert_output_contains "Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE." + + export VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE="git@github.com:yourorg/your-repo-destination.git" + + run scripts/vortex/deploy-artifact.sh + assert_failure + assert_output_contains "Missing required value for VORTEX_DEPLOY_ARTIFACT_SRC." + + export VORTEX_DEPLOY_ARTIFACT_SRC="dist" + + run scripts/vortex/deploy-artifact.sh + assert_failure + assert_output_contains "Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL." + + popd >/dev/null +} + +@test "Artifact deployment, global git username and email configured, default SSH Key" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + setup_ssh_key_fixture + setup_robo_fixture + provision_default_ssh_key + export VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE="git@github.com:yourorg/your-repo-destination.git" + export VORTEX_DEPLOY_ARTIFACT_DST_BRANCH="main" + export VORTEX_DEPLOY_ARTIFACT_SRC="dist" + export VORTEX_DEPLOY_ARTIFACT_ROOT="." + export VORTEX_DEPLOY_ARTIFACT_LOG="deploy-report.txt" + export VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME="test_user" + export VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL="test_user@example.com" + local file=${HOME}/.ssh/id_rsa + + mock_realpath=$(mock_command "realpath") + + declare -a STEPS=( + "- Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE." + "- Missing required value for VORTEX_DEPLOY_ARTIFACT_SRC." + "- Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL." + "@git config --global user.name #" + "Configuring global git user name." + "@git config --global user.name ${VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME} # 0 #" + "@git config --global user.email #" + "Configuring global git user email." + "@git config --global user.email ${VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL} # 0 #" + "Using default SSH file ${file}." + "Using SSH key file ${file}." + "@ssh-add -l # ${file}" + "SSH agent has ${file} key loaded." + "Installing artifact builder." + "@composer global require --dev -n --ansi --prefer-source --ignore-platform-reqs drevops/git-artifact:^0.7" + "Running artifact builder." + "Finished ARTIFACT deployment." + ) + mocks="$(run_steps "setup")" + + run scripts/vortex/deploy-artifact.sh + assert_success + + run_steps "assert" "${mocks[@]}" + assert_equal "2" "$(mock_get_call_num "${mock_realpath}" 1)" + + popd >/dev/null +} diff --git a/.scaffold/tests/bats/deploy-container-registry.bats b/.vortex/tests/bats/deploy-container-registry.bats similarity index 63% rename from .scaffold/tests/bats/deploy-container-registry.bats rename to .vortex/tests/bats/deploy-container-registry.bats index 807a24ac6..411fa1b3c 100644 --- a/.scaffold/tests/bats/deploy-container-registry.bats +++ b/.vortex/tests/bats/deploy-container-registry.bats @@ -1,32 +1,32 @@ #!/usr/bin/env bats # -# Tests for scripts/drevops/deploy-container-registry.sh script. +# Tests for scripts/vortex/deploy-container-registry.sh script. # # shellcheck disable=SC2030,SC2031,SC2129,SC2155 load _helper.bash load _helper.deployment.bash -@test "Missing DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP - deployment should not proceed" { +@test "Missing VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP - deployment should not proceed" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - unset DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP + unset VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP - run scripts/drevops/deploy-container-registry.sh + run scripts/vortex/deploy-container-registry.sh assert_success - assert_output_contains "Services map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable. Container registry deployment will not continue." + assert_output_contains "Services map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable. Container registry deployment will not continue." popd >/dev/null } -@test "Container registry deployment with valid DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP" { +@test "Container registry deployment with valid VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_DEPLOY_CONTAINER_REGISTRY="registry.example.com" - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="test_latest" - provision_docker_config_file DREVOPS_DEPLOY_CONTAINER_REGISTRY + export VORTEX_DEPLOY_CONTAINER_REGISTRY="registry.example.com" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="test_latest" + provision_docker_config_file VORTEX_DEPLOY_CONTAINER_REGISTRY - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1,service2=image2,service3=image3" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1,service2=image2,service3=image3" declare -a STEPS=( "Started container registry deployment." @@ -59,7 +59,7 @@ load _helper.deployment.bash mocks="$(run_steps "setup")" - run ./scripts/drevops/deploy-container-registry.sh + run ./scripts/vortex/deploy-container-registry.sh assert_success run_steps "assert" "${mocks[@]}" @@ -69,11 +69,11 @@ load _helper.deployment.bash @test "Container registry deployment with services not running" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="test_latest" - export DREVOPS_DEPLOY_CONTAINER_REGISTRY="registry.example.com" - provision_docker_config_file DREVOPS_DEPLOY_CONTAINER_REGISTRY + export VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="test_latest" + export VORTEX_DEPLOY_CONTAINER_REGISTRY="registry.example.com" + provision_docker_config_file VORTEX_DEPLOY_CONTAINER_REGISTRY - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1" declare -a STEPS=( "Started container registry deployment." @@ -84,37 +84,37 @@ load _helper.deployment.bash mocks="$(run_steps "setup")" - run ./scripts/drevops/deploy-container-registry.sh + run ./scripts/vortex/deploy-container-registry.sh assert_failure run_steps "assert" "${mocks[@]}" popd >/dev/null } -@test "Invalid DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP provided" { +@test "Invalid VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP provided" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="test_latest" - export DREVOPS_DEPLOY_CONTAINER_REGISTRY="registry.example.com" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="test_latest" + export VORTEX_DEPLOY_CONTAINER_REGISTRY="registry.example.com" # No key/value pair - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP="service1" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP="service1" - run ./scripts/drevops/deploy-container-registry.sh + run ./scripts/vortex/deploy-container-registry.sh assert_failure assert_output_contains "invalid key/value pair \"service1\" provided." # Using a space delimiter. - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1 service2=image2" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1 service2=image2" - run scripts/drevops/deploy-container-registry.sh + run scripts/vortex/deploy-container-registry.sh assert_failure assert_output_contains "invalid key/value pair \"service1=image1 service2=image2\" provided." # No comma delimiter - export DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1=service2=image2" + export VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP="service1=image1=service2=image2" - run scripts/drevops/deploy-container-registry.sh + run scripts/vortex/deploy-container-registry.sh assert_failure assert_output_contains "invalid key/value pair \"service1=image1=service2=image2\" provided." diff --git a/.vortex/tests/bats/deploy-webhook.bats b/.vortex/tests/bats/deploy-webhook.bats new file mode 100644 index 000000000..93a0fdeb9 --- /dev/null +++ b/.vortex/tests/bats/deploy-webhook.bats @@ -0,0 +1,66 @@ +#!/usr/bin/env bats +# +# Test for webhook deployments. +# +# shellcheck disable=SC2030,SC2031,SC2129,SC2155 + +load _helper.bash +load _helper.deployment.bash + +@test "Missing variable checks" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + unset VORTEX_DEPLOY_WEBHOOK_URL + unset VORTEX_DEPLOY_WEBHOOK_METHOD + unset VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS + + run scripts/vortex/deploy-webhook.sh + assert_failure + assert_output_contains "Missing required value for VORTEX_DEPLOY_WEBHOOK_URL." + + mock_curl=$(mock_command "curl") + mock_set_output "${mock_curl}" "200" 1 + export VORTEX_DEPLOY_WEBHOOK_URL="https://example.com" + unset VORTEX_DEPLOY_WEBHOOK_METHOD + unset VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS + + run scripts/vortex/deploy-webhook.sh + assert_success + assert_output_not_contains "Missing required value for VORTEX_DEPLOY_WEBHOOK_METHOD." + assert_output_not_contains "Missing required value for VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS." + + popd >/dev/null +} + +@test "Successful webhook deployment" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + export VORTEX_DEPLOY_WEBHOOK_URL="https://example.com" + export VORTEX_DEPLOY_WEBHOOK_METHOD="GET" + export VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS="200" + mock_curl=$(mock_command "curl") + mock_set_output "${mock_curl}" "${VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS}" 1 + + run scripts/vortex/deploy-webhook.sh + assert_success + assert_output_contains "Webhook call completed." + assert_output_contains "Finished WEBHOOK deployment." + + popd >/dev/null +} + +@test "Failed webhook deployment" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + export VORTEX_DEPLOY_WEBHOOK_URL="https://example.com" + export VORTEX_DEPLOY_WEBHOOK_METHOD="GET" + export VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS="200" + mock_curl=$(mock_command "curl") + mock_set_output "${mock_curl}" "400" 1 + + run scripts/vortex/deploy-webhook.sh + assert_failure + assert_output_contains "Unable to complete webhook deployment." + + popd >/dev/null +} diff --git a/.scaffold/tests/bats/deployment0.bats b/.vortex/tests/bats/deployment0.bats similarity index 82% rename from .scaffold/tests/bats/deployment0.bats rename to .vortex/tests/bats/deployment0.bats index 36722e5ed..e69417d25 100644 --- a/.scaffold/tests/bats/deployment0.bats +++ b/.vortex/tests/bats/deployment0.bats @@ -65,17 +65,17 @@ load _helper.deployment.bash substep "Running deployment." # This deployment uses all 3 types. - export DREVOPS_DEPLOY_TYPES="artifact,webhook,container_registry" + export VORTEX_DEPLOY_TYPES="artifact,webhook,container_registry" # Variables for ARTIFACT deployment. - export DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE="${REMOTE_REPO_DIR}"/.git - export DREVOPS_DEPLOY_ARTIFACT_ROOT="${CURRENT_PROJECT_DIR}" - export DREVOPS_DEPLOY_ARTIFACT_SRC="${SRC_DIR}" - export DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL="${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL:-testuser@example.com}" + export VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE="${REMOTE_REPO_DIR}"/.git + export VORTEX_DEPLOY_ARTIFACT_ROOT="${CURRENT_PROJECT_DIR}" + export VORTEX_DEPLOY_ARTIFACT_SRC="${SRC_DIR}" + export VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL="${VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL:-testuser@example.com}" # Variables for WEBHOOK deployment. - export DREVOPS_DEPLOY_WEBHOOK_URL=http://example.com - export DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS=200 + export VORTEX_DEPLOY_WEBHOOK_URL=http://example.com + export VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS=200 # Variables for container registry deployment. # @todo: Not implemented. Add here when implemented. @@ -110,10 +110,10 @@ load _helper.deployment.bash # Container registry deployment assertions. # # By default, container registry deployment will not proceed if - # service-to-image map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP + # service-to-image map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP # variable and will exit normally. assert_output_contains "Started container registry deployment." - assert_output_contains "Services map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable." + assert_output_contains "Services map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable." assert_output_not_contains "Finished container registry deployment." popd >/dev/null @@ -160,11 +160,11 @@ load _helper.deployment.bash substep "Running deployment." - export DREVOPS_DEPLOY_TYPES="webhook" + export VORTEX_DEPLOY_TYPES="webhook" # Variables for WEBHOOK deployment. - export DREVOPS_DEPLOY_WEBHOOK_URL=http://example.com - export DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS=200 + export VORTEX_DEPLOY_WEBHOOK_URL=http://example.com + export VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS=200 # # Test assertions. @@ -179,7 +179,7 @@ load _helper.deployment.bash assert_output_contains "Finished WEBHOOK deployment." step "Run deployment with skip flag set, but without per-branch or per-pr skip flags." - export DREVOPS_DEPLOY_ALLOW_SKIP=1 + export VORTEX_DEPLOY_ALLOW_SKIP=1 run ahoy deploy assert_success @@ -189,43 +189,43 @@ load _helper.deployment.bash assert_output_contains "Finished WEBHOOK deployment." step "Run deployment with skip flag set and with per-branch flag set." - export DREVOPS_DEPLOY_ALLOW_SKIP=1 + export VORTEX_DEPLOY_ALLOW_SKIP=1 - export DREVOPS_DEPLOY_BRANCH="feature/test" - export DREVOPS_DEPLOY_SKIP_BRANCH_FEATURE_TEST=1 + export VORTEX_DEPLOY_BRANCH="feature/test" + export VORTEX_DEPLOY_SKIP_BRANCH_FEATURE_TEST=1 run ahoy deploy assert_success assert_output_contains "Found flag to skip a deployment." - assert_output_contains "Found skip variable DREVOPS_DEPLOY_SKIP_BRANCH_FEATURE_TEST for branch feature/test." + assert_output_contains "Found skip variable VORTEX_DEPLOY_SKIP_BRANCH_FEATURE_TEST for branch feature/test." assert_output_contains "Skipping deployment webhook." assert_output_not_contains "Started WEBHOOK deployment." assert_output_not_contains "Finished WEBHOOK deployment." step "Run deployment with skip flag set and with per-pr flag set." - export DREVOPS_DEPLOY_ALLOW_SKIP=1 + export VORTEX_DEPLOY_ALLOW_SKIP=1 - export DREVOPS_DEPLOY_PR="123" - export DREVOPS_DEPLOY_SKIP_PR_123=1 + export VORTEX_DEPLOY_PR="123" + export VORTEX_DEPLOY_SKIP_PR_123=1 run ahoy deploy assert_success assert_output_contains "Found flag to skip a deployment." - assert_output_contains "Found skip variable DREVOPS_DEPLOY_SKIP_PR_123 for PR 123." + assert_output_contains "Found skip variable VORTEX_DEPLOY_SKIP_PR_123 for PR 123." assert_output_contains "Skipping deployment webhook." assert_output_not_contains "Started WEBHOOK deployment." assert_output_not_contains "Finished WEBHOOK deployment." step "Run deployment without skip flag set and with per-pr flag set." - unset DREVOPS_DEPLOY_ALLOW_SKIP + unset VORTEX_DEPLOY_ALLOW_SKIP - export DREVOPS_DEPLOY_PR="123" - export DREVOPS_DEPLOY_SKIP_PR_123=1 + export VORTEX_DEPLOY_PR="123" + export VORTEX_DEPLOY_SKIP_PR_123=1 run ahoy deploy assert_success assert_output_not_contains "Found flag to skip a deployment." - assert_output_not_contains "Found skip variable DREVOPS_DEPLOY_SKIP_PR_123 for PR 123." + assert_output_not_contains "Found skip variable VORTEX_DEPLOY_SKIP_PR_123 for PR 123." assert_output_not_contains "Skipping deployment webhook." assert_output_contains "Started WEBHOOK deployment." assert_output_contains "Finished WEBHOOK deployment." diff --git a/.scaffold/tests/bats/deployment1.bats b/.vortex/tests/bats/deployment1.bats similarity index 87% rename from .scaffold/tests/bats/deployment1.bats rename to .vortex/tests/bats/deployment1.bats index d4ba38146..27cdda289 100644 --- a/.scaffold/tests/bats/deployment1.bats +++ b/.vortex/tests/bats/deployment1.bats @@ -28,7 +28,7 @@ load _helper.deployment.bash # Enable Acquia integration for this test to run independent deployment # by using install auto-discovery. - export DREVOPS_DB_DOWNLOAD_SOURCE="acquia" + export VORTEX_DB_DOWNLOAD_SOURCE="acquia" # Override download from Acquia with a special flag. This still allows to # validate that download script expects credentials, but does not actually @@ -36,7 +36,7 @@ load _helper.deployment.bash # attached to this test). # A demo test database will be used as actual database to provision site # during this test. - echo "DREVOPS_DB_DOWNLOAD_PROCEED=0" >>"${CURRENT_PROJECT_DIR}"/.env + echo "VORTEX_DB_DOWNLOAD_PROCEED=0" >>"${CURRENT_PROJECT_DIR}"/.env # We need to use "current" directory as a place where the deployment script # is going to run from, while "SRC_DIR" is a place where files are taken @@ -75,11 +75,11 @@ load _helper.deployment.bash pushd "${CURRENT_PROJECT_DIR}" >/dev/null step "Running deployment" - export DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE="${REMOTE_REPO_DIR}"/.git - export DREVOPS_DEPLOY_ARTIFACT_ROOT="${CURRENT_PROJECT_DIR}" - export DREVOPS_DEPLOY_ARTIFACT_SRC="${SRC_DIR}" - export DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL="${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL:-testuser@example.com}" - export DREVOPS_DEPLOY_TYPES="artifact" + export VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE="${REMOTE_REPO_DIR}"/.git + export VORTEX_DEPLOY_ARTIFACT_ROOT="${CURRENT_PROJECT_DIR}" + export VORTEX_DEPLOY_ARTIFACT_SRC="${SRC_DIR}" + export VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL="${VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL:-testuser@example.com}" + export VORTEX_DEPLOY_TYPES="artifact" run ahoy deploy assert_success @@ -92,7 +92,7 @@ load _helper.deployment.bash assert_output_not_contains "Finished WEBHOOK deployment." assert_output_not_contains "Started container registry deployment." - assert_output_not_contains "Services map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable." + assert_output_not_contains "Services map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable." assert_output_not_contains "Finished container registry deployment." assert_output_not_contains "Started LAGOON deployment." @@ -167,11 +167,11 @@ load _helper.deployment.bash step "Running deployment" # Always force installing of the Lagoon CLI binary in tests rather than using # a local version. - export DREVOPS_LAGOONCLI_FORCE_INSTALL=1 - export DREVOPS_LAGOONCLI_PATH="${APP_TMP_DIR}" - export DREVOPS_DEPLOY_LAGOON_INSTANCE="testlagoon" + export VORTEX_LAGOONCLI_FORCE_INSTALL=1 + export VORTEX_LAGOONCLI_PATH="${APP_TMP_DIR}" + export VORTEX_DEPLOY_LAGOON_INSTANCE="testlagoon" export LAGOON_PROJECT="testproject" - export DREVOPS_DEPLOY_BRANCH="testbranch" + export VORTEX_DEPLOY_BRANCH="testbranch" mock_lagoon=$(mock_command "lagoon") @@ -182,7 +182,7 @@ load _helper.deployment.bash assert_output_contains "Finished Lagoon deployment." # Assert lagoon binary exists and was called. - assert_file_exists "${DREVOPS_LAGOONCLI_PATH}/lagoon" + assert_file_exists "${VORTEX_LAGOONCLI_PATH}/lagoon" assert_equal 3 "$(mock_get_call_num "${mock_lagoon}")" # Configure. @@ -202,7 +202,7 @@ load _helper.deployment.bash assert_output_not_contains "Finished WEBHOOK deployment." assert_output_not_contains "Started container registry deployment." - assert_output_not_contains "Services map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable." + assert_output_not_contains "Services map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable." assert_output_not_contains "Finished container registry deployment." popd >/dev/null @@ -266,11 +266,11 @@ load _helper.deployment.bash step "Running deployment" # Always force installing of the Lagoon CLI binary in tests rather than using # a local version. - export DREVOPS_LAGOONCLI_FORCE_INSTALL=1 - export DREVOPS_LAGOONCLI_PATH="${APP_TMP_DIR}" - export DREVOPS_DEPLOY_LAGOON_INSTANCE="testlagoon" + export VORTEX_LAGOONCLI_FORCE_INSTALL=1 + export VORTEX_LAGOONCLI_PATH="${APP_TMP_DIR}" + export VORTEX_DEPLOY_LAGOON_INSTANCE="testlagoon" export LAGOON_PROJECT="testproject" - export DREVOPS_DEPLOY_BRANCH="testbranch" + export VORTEX_DEPLOY_BRANCH="testbranch" mock_lagoon=$(mock_command "lagoon") # Configuring. @@ -287,7 +287,7 @@ load _helper.deployment.bash mock_set_output "${mock_lagoon}" "success" 6 # Deployment action to override db. - export DREVOPS_DEPLOY_ACTION="deploy_override_db" + export VORTEX_DEPLOY_ACTION="deploy_override_db" run ahoy deploy assert_success @@ -301,7 +301,7 @@ load _helper.deployment.bash assert_output_contains "Finished Lagoon deployment." # Assert lagoon binary exists and was called. - assert_file_exists "${DREVOPS_LAGOONCLI_PATH}/lagoon" + assert_file_exists "${VORTEX_LAGOONCLI_PATH}/lagoon" # Deployment script calls API several times. assert_equal 6 "$(mock_get_call_num "${mock_lagoon}")" @@ -311,13 +311,13 @@ load _helper.deployment.bash # Get a list of environments. assert_contains "--lagoon testlagoon --project testproject list environments --output-json --pretty" "$(mock_get_call_args "${mock_lagoon}" 2)" # Explicitly set DB overwrite flag to 0 due to a bug in Lagoon. - assert_contains "--lagoon testlagoon --project testproject update variable --environment testbranch --name DREVOPS_PROVISION_OVERRIDE_DB --value 0 --scope global" "$(mock_get_call_args "${mock_lagoon}" 3)" + assert_contains "--lagoon testlagoon --project testproject update variable --environment testbranch --name VORTEX_PROVISION_OVERRIDE_DB --value 0 --scope global" "$(mock_get_call_args "${mock_lagoon}" 3)" # Override DB during re-deployment. - assert_contains "--lagoon testlagoon --project testproject update variable --environment testbranch --name DREVOPS_PROVISION_OVERRIDE_DB --value 1 --scope global" "$(mock_get_call_args "${mock_lagoon}" 4)" + assert_contains "--lagoon testlagoon --project testproject update variable --environment testbranch --name VORTEX_PROVISION_OVERRIDE_DB --value 1 --scope global" "$(mock_get_call_args "${mock_lagoon}" 4)" # Redeploy. assert_contains "--lagoon testlagoon --project testproject deploy latest --environment testbranch" "$(mock_get_call_args "${mock_lagoon}" 5)" # Remove a DB import override flag for the current deployment. - assert_contains "--lagoon testlagoon --project testproject update variable --environment testbranch --name DREVOPS_PROVISION_OVERRIDE_DB --value 0 --scope global" "$(mock_get_call_args "${mock_lagoon}" 6)" + assert_contains "--lagoon testlagoon --project testproject update variable --environment testbranch --name VORTEX_PROVISION_OVERRIDE_DB --value 0 --scope global" "$(mock_get_call_args "${mock_lagoon}" 6)" # Assert that no other deployments ran. assert_output_not_contains "Started ARTIFACT deployment." @@ -329,7 +329,7 @@ load _helper.deployment.bash assert_output_not_contains "Finished WEBHOOK deployment." assert_output_not_contains "Started container registry deployment." - assert_output_not_contains "Services map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable." + assert_output_not_contains "Services map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable." assert_output_not_contains "Finished container registry deployment." popd >/dev/null diff --git a/.scaffold/tests/bats/docker-compose.bats b/.vortex/tests/bats/docker-compose.bats similarity index 90% rename from .scaffold/tests/bats/docker-compose.bats rename to .vortex/tests/bats/docker-compose.bats index 7673a0009..0f50d2604 100644 --- a/.scaffold/tests/bats/docker-compose.bats +++ b/.vortex/tests/bats/docker-compose.bats @@ -50,8 +50,8 @@ load _helper.bash cp "${ROOT_DIR}/.env" .env echo "COMPOSE_PROJECT_NAME=the_matrix" >>.env - echo "DREVOPS_WEBROOT=docroot" >>.env - echo "DREVOPS_DB_IMAGE=myorg/my_db_image" >>.env + echo "VORTEX_WEBROOT=docroot" >>.env + echo "VORTEX_DB_IMAGE=myorg/my_db_image" >>.env echo "XDEBUG_ENABLE=1" >>.env echo "DRUPAL_SHIELD_USER=jane" >>.env echo "DRUPAL_SHIELD_PASS=passw" >>.env @@ -108,10 +108,10 @@ prepare_docker_compose() { # Prepare fixtures docker-compose for testing. prepare_docker_compose_fixtures() { - cp "${ROOT_DIR}/.scaffold/tests/bats/fixtures/docker-compose.env.json" docker-compose.env.json - cp "${ROOT_DIR}/.scaffold/tests/bats/fixtures/docker-compose.env_mod.json" docker-compose.env_mod.json - cp "${ROOT_DIR}/.scaffold/tests/bats/fixtures/docker-compose.noenv.json" docker-compose.noenv.json - cp "${ROOT_DIR}/.scaffold/tests/bats/fixtures/docker-compose.env_local.json" docker-compose.env_local.json + cp "${ROOT_DIR}/.vortex/tests/bats/fixtures/docker-compose.env.json" docker-compose.env.json + cp "${ROOT_DIR}/.vortex/tests/bats/fixtures/docker-compose.env_mod.json" docker-compose.env_mod.json + cp "${ROOT_DIR}/.vortex/tests/bats/fixtures/docker-compose.noenv.json" docker-compose.noenv.json + cp "${ROOT_DIR}/.vortex/tests/bats/fixtures/docker-compose.env_local.json" docker-compose.env_local.json replace_string_content "FIXTURE_CUR_DIR" "${CURRENT_PROJECT_DIR}" "${CURRENT_PROJECT_DIR}" # Replace symlink /private paths in MacOS. @@ -168,6 +168,6 @@ update_docker_compose_fixture() { if [ -n "${UPDATE_FIXTURES:-}" ]; then step "Updating fixtures" replace_string_content "${CURRENT_PROJECT_DIR}" "FIXTURE_CUR_DIR" "${CURRENT_PROJECT_DIR}" - cp -Rf "${1}" "${ROOT_DIR}/.scaffold/tests/bats/fixtures/${2}" + cp -Rf "${1}" "${ROOT_DIR}/.vortex/tests/bats/fixtures/${2}" fi } diff --git a/.scaffold/tests/bats/env.bats b/.vortex/tests/bats/env.bats similarity index 100% rename from .scaffold/tests/bats/env.bats rename to .vortex/tests/bats/env.bats diff --git a/.scaffold/tests/bats/fixtures/docker-compose.env.json b/.vortex/tests/bats/fixtures/docker-compose.env.json similarity index 96% rename from .scaffold/tests/bats/fixtures/docker-compose.env.json rename to .vortex/tests/bats/fixtures/docker-compose.env.json index e3954a3b5..c77674f05 100644 --- a/.scaffold/tests/bats/fixtures/docker-compose.env.json +++ b/.vortex/tests/bats/fixtures/docker-compose.env.json @@ -23,7 +23,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -79,7 +79,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -125,7 +125,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -179,7 +179,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -234,7 +234,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -295,7 +295,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -366,7 +366,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", diff --git a/.scaffold/tests/bats/fixtures/docker-compose.env_local.json b/.vortex/tests/bats/fixtures/docker-compose.env_local.json similarity index 96% rename from .scaffold/tests/bats/fixtures/docker-compose.env_local.json rename to .vortex/tests/bats/fixtures/docker-compose.env_local.json index e3954a3b5..c77674f05 100644 --- a/.scaffold/tests/bats/fixtures/docker-compose.env_local.json +++ b/.vortex/tests/bats/fixtures/docker-compose.env_local.json @@ -23,7 +23,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -79,7 +79,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -125,7 +125,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -179,7 +179,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -234,7 +234,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -295,7 +295,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -366,7 +366,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", diff --git a/.scaffold/tests/bats/fixtures/docker-compose.env_mod.json b/.vortex/tests/bats/fixtures/docker-compose.env_mod.json similarity index 96% rename from .scaffold/tests/bats/fixtures/docker-compose.env_mod.json rename to .vortex/tests/bats/fixtures/docker-compose.env_mod.json index 4e3d26154..456b0158e 100644 --- a/.scaffold/tests/bats/fixtures/docker-compose.env_mod.json +++ b/.vortex/tests/bats/fixtures/docker-compose.env_mod.json @@ -23,7 +23,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -79,7 +79,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -125,7 +125,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -179,7 +179,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -234,7 +234,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -295,7 +295,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -366,7 +366,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "the_matrix.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", diff --git a/.scaffold/tests/bats/fixtures/docker-compose.noenv.json b/.vortex/tests/bats/fixtures/docker-compose.noenv.json similarity index 96% rename from .scaffold/tests/bats/fixtures/docker-compose.noenv.json rename to .vortex/tests/bats/fixtures/docker-compose.noenv.json index cd773e248..1a7a5f615 100644 --- a/.scaffold/tests/bats/fixtures/docker-compose.noenv.json +++ b/.vortex/tests/bats/fixtures/docker-compose.noenv.json @@ -23,7 +23,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -79,7 +79,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -125,7 +125,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -179,7 +179,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -234,7 +234,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -295,7 +295,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", @@ -366,7 +366,7 @@ "entrypoint": null, "environment": { "CI": "true", - "DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io", + "VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io", "DRUPAL_CONFIG_PATH": "/app/config/default", "DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private", "DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files", diff --git a/.scaffold/tests/bats/fixtures/fixture.png b/.vortex/tests/bats/fixtures/fixture.png similarity index 100% rename from .scaffold/tests/bats/fixtures/fixture.png rename to .vortex/tests/bats/fixtures/fixture.png diff --git a/.scaffold/tests/bats/fixtures/fixture.sh b/.vortex/tests/bats/fixtures/fixture.sh similarity index 100% rename from .scaffold/tests/bats/fixtures/fixture.sh rename to .vortex/tests/bats/fixtures/fixture.sh diff --git a/.scaffold/tests/bats/fixtures/fixture1.txt b/.vortex/tests/bats/fixtures/fixture1.txt similarity index 100% rename from .scaffold/tests/bats/fixtures/fixture1.txt rename to .vortex/tests/bats/fixtures/fixture1.txt diff --git a/.scaffold/tests/bats/fixtures/fixture1_newline.txt b/.vortex/tests/bats/fixtures/fixture1_newline.txt similarity index 100% rename from .scaffold/tests/bats/fixtures/fixture1_newline.txt rename to .vortex/tests/bats/fixtures/fixture1_newline.txt diff --git a/.scaffold/tests/bats/fixtures/fixture2.txt b/.vortex/tests/bats/fixtures/fixture2.txt similarity index 100% rename from .scaffold/tests/bats/fixtures/fixture2.txt rename to .vortex/tests/bats/fixtures/fixture2.txt diff --git a/.scaffold/tests/bats/helpers.bats b/.vortex/tests/bats/helpers.bats similarity index 100% rename from .scaffold/tests/bats/helpers.bats rename to .vortex/tests/bats/helpers.bats diff --git a/.scaffold/tests/bats/install.demo.bats b/.vortex/tests/bats/install.demo.bats similarity index 72% rename from .scaffold/tests/bats/install.demo.bats rename to .vortex/tests/bats/install.demo.bats index 588a3698f..4d1e1d9b3 100644 --- a/.scaffold/tests/bats/install.demo.bats +++ b/.vortex/tests/bats/install.demo.bats @@ -13,7 +13,7 @@ load _helper.bash assert_files_present assert_git_repo - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL" assert_file_exists .data/db.sql } @@ -25,7 +25,7 @@ load _helper.bash assert_files_present assert_git_repo - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=http" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=http" assert_file_exists .data/db.sql contents=$(cat .data/db.sql) @@ -33,7 +33,7 @@ load _helper.bash } @test "Demo force disabled" { - export DREVOPS_INSTALL_DEMO=0 + export VORTEX_INSTALL_DEMO=0 assert_file_not_exists .data/db.sql @@ -41,12 +41,12 @@ load _helper.bash assert_files_present assert_git_repo - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=http" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=http" assert_file_not_exists .data/db.sql } @test "Demo force enabled" { - export DREVOPS_INSTALL_DEMO=1 + export VORTEX_INSTALL_DEMO=1 mktouch .data/db.sql assert_file_exists .data/db.sql @@ -55,7 +55,7 @@ load _helper.bash assert_files_present assert_git_repo - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=http" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=http" assert_file_exists .data/db.sql contents=$(cat .data/db.sql) @@ -63,7 +63,7 @@ load _helper.bash } @test "Demo auto discovery - enabled; skip demo processing" { - echo "DREVOPS_INSTALL_DEMO_SKIP=1" >>.env + echo "VORTEX_INSTALL_DEMO_SKIP=1" >>.env assert_file_not_exists .data/db.sql @@ -71,6 +71,6 @@ load _helper.bash assert_files_present assert_git_repo - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=http" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=http" assert_file_not_exists .data/db.sql } diff --git a/.scaffold/tests/bats/install.existing.bats b/.vortex/tests/bats/install.existing.bats similarity index 98% rename from .scaffold/tests/bats/install.existing.bats rename to .vortex/tests/bats/install.existing.bats index 57e689a88..64135ebc4 100644 --- a/.scaffold/tests/bats/install.existing.bats +++ b/.vortex/tests/bats/install.existing.bats @@ -38,7 +38,7 @@ load _helper.bash mkdir -p ".docker" touch ".docker/test2.txt" - unset DREVOPS_INIT_REPO + unset VORTEX_INIT_REPO run_installer_quiet # Assert that a directory became a git repository. @@ -309,7 +309,7 @@ load _helper.bash } @test "Install into existing: previously installed project; custom webroot; discovery; quiet" { - echo "DREVOPS_WEBROOT=rootdoc" >>".env" + echo "VORTEX_WEBROOT=rootdoc" >>".env" # Populate current dir with a project at current version. output=$(run_installer_quiet) @@ -365,7 +365,7 @@ load _helper.bash } @test "Install into existing: previously installed project; provision_use_profile; discovery; quiet" { - echo "DREVOPS_PROVISION_USE_PROFILE=1" >>".env" + echo "VORTEX_PROVISION_USE_PROFILE=1" >>".env" # Populate current dir with a project at current version. output=$(run_installer_quiet) @@ -386,7 +386,7 @@ load _helper.bash } @test "Install into existing: previously installed project; override_existing_db; discovery; quiet" { - echo "DREVOPS_PROVISION_OVERRIDE_DB=1" >>".env" + echo "VORTEX_PROVISION_OVERRIDE_DB=1" >>".env" # Populate current dir with a project at current version. output=$(run_installer_quiet) @@ -409,7 +409,7 @@ load _helper.bash } @test "Install into existing: previously installed project; Deployment; discovery; quiet" { - echo "DREVOPS_DEPLOY_TYPES=lagoon" >>".env" + echo "VORTEX_DEPLOY_TYPES=lagoon" >>".env" output=$(run_installer_quiet) assert_output_contains "WELCOME TO DREVOPS QUIET INSTALLER" diff --git a/.scaffold/tests/bats/install.initial.bats b/.vortex/tests/bats/install.initial.bats similarity index 81% rename from .scaffold/tests/bats/install.initial.bats rename to .vortex/tests/bats/install.initial.bats index 1163aab39..47f67cd2f 100644 --- a/.scaffold/tests/bats/install.initial.bats +++ b/.vortex/tests/bats/install.initial.bats @@ -17,7 +17,7 @@ load _helper.bash assert_git_repo } -@test "Install into empty directory: DREVOPS_INSTALL_DST_DIR is a current dir" { +@test "Install into empty directory: VORTEX_INSTALL_DST_DIR is a current dir" { export CURRENT_PROJECT_DIR="${DST_PROJECT_DIR}" run_installer_quiet @@ -25,23 +25,23 @@ load _helper.bash assert_git_repo "${DST_PROJECT_DIR}" } -@test "Install into empty directory: DREVOPS_INSTALL_DST_DIR from an argument" { +@test "Install into empty directory: VORTEX_INSTALL_DST_DIR from an argument" { run_installer_quiet "${DST_PROJECT_DIR}" assert_files_present "${DST_PROJECT_DIR}" "dst" "ds" "Ds" "Dst" assert_git_repo "${DST_PROJECT_DIR}" } -@test "Install into empty directory: DREVOPS_INSTALL_DST_DIR from env variable" { - export DREVOPS_INSTALL_DST_DIR="${DST_PROJECT_DIR}" +@test "Install into empty directory: VORTEX_INSTALL_DST_DIR from env variable" { + export VORTEX_INSTALL_DST_DIR="${DST_PROJECT_DIR}" run_installer_quiet assert_files_present "${DST_PROJECT_DIR}" "dst" "ds" "Ds" "Dst" assert_git_repo "${DST_PROJECT_DIR}" } -@test "Install into empty directory: DREVOPS_PROJECT from environment variable" { - export DREVOPS_PROJECT="the_matrix" +@test "Install into empty directory: VORTEX_PROJECT from environment variable" { + export VORTEX_PROJECT="the_matrix" run_installer_quiet @@ -49,8 +49,8 @@ load _helper.bash assert_git_repo } -@test "Install into empty directory: DREVOPS_PROJECT from .env file" { - echo 'DREVOPS_PROJECT="the_matrix"' >".env" +@test "Install into empty directory: VORTEX_PROJECT from .env file" { + echo 'VORTEX_PROJECT="the_matrix"' >".env" run_installer_quiet @@ -73,7 +73,7 @@ load _helper.bash git_commit "New version 2 of DrevOps" "${LOCAL_REPO_DIR}" # Requiring bespoke version by commit. - echo DREVOPS_INSTALL_COMMIT="${commit1}" >>.env + echo VORTEX_INSTALL_COMMIT="${commit1}" >>.env run_installer_quiet assert_git_repo assert_output_contains "This will install DrevOps scaffold into your project at commit" @@ -200,7 +200,7 @@ load _helper.bash } @test "Install into empty directory; DrevOps badge version set" { - export DREVOPS_VERSION="1.2.3" + export VORTEX_VERSION="1.2.3" run_installer_quiet @@ -210,35 +210,35 @@ load _helper.bash } @test "Install into empty directory; db from curl, storage is database import" { - export DREVOPS_DB_DOWNLOAD_SOURCE=curl + export VORTEX_DB_DOWNLOAD_SOURCE=curl run_installer_quiet - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE=curl" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE=curl" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=" } @test "Install into empty directory; db from curl; storage is container image" { - export DREVOPS_DB_DOWNLOAD_SOURCE=curl + export VORTEX_DB_DOWNLOAD_SOURCE=curl - export DREVOPS_DB_IMAGE="drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + export VORTEX_DB_IMAGE="drevops/drevops-mariadb-drupal-data-demo-10.x:latest" run_installer_quiet - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE=curl" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=" - assert_file_contains ".env" "DREVOPS_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE=curl" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=" + assert_file_contains ".env" "VORTEX_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" } @test "Install into empty directory; db from container image; storage is container image" { - export DREVOPS_DB_DOWNLOAD_SOURCE=container_registry - export DREVOPS_DB_IMAGE="drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + export VORTEX_DB_DOWNLOAD_SOURCE=container_registry + export VORTEX_DB_IMAGE="drevops/drevops-mariadb-drupal-data-demo-10.x:latest" run_installer_quiet - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE=container_registry" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=" - assert_file_contains ".env" "DREVOPS_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE=container_registry" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=" + assert_file_contains ".env" "VORTEX_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" } @test "Install into empty directory; DrevOps scripts are not modified" { @@ -248,7 +248,7 @@ load _helper.bash assert_git_repo "${DST_PROJECT_DIR}" assert_dirs_equal "${LOCAL_REPO_DIR}/scripts/composer" "${DST_PROJECT_DIR}/scripts/composer" - assert_dirs_equal "${LOCAL_REPO_DIR}/scripts/drevops" "${DST_PROJECT_DIR}/scripts/drevops" + assert_dirs_equal "${LOCAL_REPO_DIR}/scripts/vortex" "${DST_PROJECT_DIR}/scripts/vortex" } @test "Install into empty directory; Images are not modified" { diff --git a/.scaffold/tests/bats/install.integrations.bats b/.vortex/tests/bats/install.integrations.bats similarity index 96% rename from .scaffold/tests/bats/install.integrations.bats rename to .vortex/tests/bats/install.integrations.bats index d785c47d6..1b4bf60fa 100644 --- a/.scaffold/tests/bats/install.integrations.bats +++ b/.vortex/tests/bats/install.integrations.bats @@ -83,7 +83,7 @@ load _helper.bash assert_files_present_integration_renovatebot assert_file_contains ".lagoon.yml" "name: Download database" - assert_file_contains ".lagoon.yml" "export DREVOPS_PROVISION_OVERRIDE_DB=0" + assert_file_contains ".lagoon.yml" "export VORTEX_PROVISION_OVERRIDE_DB=0" assert_file_not_contains ".lagoon.yml" "# Explicitly set DB overwrite flag to the value from .env file for deployments from the profile." } @@ -125,7 +125,7 @@ load _helper.bash assert_files_present_integration_renovatebot assert_file_contains ".lagoon.yml" "name: Download database" - assert_file_contains ".lagoon.yml" "export DREVOPS_PROVISION_OVERRIDE_DB=0" + assert_file_contains ".lagoon.yml" "export VORTEX_PROVISION_OVERRIDE_DB=0" assert_file_not_contains ".lagoon.yml" "# Explicitly set DB overwrite flag to the value from .env file for deployments from the profile." } @@ -201,6 +201,6 @@ load _helper.bash assert_files_present_no_integration_renovatebot assert_file_not_contains ".lagoon.yml" "name: Download database" - assert_file_not_contains ".lagoon.yml" "export DREVOPS_PROVISION_OVERRIDE_DB=0" + assert_file_not_contains ".lagoon.yml" "export VORTEX_PROVISION_OVERRIDE_DB=0" assert_file_contains ".lagoon.yml" "# Explicitly set DB overwrite flag to the value from .env file for deployments from the profile." } diff --git a/.scaffold/tests/bats/install.parameters.bats b/.vortex/tests/bats/install.parameters.bats similarity index 97% rename from .scaffold/tests/bats/install.parameters.bats rename to .vortex/tests/bats/install.parameters.bats index c3148089d..919969839 100644 --- a/.scaffold/tests/bats/install.parameters.bats +++ b/.vortex/tests/bats/install.parameters.bats @@ -12,7 +12,7 @@ load _helper.bash @test "Install parameters: empty dir; proceed switch; quiet" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 output=$(run_installer_quiet) assert_output_contains "WELCOME TO DREVOPS QUIET INSTALLER" assert_output_contains "Aborting project installation. No files were changed" @@ -20,7 +20,7 @@ load _helper.bash } @test "Install parameters: empty dir; proceed switch; interactive" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 answers=( "Star wars" # name @@ -51,7 +51,7 @@ load _helper.bash } @test "Install parameters: empty dir; defaults; quiet" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 output=$(run_installer_quiet) assert_output_contains "WELCOME TO DREVOPS QUIET INSTALLER" @@ -80,7 +80,7 @@ load _helper.bash } @test "Install parameters: empty dir; defaults; interactive" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 answers=( "Star wars" # name @@ -131,7 +131,7 @@ load _helper.bash # Note that there is no quiet test for this scenario. @test "Install parameters: empty dir; overrides and normalisation; interactive" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 answers=( "star Wars" # name @@ -183,7 +183,7 @@ load _helper.bash } @test "Install parameters: empty dir; overrides and normalisation; interactive; custom webroot" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 answers=( "star Wars" # name @@ -235,7 +235,7 @@ load _helper.bash } @test "Install parameters: pre-installed; overrides, normalisation and discovery; quiet" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 fixture_preinstalled web @@ -266,7 +266,7 @@ load _helper.bash } @test "Install parameters: pre-installed; overrides, normalisation and discovery; interactive; accepting suggested values" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 fixture_preinstalled web @@ -320,7 +320,7 @@ load _helper.bash } @test "Install parameters: pre-installed; overrides, normalisation and discovery; interactive; user input overrides discovery which overrides defaults" { - export DREVOPS_INSTALL_PROCEED=0 + export VORTEX_INSTALL_PROCEED=0 fixture_preinstalled web @@ -417,13 +417,13 @@ fixture_preinstalled() { # Sets 'preserve_dependencies' to 'Yes'. touch renovate.json - echo "DREVOPS_WEBROOT=${webroot}" >>.env + echo "VORTEX_WEBROOT=${webroot}" >>.env # Sets 'fresh_install' to 'No'. - echo "DREVOPS_PROVISION_USE_PROFILE=0" >>.env + echo "VORTEX_PROVISION_USE_PROFILE=0" >>.env # Sets 'override_existing_db' to 'No'. - echo "DREVOPS_PROVISION_OVERRIDE_DB=0" >>.env + echo "VORTEX_PROVISION_OVERRIDE_DB=0" >>.env # Sets 'preserve_doc_comments' to 'Yes'. echo "# Ahoy configuration file." >>.ahoy.yml diff --git a/.scaffold/tests/bats/login-container-registry.bats b/.vortex/tests/bats/login-container-registry.bats similarity index 51% rename from .scaffold/tests/bats/login-container-registry.bats rename to .vortex/tests/bats/login-container-registry.bats index 0f9ad8e9b..532b9b9a7 100644 --- a/.scaffold/tests/bats/login-container-registry.bats +++ b/.vortex/tests/bats/login-container-registry.bats @@ -10,41 +10,41 @@ load _helper.deployment.bash @test "Docker configuration present" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_CONTAINER_REGISTRY="https://www.example.com" + export VORTEX_CONTAINER_REGISTRY="https://www.example.com" provision_docker_config_file $CONTAINER_REGISTRY export HOME=${BUILD_DIR} - run scripts/drevops/login-container-registry.sh + run scripts/vortex/login-container-registry.sh assert_success assert_output_contains Already logged in to the registry \"https://www.example.com\" popd >/dev/null } -@test "CONTAINER_REGISTRY, DREVOPS_CONTAINER_REGISTRY_USER and DREVOPS_CONTAINER_REGISTRY_PASS must be set" { +@test "CONTAINER_REGISTRY, VORTEX_CONTAINER_REGISTRY_USER and VORTEX_CONTAINER_REGISTRY_PASS must be set" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 export HOME=${BUILD_DIR} - unset DREVOPS_CONTAINER_REGISTRY_USER - unset DREVOPS_CONTAINER_REGISTRY_PASS + unset VORTEX_CONTAINER_REGISTRY_USER + unset VORTEX_CONTAINER_REGISTRY_PASS - run scripts/drevops/login-container-registry.sh + run scripts/vortex/login-container-registry.sh assert_success - assert_output_not_contains "Missing required value for DREVOPS_CONTAINER_REGISTRY." - assert_output_contains "Skipping login into the container registry as eithe DREVOPS_CONTAINER_REGISTRY_USER or DREVOPS_CONTAINER_REGISTRY_PASS was not provided." + assert_output_not_contains "Missing required value for VORTEX_CONTAINER_REGISTRY." + assert_output_contains "Skipping login into the container registry as eithe VORTEX_CONTAINER_REGISTRY_USER or VORTEX_CONTAINER_REGISTRY_PASS was not provided." - export DREVOPS_CONTAINER_REGISTRY_USER="test_user" + export VORTEX_CONTAINER_REGISTRY_USER="test_user" - run scripts/drevops/login-container-registry.sh + run scripts/vortex/login-container-registry.sh assert_success - assert_output_contains "Skipping login into the container registry as eithe DREVOPS_CONTAINER_REGISTRY_USER or DREVOPS_CONTAINER_REGISTRY_PASS was not provided." + assert_output_contains "Skipping login into the container registry as eithe VORTEX_CONTAINER_REGISTRY_USER or VORTEX_CONTAINER_REGISTRY_PASS was not provided." mock_docker=$(mock_command "docker") mock_set_output "${mock_docker}" "Login Succeeded" 1 - export DREVOPS_CONTAINER_REGISTRY_PASS="test_pass" - export DREVOPS_CONTAINER_REGISTRY="https://www.example.com" + export VORTEX_CONTAINER_REGISTRY_PASS="test_pass" + export VORTEX_CONTAINER_REGISTRY="https://www.example.com" - run scripts/drevops/login-container-registry.sh + run scripts/vortex/login-container-registry.sh assert_success assert_equal "1" "$(mock_get_call_num "${mock_docker}" 1)" assert_output_contains "Logging in to registry \"https://www.example.com\"." diff --git a/.scaffold/tests/bats/notify.bats b/.vortex/tests/bats/notify.bats similarity index 73% rename from .scaffold/tests/bats/notify.bats rename to .vortex/tests/bats/notify.bats index 553cdea46..191134456 100644 --- a/.scaffold/tests/bats/notify.bats +++ b/.vortex/tests/bats/notify.bats @@ -9,8 +9,8 @@ load _helper.bash @test "Notify: skip" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_NOTIFY_SKIP=1 - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_SKIP=1 + run ./scripts/vortex/notify.sh assert_success assert_output_contains "Started dispatching notifications." @@ -23,8 +23,8 @@ load _helper.bash @test "Notify: unsupported event" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_NOTIFY_EVENT="customevent" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_EVENT="customevent" + run ./scripts/vortex/notify.sh assert_failure assert_output_contains "Started dispatching notifications." @@ -37,8 +37,8 @@ load _helper.bash @test "Notify: custom type" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_NOTIFY_CHANNELS="customtype" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="customtype" + run ./scripts/vortex/notify.sh assert_success assert_output_contains "Started dispatching notifications." @@ -50,13 +50,13 @@ load _helper.bash @test "Notify: email" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 - export DREVOPS_NOTIFY_CHANNELS="email" - export DREVOPS_NOTIFY_PROJECT="testproject" + export VORTEX_NOTIFY_CHANNELS="email" + export VORTEX_NOTIFY_PROJECT="testproject" export DRUPAL_SITE_EMAIL="testproject@example.com" - export DREVOPS_NOTIFY_EMAIL_RECIPIENTS="john@example.com|John Doe, jane@example.com|Jane Doe" - export DREVOPS_NOTIFY_REF="develop" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_EMAIL_RECIPIENTS="john@example.com|John Doe, jane@example.com|Jane Doe" + export VORTEX_NOTIFY_REF="develop" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + run ./scripts/vortex/notify.sh assert_success assert_output_contains "Started dispatching notifications." @@ -79,14 +79,14 @@ load _helper.bash mock_set_output "${mock_curl}" "12345678910-1234567890-${app_id}-12345" 1 mock_set_output "${mock_curl}" "201" 2 - export DREVOPS_NOTIFY_CHANNELS="newrelic" - export DREVOPS_NOTIFY_PROJECT="testproject" - export DREVOPS_NOTIFY_NEWRELIC_APIKEY="key1234" - export DREVOPS_NOTIFY_EMAIL_RECIPIENTS="john@example.com|John Doe,jane@example.com|Jane Doe" - export DREVOPS_NOTIFY_REF="develop" - export DREVOPS_NOTIFY_SHA="123456" + export VORTEX_NOTIFY_CHANNELS="newrelic" + export VORTEX_NOTIFY_PROJECT="testproject" + export VORTEX_NOTIFY_NEWRELIC_APIKEY="key1234" + export VORTEX_NOTIFY_EMAIL_RECIPIENTS="john@example.com|John Doe,jane@example.com|Jane Doe" + export VORTEX_NOTIFY_REF="develop" + export VORTEX_NOTIFY_SHA="123456" - run ./scripts/drevops/notify.sh + run ./scripts/vortex/notify.sh assert_success assert_output_contains "Started dispatching notifications." @@ -126,12 +126,12 @@ load _helper.bash mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="pre_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="existingbranch" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="pre_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="existingbranch" + run ./scripts/vortex/notify.sh assert_success run_steps "assert" "${mocks[@]}" @@ -155,12 +155,12 @@ load _helper.bash mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="pre_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="existingbranch" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="pre_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="existingbranch" + run ./scripts/vortex/notify.sh assert_success run_steps "assert" "${mocks[@]}" @@ -182,12 +182,12 @@ load _helper.bash mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="pre_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="nonexistingbranch" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="pre_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="nonexistingbranch" + run ./scripts/vortex/notify.sh assert_failure run_steps "assert" "${mocks[@]}" @@ -212,13 +212,13 @@ load _helper.bash ) mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="post_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="existingbranch" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="post_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="existingbranch" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + run ./scripts/vortex/notify.sh assert_success run_steps "assert" "${mocks[@]}" @@ -243,13 +243,13 @@ load _helper.bash ) mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="post_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="existingbranch" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="post_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="existingbranch" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + run ./scripts/vortex/notify.sh assert_success run_steps "assert" "${mocks[@]}" @@ -272,13 +272,13 @@ load _helper.bash ) mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="post_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="nonexistingbranch" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="post_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="nonexistingbranch" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + run ./scripts/vortex/notify.sh assert_failure run_steps "assert" "${mocks[@]}" @@ -302,13 +302,13 @@ load _helper.bash ) mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="github" - export DREVOPS_NOTIFY_EVENT="post_deployment" - export DREVOPS_NOTIFY_GITHUB_TOKEN="token12345" - export DREVOPS_NOTIFY_REPOSITORY="myorg/myrepo" - export DREVOPS_NOTIFY_BRANCH="existingbranch" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="github" + export VORTEX_NOTIFY_EVENT="post_deployment" + export VORTEX_NOTIFY_GITHUB_TOKEN="token12345" + export VORTEX_NOTIFY_REPOSITORY="myorg/myrepo" + export VORTEX_NOTIFY_BRANCH="existingbranch" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + run ./scripts/vortex/notify.sh assert_failure run_steps "assert" "${mocks[@]}" @@ -346,14 +346,14 @@ load _helper.bash mocks="$(run_steps "setup")" - export DREVOPS_NOTIFY_CHANNELS="jira" - export DREVOPS_NOTIFY_JIRA_USER="john.doe@example.com" - export DREVOPS_NOTIFY_JIRA_TOKEN="token12345" - export DREVOPS_NOTIFY_BRANCH="feature/proj-1234-some-description" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - export DREVOPS_NOTIFY_JIRA_TRANSITION="QA" - export DREVOPS_NOTIFY_JIRA_ASSIGNEE="jane.doe@example.com" - run ./scripts/drevops/notify.sh + export VORTEX_NOTIFY_CHANNELS="jira" + export VORTEX_NOTIFY_JIRA_USER="john.doe@example.com" + export VORTEX_NOTIFY_JIRA_TOKEN="token12345" + export VORTEX_NOTIFY_BRANCH="feature/proj-1234-some-description" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + export VORTEX_NOTIFY_JIRA_TRANSITION="QA" + export VORTEX_NOTIFY_JIRA_ASSIGNEE="jane.doe@example.com" + run ./scripts/vortex/notify.sh assert_success run_steps "assert" "${mocks[@]}" @@ -367,17 +367,17 @@ load _helper.bash mock_curl=$(mock_command "curl") mock_set_output "${mock_curl}" "200" 1 - export DREVOPS_NOTIFY_CHANNELS="webhook" - export DREVOPS_NOTIFY_PROJECT="testproject" - export DREVOPS_NOTIFY_REF="develop" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + export VORTEX_NOTIFY_CHANNELS="webhook" + export VORTEX_NOTIFY_PROJECT="testproject" + export VORTEX_NOTIFY_REF="develop" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - export DREVOPS_NOTIFY_WEBHOOK_URL="https://example-webhook-url.com" - export DREVOPS_NOTIFY_WEBHOOK_METHOD="POST" - export DREVOPS_NOTIFY_WEBHOOK_HEADERS="Content-type: application/json|Authorization: Bearer API_KEY" - export DREVOPS_NOTIFY_WEBHOOK_PAYLOAD='{"channel": "Test channel 1", "message": "Test channel 1 message"}' + export VORTEX_NOTIFY_WEBHOOK_URL="https://example-webhook-url.com" + export VORTEX_NOTIFY_WEBHOOK_METHOD="POST" + export VORTEX_NOTIFY_WEBHOOK_HEADERS="Content-type: application/json|Authorization: Bearer API_KEY" + export VORTEX_NOTIFY_WEBHOOK_PAYLOAD='{"channel": "Test channel 1", "message": "Test channel 1 message"}' - run ./scripts/drevops/notify.sh + run ./scripts/vortex/notify.sh assert_success assert_output_contains "Started dispatching notifications." @@ -397,17 +397,17 @@ load _helper.bash mock_curl=$(mock_command "curl") mock_set_output "${mock_curl}" "400" 1 - export DREVOPS_NOTIFY_CHANNELS="webhook" - export DREVOPS_NOTIFY_PROJECT="testproject" - export DREVOPS_NOTIFY_REF="develop" - export DREVOPS_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" + export VORTEX_NOTIFY_CHANNELS="webhook" + export VORTEX_NOTIFY_PROJECT="testproject" + export VORTEX_NOTIFY_REF="develop" + export VORTEX_NOTIFY_ENVIRONMENT_URL="https://develop.testproject.com" - export DREVOPS_NOTIFY_WEBHOOK_URL="https://example-webhook-url.com" - export DREVOPS_NOTIFY_WEBHOOK_METHOD="POST" - export DREVOPS_NOTIFY_WEBHOOK_HEADERS="Content-type: application/json|Authorization: Bearer API_KEY" - export DREVOPS_NOTIFY_WEBHOOK_PAYLOAD='{"channel": "Test channel 1", "message": "Test channel 1 message"}' + export VORTEX_NOTIFY_WEBHOOK_URL="https://example-webhook-url.com" + export VORTEX_NOTIFY_WEBHOOK_METHOD="POST" + export VORTEX_NOTIFY_WEBHOOK_HEADERS="Content-type: application/json|Authorization: Bearer API_KEY" + export VORTEX_NOTIFY_WEBHOOK_PAYLOAD='{"channel": "Test channel 1", "message": "Test channel 1 message"}' - run ./scripts/drevops/notify.sh + run ./scripts/vortex/notify.sh assert_failure popd >/dev/null || exit 1 diff --git a/.scaffold/tests/bats/provision.bats b/.vortex/tests/bats/provision.bats similarity index 93% rename from .scaffold/tests/bats/provision.bats rename to .vortex/tests/bats/provision.bats index 8fbd86e02..299fb3ea2 100644 --- a/.scaffold/tests/bats/provision.bats +++ b/.vortex/tests/bats/provision.bats @@ -45,7 +45,7 @@ assert_provision_info() { # Remove .env file to test in isolation. rm ./.env && touch ./.env - export DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" export CI=1 mkdir "./.data" @@ -84,7 +84,7 @@ assert_provision_info() { "- Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -139,7 +139,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "Fresh database detected. Performing additional example operations." "- Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -155,8 +155,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" @@ -208,7 +208,7 @@ assert_provision_info() { "- Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -259,7 +259,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "- Fresh database detected. Performing additional example operations." "Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -275,8 +275,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" @@ -292,13 +292,13 @@ assert_provision_info() { # Remove .env file to test in isolation. rm ./.env && touch ./.env - export DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" export CI=1 mkdir "./.data" touch "./.data/db.sql" - export DREVOPS_PROVISION_OVERRIDE_DB=1 + export VORTEX_PROVISION_OVERRIDE_DB=1 create_global_command_wrapper "vendor/bin/drush" @@ -333,7 +333,7 @@ assert_provision_info() { "- Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -388,7 +388,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "Fresh database detected. Performing additional example operations." "- Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -404,8 +404,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" @@ -421,7 +421,7 @@ assert_provision_info() { # Remove .env file to test in isolation. rm ./.env && touch ./.env - export DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" export CI=1 mkdir "./.data" @@ -464,7 +464,7 @@ assert_provision_info() { "- Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -521,7 +521,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "Fresh database detected. Performing additional example operations." "- Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -537,8 +537,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" @@ -554,7 +554,7 @@ assert_provision_info() { # Remove .env file to test in isolation. rm ./.env && touch ./.env - export DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" export CI=1 mkdir "./.data" @@ -562,7 +562,7 @@ assert_provision_info() { create_global_command_wrapper "vendor/bin/drush" - export DREVOPS_PROVISION_USE_PROFILE=1 + export VORTEX_PROVISION_USE_PROFILE=1 declare -a STEPS=( # Drush status calls. @@ -595,7 +595,7 @@ assert_provision_info() { "Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -650,7 +650,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "Fresh database detected. Performing additional example operations." "- Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -666,8 +666,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" @@ -683,7 +683,7 @@ assert_provision_info() { # Remove .env file to test in isolation. rm ./.env && touch ./.env - export DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" export CI=1 mkdir "./.data" @@ -691,7 +691,7 @@ assert_provision_info() { create_global_command_wrapper "vendor/bin/drush" - export DREVOPS_PROVISION_USE_PROFILE=1 + export VORTEX_PROVISION_USE_PROFILE=1 declare -a STEPS=( # Drush status calls. @@ -722,7 +722,7 @@ assert_provision_info() { "- Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -773,7 +773,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "- Fresh database detected. Performing additional example operations." "Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -789,8 +789,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" @@ -806,7 +806,7 @@ assert_provision_info() { # Remove .env file to test in isolation. rm ./.env && touch ./.env - export DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" export CI=1 mkdir "./.data" @@ -814,8 +814,8 @@ assert_provision_info() { create_global_command_wrapper "vendor/bin/drush" - export DREVOPS_PROVISION_USE_PROFILE=1 - export DREVOPS_PROVISION_OVERRIDE_DB=1 + export VORTEX_PROVISION_USE_PROFILE=1 + export VORTEX_PROVISION_OVERRIDE_DB=1 declare -a STEPS=( # Drush status calls. @@ -848,7 +848,7 @@ assert_provision_info() { "- Fresh site content will be created from the profile." # Post-provision operations. - "- Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." + "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." # Maintenance mode. "Enabling maintenance mode." @@ -903,7 +903,7 @@ assert_provision_info() { "@drush -y pm:install ys_core ys_search" "@drush -y deploy:hook" "Executing example operations in non-production environment." - # Assert that DREVOPS_PROVISION_OVERRIDE_DB is correctly passed to the script. + # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script. "Fresh database detected. Performing additional example operations." "- Existing database detected. Performing additional example operations." "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'." @@ -919,8 +919,8 @@ assert_provision_info() { mocks="$(run_steps "setup")" - # export DREVOPS_DEBUG=1 - run ./scripts/drevops/provision.sh + # export VORTEX_DEBUG=1 + run ./scripts/vortex/provision.sh assert_success run_steps "assert" "${mocks[@]}" diff --git a/.scaffold/tests/bats/reset.bats b/.vortex/tests/bats/reset.bats similarity index 99% rename from .scaffold/tests/bats/reset.bats rename to .vortex/tests/bats/reset.bats index 4ab8be18b..0dca517ab 100644 --- a/.scaffold/tests/bats/reset.bats +++ b/.vortex/tests/bats/reset.bats @@ -263,7 +263,7 @@ load _helper.bash assert_file_not_exists "uncommitted_file.txt" - assert_file_exists "scripts/drevops/download-db-acquia.sh" + assert_file_exists "scripts/vortex/download-db-acquia.sh" assert_file_exists "committed_file.txt" # The files would be committed to the consumer repo. diff --git a/.scaffold/tests/bats/setup-ssh.bats b/.vortex/tests/bats/setup-ssh.bats similarity index 57% rename from .scaffold/tests/bats/setup-ssh.bats rename to .vortex/tests/bats/setup-ssh.bats index 2a2bfb485..deaafb659 100644 --- a/.scaffold/tests/bats/setup-ssh.bats +++ b/.vortex/tests/bats/setup-ssh.bats @@ -6,14 +6,14 @@ load _helper.bash -@test "No DREVOPS_SSH_PREFIX" { +@test "No VORTEX_SSH_PREFIX" { pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 setup_ssh_key_fixture - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_failure - assert_output_contains "Missing the required DREVOPS_SSH_PREFIX environment variable" + assert_output_contains "Missing the required VORTEX_SSH_PREFIX environment variable" popd >/dev/null } @@ -22,12 +22,12 @@ load _helper.bash pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 setup_ssh_key_fixture - export DREVOPS_SSH_PREFIX="TEST" - export DREVOPS_TEST_SSH_FILE=false + export VORTEX_SSH_PREFIX="TEST" + export VORTEX_TEST_SSH_FILE=false - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_success - assert_output_contains "Found variable DREVOPS_TEST_SSH_FILE with value false." + assert_output_contains "Found variable VORTEX_TEST_SSH_FILE with value false." popd >/dev/null } @@ -36,14 +36,14 @@ load _helper.bash pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 setup_ssh_key_fixture - export DREVOPS_SSH_PREFIX="TEST" + export VORTEX_SSH_PREFIX="TEST" local file=${HOME}/.ssh/id_rsa - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_failure - assert_output_contains "Did not find fingerprint variable DREVOPS_TEST_SSH_FINGERPRINT." - assert_output_contains "Did not find a variable DREVOPS_test_SSH_FILE. Using default value ${file}." + assert_output_contains "Did not find fingerprint variable VORTEX_TEST_SSH_FINGERPRINT." + assert_output_contains "Did not find a variable VORTEX_test_SSH_FILE. Using default value ${file}." assert_output_contains "SSH key file ${file} does not exist." popd >/dev/null @@ -54,18 +54,18 @@ load _helper.bash setup_ssh_key_fixture provision_default_ssh_key - export DREVOPS_SSH_PREFIX="TEST" + export VORTEX_SSH_PREFIX="TEST" local file=${HOME}/.ssh/id_rsa declare -a STEPS=( - "Did not find fingerprint variable DREVOPS_TEST_SSH_FINGERPRINT." - "Did not find a variable DREVOPS_TEST_SSH_FILE. Using default value ${file}." + "Did not find fingerprint variable VORTEX_TEST_SSH_FINGERPRINT." + "Did not find a variable VORTEX_TEST_SSH_FILE. Using default value ${file}." "@ssh-add -l # ${file}" "SSH agent has ${file} key loaded." ) mocks="$(run_steps "setup")" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_success run_steps "assert" "${mocks[@]}" @@ -77,18 +77,18 @@ load _helper.bash setup_ssh_key_fixture local suffix="TEST" provision_ssh_key_with_suffix ${suffix} - export DREVOPS_SSH_PREFIX="KEY_IDENTIFIER" - export DREVOPS_KEY_IDENTIFIER_SSH_FILE="${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" + export VORTEX_SSH_PREFIX="KEY_IDENTIFIER" + export VORTEX_KEY_IDENTIFIER_SSH_FILE="${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" declare -a STEPS=( "Started SSH setup" - "Found variable DREVOPS_KEY_IDENTIFIER_SSH_FILE with value ${DREVOPS_KEY_IDENTIFIER_SSH_FILE}." - "Using SSH key file ${DREVOPS_KEY_IDENTIFIER_SSH_FILE}." - "@ssh-add -l # ${DREVOPS_KEY_IDENTIFIER_SSH_FILE}" - "SSH agent has ${DREVOPS_KEY_IDENTIFIER_SSH_FILE} key loaded." + "Found variable VORTEX_KEY_IDENTIFIER_SSH_FILE with value ${VORTEX_KEY_IDENTIFIER_SSH_FILE}." + "Using SSH key file ${VORTEX_KEY_IDENTIFIER_SSH_FILE}." + "@ssh-add -l # ${VORTEX_KEY_IDENTIFIER_SSH_FILE}" + "SSH agent has ${VORTEX_KEY_IDENTIFIER_SSH_FILE} key loaded." "Finished SSH setup" ) mocks="$(run_steps "setup")" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_success run_steps "assert" "${mocks[@]}" @@ -99,14 +99,14 @@ load _helper.bash pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 setup_ssh_key_fixture - export DREVOPS_SSH_PREFIX="TEST" - export DREVOPS_TEST_SSH_FINGERPRINT="DOES_NOT_EXIST" + export VORTEX_SSH_PREFIX="TEST" + export VORTEX_TEST_SSH_FINGERPRINT="DOES_NOT_EXIST" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_failure - assert_output_contains "Found fingerprint variable DREVOPS_TEST_SSH_FINGERPRINT with value ${DREVOPS_TEST_SSH_FINGERPRINT}." + assert_output_contains "Found fingerprint variable VORTEX_TEST_SSH_FINGERPRINT with value ${VORTEX_TEST_SSH_FINGERPRINT}." assert_output_contains "Using fingerprint-based deploy key because fingerprint was provided." - assert_output_contains "SSH key file ${HOME}/.ssh/id_rsa_${DREVOPS_TEST_SSH_FINGERPRINT} does not exist." + assert_output_contains "SSH key file ${HOME}/.ssh/id_rsa_${VORTEX_TEST_SSH_FINGERPRINT} does not exist." popd >/dev/null } @@ -116,13 +116,13 @@ load _helper.bash setup_ssh_key_fixture # Assert using fingerprint with ssh key - export DREVOPS_TEST_SSH_FINGERPRINT="TEST" - provision_ssh_key_with_suffix ${DREVOPS_TEST_SSH_FINGERPRINT} - export DREVOPS_SSH_PREFIX="TEST" - local file="${SSH_KEY_FIXTURE_DIR}/id_rsa_${DREVOPS_TEST_SSH_FINGERPRINT}" + export VORTEX_TEST_SSH_FINGERPRINT="TEST" + provision_ssh_key_with_suffix ${VORTEX_TEST_SSH_FINGERPRINT} + export VORTEX_SSH_PREFIX="TEST" + local file="${SSH_KEY_FIXTURE_DIR}/id_rsa_${VORTEX_TEST_SSH_FINGERPRINT}" declare -a STEPS=( - "Found fingerprint variable DREVOPS_TEST_SSH_FINGERPRINT with value ${DREVOPS_TEST_SSH_FINGERPRINT}." + "Found fingerprint variable VORTEX_TEST_SSH_FINGERPRINT with value ${VORTEX_TEST_SSH_FINGERPRINT}." "Using fingerprint-based deploy key because fingerprint was provided." "Using SSH key file ${file}." "@ssh-add -l # ${file}" @@ -130,7 +130,7 @@ load _helper.bash ) mocks="$(run_steps "setup")" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_success run_steps "assert" "${mocks[@]}" @@ -143,14 +143,14 @@ load _helper.bash setup_ssh_key_fixture # Assert does not have key loaded - export DREVOPS_SSH_PREFIX="IDENTIFIER" - export DREVOPS_IDENTIFIER_SSH_FINGERPRINT="TEST" - provision_ssh_key_with_suffix ${DREVOPS_IDENTIFIER_SSH_FINGERPRINT} + export VORTEX_SSH_PREFIX="IDENTIFIER" + export VORTEX_IDENTIFIER_SSH_FINGERPRINT="TEST" + provision_ssh_key_with_suffix ${VORTEX_IDENTIFIER_SSH_FINGERPRINT} export CI="1" - local file="${SSH_KEY_FIXTURE_DIR}/id_rsa_${DREVOPS_IDENTIFIER_SSH_FINGERPRINT}" + local file="${SSH_KEY_FIXTURE_DIR}/id_rsa_${VORTEX_IDENTIFIER_SSH_FINGERPRINT}" declare -a STEPS=( - "Found fingerprint variable DREVOPS_${DREVOPS_SSH_PREFIX}_SSH_FINGERPRINT with value ${DREVOPS_IDENTIFIER_SSH_FINGERPRINT}." + "Found fingerprint variable VORTEX_${VORTEX_SSH_PREFIX}_SSH_FINGERPRINT with value ${VORTEX_IDENTIFIER_SSH_FINGERPRINT}." "Using fingerprint-based deploy key because fingerprint was provided." "Using SSH key file ${file}." "@ssh-add -l # The agent has no identities." @@ -164,7 +164,7 @@ load _helper.bash ) mocks="$(run_steps "setup")" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_success run_steps "assert" "${mocks[@]}" @@ -177,23 +177,23 @@ load _helper.bash setup_ssh_key_fixture local suffix="TEST" provision_ssh_key_with_suffix ${suffix} - export DREVOPS_SSH_PREFIX="TEST" - export DREVOPS_TEST_SSH_FINGERPRINT="$(ssh-keygen -l -E md5 -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" | awk '{print $2}')" - export DREVOPS_TEST_SSH_FILE="${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" + export VORTEX_SSH_PREFIX="TEST" + export VORTEX_TEST_SSH_FINGERPRINT="$(ssh-keygen -l -E md5 -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" | awk '{print $2}')" + export VORTEX_TEST_SSH_FILE="${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" export CI="" - local ssh_key_file="${DREVOPS_TEST_SSH_FINGERPRINT//:/}" + local ssh_key_file="${VORTEX_TEST_SSH_FINGERPRINT//:/}" ssh_key_file="${HOME}/.ssh/id_rsa_${ssh_key_file//\"/}" declare -a STEPS=( - "Found fingerprint variable DREVOPS_TEST_SSH_FINGERPRINT with value ${DREVOPS_TEST_SSH_FINGERPRINT}." - "Found variable DREVOPS_TEST_SSH_FILE with value ${DREVOPS_TEST_SSH_FILE}." + "Found fingerprint variable VORTEX_TEST_SSH_FINGERPRINT with value ${VORTEX_TEST_SSH_FINGERPRINT}." + "Found variable VORTEX_TEST_SSH_FILE with value ${VORTEX_TEST_SSH_FILE}." "Using fingerprint-based deploy key because fingerprint was provided." "SSH key file ${ssh_key_file} does not exist." ) mocks="$(run_steps "setup")" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_failure run_steps "assert" "${mocks[@]}" @@ -206,8 +206,8 @@ load _helper.bash setup_ssh_key_fixture local suffix="TEST" provision_ssh_key_with_suffix ${suffix} - export DREVOPS_SSH_PREFIX="TEST" - export DREVOPS_TEST_SSH_FINGERPRINT="$(ssh-keygen -l -E sha256 -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" | awk '{print $2}')" + export VORTEX_SSH_PREFIX="TEST" + export VORTEX_TEST_SSH_FINGERPRINT="$(ssh-keygen -l -E sha256 -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" | awk '{print $2}')" export CI="" local md5_fingerprint="$(ssh-keygen -l -E md5 -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" | awk '{print $2}')" @@ -217,7 +217,7 @@ load _helper.bash local file="${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" declare -a STEPS=( - "Found fingerprint variable DREVOPS_TEST_SSH_FINGERPRINT with value ${DREVOPS_TEST_SSH_FINGERPRINT}." + "Found fingerprint variable VORTEX_TEST_SSH_FINGERPRINT with value ${VORTEX_TEST_SSH_FINGERPRINT}." "Using fingerprint-based deploy key because fingerprint was provided." "Searching for MD5 hash as fingerprint starts with SHA256." "Found matching existing key file ${file}." @@ -226,7 +226,7 @@ load _helper.bash ) mocks="$(run_steps "setup")" - run scripts/drevops/setup-ssh.sh + run scripts/vortex/setup-ssh.sh assert_failure run_steps "assert" "${mocks[@]}" diff --git a/.scaffold/tests/bats/update-scaffold.bats b/.vortex/tests/bats/update-vortex.bats similarity index 65% rename from .scaffold/tests/bats/update-scaffold.bats rename to .vortex/tests/bats/update-vortex.bats index 087b5f442..7b870e201 100644 --- a/.scaffold/tests/bats/update-scaffold.bats +++ b/.vortex/tests/bats/update-vortex.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats # -# Test for update Scaffold functionality. +# Test for update Vortex functionality. # # shellcheck disable=SC2030,SC2031,SC2129 @@ -9,7 +9,7 @@ load _helper.bash @test "Update" { # Add custom files touch "test1.txt" - # File resides in directory that is included in Scaffold when initialised. + # File resides in directory that is included in Vortex when initialised. mkdir -p ".docker" touch ".docker/test2.txt" @@ -25,32 +25,32 @@ load _helper.bash install_dependencies_stub - git_add_all_commit "Init Scaffold" + git_add_all_commit "Init Vortex" # Assert that custom file preserved. assert_file_exists "test1.txt" - # Assert that custom file in a directory used by Scaffold is preserved. + # Assert that custom file in a directory used by Vortex is preserved. assert_file_exists ".docker/test2.txt" # Assert no changes were introduced. assert_git_clean - # Releasing new version of Scaffold (note that installing from the local tag - # is not supported in .scaffold/installer/install; only commit is supported). + # Releasing new version of Vortex (note that installing from the local tag + # is not supported in .vortex/installer/install; only commit is supported). echo "# Some change to docker-compose.yml" >>"${LOCAL_REPO_DIR}/docker-compose.yml" git_add "docker-compose.yml" "${LOCAL_REPO_DIR}" echo "# Some change to non-required file" >>"${LOCAL_REPO_DIR}/web/themes/custom/your_site_theme/.eslintrc.json" git_add "web/themes/custom/your_site_theme/.eslintrc.json" "${LOCAL_REPO_DIR}" - latest_commit=$(git_commit "New version of Scaffold" "${LOCAL_REPO_DIR}") + latest_commit=$(git_commit "New version of Vortex" "${LOCAL_REPO_DIR}") - # Override Scaffold release commit in .env file. - echo DREVOPS_INSTALL_COMMIT="${latest_commit}" >>.env + # Override Vortex release commit in .env file. + echo VORTEX_INSTALL_COMMIT="${latest_commit}" >>.env # Enforce debugging of the install script. - export DREVOPS_INSTALL_DEBUG=1 - # Override install script with currently tested one to be called from ./scripts/drevops/update-scaffold.sh - export DREVOPS_INSTALLER_URL="file://${INSTALLER_CHECKOUT_DIR}/install.php" + export VORTEX_INSTALL_DEBUG=1 + # Override install script with currently tested one to be called from ./scripts/vortex/update-vortex.sh + export VORTEX_INSTALLER_URL="file://${INSTALLER_CHECKOUT_DIR}/install.php" # shellcheck disable=SC2059 - run ahoy update-scaffold + run ahoy update-vortex assert_success assert_files_present assert_git_repo diff --git a/.scaffold/tests/bats/workflow.install.bats b/.vortex/tests/bats/workflow.install.bats similarity index 90% rename from .scaffold/tests/bats/workflow.install.bats rename to .vortex/tests/bats/workflow.install.bats index b8b5d98f2..fb90fff47 100644 --- a/.scaffold/tests/bats/workflow.install.bats +++ b/.vortex/tests/bats/workflow.install.bats @@ -88,14 +88,14 @@ load _helper.workflow.bash @test "Workflow: profile-driven" { rm -f .data/db.sql - export DREVOPS_INSTALL_DEMO_SKIP=1 + export VORTEX_INSTALL_DEMO_SKIP=1 assert_file_not_exists .data/db.sql prepare_sut "Starting fresh install WORKFLOW tests in build directory ${BUILD_DIR}" - # Assert that the database was not downloaded because DREVOPS_INSTALL_DEMO_SKIP was set. + # Assert that the database was not downloaded because VORTEX_INSTALL_DEMO_SKIP was set. assert_file_not_exists .data/db.sql - echo "DREVOPS_PROVISION_USE_PROFILE=1" >>.env + echo "VORTEX_PROVISION_USE_PROFILE=1" >>.env assert_ahoy_build assert_gitignore diff --git a/.scaffold/tests/bats/workflow.smoke.bats b/.vortex/tests/bats/workflow.smoke.bats similarity index 88% rename from .scaffold/tests/bats/workflow.smoke.bats rename to .vortex/tests/bats/workflow.smoke.bats index 1dbe21070..c3f3ee089 100644 --- a/.scaffold/tests/bats/workflow.smoke.bats +++ b/.vortex/tests/bats/workflow.smoke.bats @@ -36,8 +36,8 @@ load _helper.workflow.bash composer config repositories.test-private-package vcs git@github.com:drevops/test-private-package.git jq --indent 4 '.require += {"drevops/test-private-package": "^1"}' composer.json >composer.json.tmp && mv -f composer.json.tmp composer.json - export DREVOPS_CONTAINER_REGISTRY_USER="${TEST_DREVOPS_CONTAINER_REGISTRY_USER?Test Docker user is not set}" - export DREVOPS_CONTAINER_REGISTRY_PASS="${TEST_DREVOPS_CONTAINER_REGISTRY_PASS?Test Docker pass is not set}" + export VORTEX_CONTAINER_REGISTRY_USER="${TEST_VORTEX_CONTAINER_REGISTRY_USER?Test Docker user is not set}" + export VORTEX_CONTAINER_REGISTRY_PASS="${TEST_VORTEX_CONTAINER_REGISTRY_PASS?Test Docker pass is not set}" step "Build without a GITHUB_TOKEN token" unset GITHUB_TOKEN @@ -78,7 +78,7 @@ load _helper.workflow.bash fi fi - docker compose exec -T cli ./scripts/drevops/provision.sh >&3 + docker compose exec -T cli ./scripts/vortex/provision.sh >&3 sync_to_host assert_gitignore diff --git a/.scaffold/tests/bats/workflow.storage.curl.bats b/.vortex/tests/bats/workflow.storage.curl.bats similarity index 84% rename from .scaffold/tests/bats/workflow.storage.curl.bats rename to .vortex/tests/bats/workflow.storage.curl.bats index a16a997fe..fe8433aa8 100644 --- a/.scaffold/tests/bats/workflow.storage.curl.bats +++ b/.vortex/tests/bats/workflow.storage.curl.bats @@ -19,7 +19,7 @@ load _helper.workflow.bash @test "Workflow: download from curl, storage in container image" { # Force storage in DB dump - the purpose of this test. - export DREVOPS_DB_DOWNLOAD_SOURCE=curl + export VORTEX_DB_DOWNLOAD_SOURCE=curl # While the DB will be loaded from the file, the DB image must exist # so that Docker Compose could start a container, so the image should be @@ -27,31 +27,31 @@ load _helper.workflow.bash # @todo: build.sh may need to have a support to create a local image if # it does not exist. # Use a test image. Image always must use a tag. - export DREVOPS_DB_IMAGE="drevops/drevops-mariadb-drupal-data-test-10.x:latest" + export VORTEX_DB_IMAGE="drevops/drevops-mariadb-drupal-data-test-10.x:latest" # Explicitly specify that we do not want to login into the public registry # to use test image. - export DREVOPS_CONTAINER_REGISTRY_USER= - export DREVOPS_CONTAINER_REGISTRY_PASS= + export VORTEX_CONTAINER_REGISTRY_USER= + export VORTEX_CONTAINER_REGISTRY_PASS= # Mimic local behavior where DB is always overridden. - export DREVOPS_PROVISION_OVERRIDE_DB=1 + export VORTEX_PROVISION_OVERRIDE_DB=1 substep "Make sure that demo database will not be downloaded." rm -f .data/db.sql assert_file_not_exists .data/db.sql substep "Remove any existing images to download the fresh one." - docker_remove_image "${DREVOPS_DB_IMAGE}" + docker_remove_image "${VORTEX_DB_IMAGE}" prepare_sut "Starting download from curl, storage in container image cached WORKFLOW tests in build directory ${BUILD_DIR}" assert_file_exists .data/db.sql - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE=curl" - assert_file_contains ".env" "DREVOPS_DB_IMAGE=${DREVOPS_DB_IMAGE}" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE=curl" + assert_file_contains ".env" "VORTEX_DB_IMAGE=${VORTEX_DB_IMAGE}" # Assert that demo config was removed as a part of the installation. - assert_file_not_contains ".env" "DREVOPS_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=" + assert_file_not_contains ".env" "VORTEX_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=" assert_ahoy_build diff --git a/.scaffold/tests/bats/workflow.storage.image.bats b/.vortex/tests/bats/workflow.storage.image.bats similarity index 75% rename from .scaffold/tests/bats/workflow.storage.image.bats rename to .vortex/tests/bats/workflow.storage.image.bats index b91a0962e..e372450a3 100644 --- a/.scaffold/tests/bats/workflow.storage.image.bats +++ b/.vortex/tests/bats/workflow.storage.image.bats @@ -20,38 +20,38 @@ load _helper.workflow.bash # Due to test speed efficiency, all workflow assertions ran within a single test. @test "Workflow: download from image, storage in container image" { # Force storage in container image - the purpose of this test. - export DREVOPS_DB_DOWNLOAD_SOURCE=container_registry + export VORTEX_DB_DOWNLOAD_SOURCE=container_registry # Use a test image. Image always must use a tag. - export DREVOPS_DB_IMAGE="drevops/drevops-mariadb-drupal-data-test-10.x:latest" + export VORTEX_DB_IMAGE="drevops/drevops-mariadb-drupal-data-test-10.x:latest" # Do not use demo database - testing demo database discovery is another test. - export DREVOPS_INSTALL_DEMO_SKIP=1 + export VORTEX_INSTALL_DEMO_SKIP=1 # Explicitly specify that we do not want to login into the public registry # to use test image. - export DREVOPS_CONTAINER_REGISTRY_USER= - export DREVOPS_CONTAINER_REGISTRY_PASS= + export VORTEX_CONTAINER_REGISTRY_USER= + export VORTEX_CONTAINER_REGISTRY_PASS= substep "Make sure that demo database will not be used." rm -f .data/db.sql assert_file_not_exists .data/db.sql substep "Remove any existing images to download the fresh one." - docker_remove_image "${DREVOPS_DB_IMAGE}" + docker_remove_image "${VORTEX_DB_IMAGE}" prepare_sut "Starting download from image, storage in container image WORKFLOW tests in build directory ${BUILD_DIR}" - # Assert that the database was not downloaded because DREVOPS_INSTALL_DEMO_SKIP was set. + # Assert that the database was not downloaded because VORTEX_INSTALL_DEMO_SKIP was set. assert_file_not_exists .data/db.sql # Remove .env.local added by the installer script. rm .env.local >/dev/null - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE=container_registry" - assert_file_contains ".env" "DREVOPS_DB_IMAGE=${DREVOPS_DB_IMAGE}" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE=container_registry" + assert_file_contains ".env" "VORTEX_DB_IMAGE=${VORTEX_DB_IMAGE}" # Assert that demo config was removed as a part of the installation. - assert_file_not_contains ".env" "DREVOPS_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=" + assert_file_not_contains ".env" "VORTEX_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=" assert_ahoy_build @@ -71,7 +71,7 @@ load _helper.workflow.bash # Other stack assertions - these run only for this container image-related test. assert_gitignore - assert_ahoy_info "web" "${DREVOPS_DB_IMAGE}" + assert_ahoy_info "web" "${VORTEX_DB_IMAGE}" assert_ahoy_container_logs diff --git a/.scaffold/tests/bats/workflow.storage.image_cached.bats b/.vortex/tests/bats/workflow.storage.image_cached.bats similarity index 76% rename from .scaffold/tests/bats/workflow.storage.image_cached.bats rename to .vortex/tests/bats/workflow.storage.image_cached.bats index d6080e43c..3a8771e5c 100644 --- a/.scaffold/tests/bats/workflow.storage.image_cached.bats +++ b/.vortex/tests/bats/workflow.storage.image_cached.bats @@ -22,43 +22,43 @@ load _helper.workflow.bash # as different versions of Docker may produce different messages. # Force storage in container image - the purpose of this test. - export DREVOPS_DB_DOWNLOAD_SOURCE=container_registry + export VORTEX_DB_DOWNLOAD_SOURCE=container_registry # Use a test image. Image always must use a tag. - export DREVOPS_DB_IMAGE="drevops/drevops-mariadb-drupal-data-test-10.x:latest" + export VORTEX_DB_IMAGE="drevops/drevops-mariadb-drupal-data-test-10.x:latest" # Do not use demo database - testing demo database discovery is another test. - export DREVOPS_INSTALL_DEMO_SKIP=1 + export VORTEX_INSTALL_DEMO_SKIP=1 # Explicitly specify that we do not want to login into the public registry # to use test image. - export DREVOPS_CONTAINER_REGISTRY_USER= - export DREVOPS_CONTAINER_REGISTRY_PASS= + export VORTEX_CONTAINER_REGISTRY_USER= + export VORTEX_CONTAINER_REGISTRY_PASS= substep "Make sure that demo database will not be downloaded." rm -f .data/db.sql assert_file_not_exists .data/db.sql substep "Remove any existing images to download the fresh one." - docker_remove_image "${DREVOPS_DB_IMAGE}" + docker_remove_image "${VORTEX_DB_IMAGE}" prepare_sut "Starting download from image, storage in container image, use cached image WORKFLOW tests in build directory ${BUILD_DIR}" - # Assert that the database was not downloaded because DREVOPS_INSTALL_DEMO_SKIP was set. + # Assert that the database was not downloaded because VORTEX_INSTALL_DEMO_SKIP was set. assert_file_not_exists .data/db.sql # Remove .env.local added by the installer script. rm .env.local >/dev/null - assert_file_contains ".env" "DREVOPS_DB_DOWNLOAD_SOURCE=container_registry" - assert_file_contains ".env" "DREVOPS_DB_IMAGE=${DREVOPS_DB_IMAGE}" + assert_file_contains ".env" "VORTEX_DB_DOWNLOAD_SOURCE=container_registry" + assert_file_contains ".env" "VORTEX_DB_IMAGE=${VORTEX_DB_IMAGE}" # Assert that demo config was removed as a part of the installation. - assert_file_not_contains ".env" "DREVOPS_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" - assert_file_not_contains ".env" "DREVOPS_DB_DOWNLOAD_CURL_URL=" + assert_file_not_contains ".env" "VORTEX_DB_IMAGE=drevops/drevops-mariadb-drupal-data-demo-10.x:latest" + assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_CURL_URL=" step "Initial build to use data image." assert_ahoy_build - assert_output_contains "Using database data image ${DREVOPS_DB_IMAGE}" - assert_output_contains "Not found ${DREVOPS_DB_IMAGE}" + assert_output_contains "Using database data image ${VORTEX_DB_IMAGE}" + assert_output_contains "Not found ${VORTEX_DB_IMAGE}" assert_output_contains "Not found archived database container image file ./.data/db.tar." assert_output_contains "Finished building project" @@ -82,7 +82,7 @@ load _helper.workflow.bash run ahoy export-db "db.tar" assert_success assert_output_contains "Found mariadb service container with id" - assert_output_contains "Committing exported container image with name docker.io/${DREVOPS_DB_IMAGE}" + assert_output_contains "Committing exported container image with name docker.io/${VORTEX_DB_IMAGE}" assert_output_contains "Committed exported container image with id" assert_output_contains "Exporting database image archive to file ./.data/db.tar." assert_output_contains "Saved exported database image archive file ./.data/db.tar." @@ -90,18 +90,18 @@ load _helper.workflow.bash substep "Remove existing image and assert that exported DB image file still exists." ahoy clean - docker_remove_image "${DREVOPS_DB_IMAGE}" + docker_remove_image "${VORTEX_DB_IMAGE}" assert_file_exists .data/db.tar step "Re-run build to use previously exported DB image from file." assert_ahoy_build assert_output_contains "Started database data container image download." - assert_output_contains "Using data image ${DREVOPS_DB_IMAGE}" - assert_output_contains "Not found ${DREVOPS_DB_IMAGE} on host" + assert_output_contains "Using data image ${VORTEX_DB_IMAGE}" + assert_output_contains "Not found ${VORTEX_DB_IMAGE} on host" assert_output_contains "Found archived database container image file ./.data/db.tar. Expanding" - assert_output_contains "Loaded image: ${DREVOPS_DB_IMAGE}" - assert_output_contains "Found expanded ${DREVOPS_DB_IMAGE}" + assert_output_contains "Loaded image: ${VORTEX_DB_IMAGE}" + assert_output_contains "Found expanded ${VORTEX_DB_IMAGE}" assert_output_contains "Finished database data container image download." assert_output_contains "Finished building project" diff --git a/.scaffold/tests/bats/workflow.utilities.bats b/.vortex/tests/bats/workflow.utilities.bats similarity index 100% rename from .scaffold/tests/bats/workflow.utilities.bats rename to .vortex/tests/bats/workflow.utilities.bats diff --git a/.scaffold/tests/composer.json b/.vortex/tests/composer.json similarity index 77% rename from .scaffold/tests/composer.json rename to .vortex/tests/composer.json index 23bcc02cd..6b803fa95 100644 --- a/.scaffold/tests/composer.json +++ b/.vortex/tests/composer.json @@ -1,6 +1,6 @@ { - "name": "drevops/scaffold-tests", - "description": "Tests for Scaffold", + "name": "drevops/vortex-tests", + "description": "Tests for Vortex", "type": "project", "authors": [ { diff --git a/.scaffold/tests/composer.lock b/.vortex/tests/composer.lock similarity index 100% rename from .scaffold/tests/composer.lock rename to .vortex/tests/composer.lock diff --git a/.scaffold/tests/lint.dockerfiles.sh b/.vortex/tests/lint.dockerfiles.sh similarity index 66% rename from .scaffold/tests/lint.dockerfiles.sh rename to .vortex/tests/lint.dockerfiles.sh index 4f09fe179..4f8e2e6fe 100755 --- a/.scaffold/tests/lint.dockerfiles.sh +++ b/.vortex/tests/lint.dockerfiles.sh @@ -1,15 +1,15 @@ #!/usr/bin/env bash ## -# Lint Scaffold Dockerfiles. +# Lint Vortex Dockerfiles. # # LCOV_EXCL_START set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" -[ ! -f "${ROOT_DIR}/.scaffold/tests/vendor/bin/shellvar" ] && composer --working-dir="${ROOT_DIR}/.scaffold/tests" install +[ ! -f "${ROOT_DIR}/.vortex/tests/vendor/bin/shellvar" ] && composer --working-dir="${ROOT_DIR}/.vortex/tests" install targets=() while IFS= read -r -d $'\0'; do @@ -23,11 +23,11 @@ done < <( -print0 ) -echo "==> Linting Scaffold Dockerfiles in ${ROOT_DIR}." +echo "==> Linting Vortex Dockerfiles in ${ROOT_DIR}." for file in "${targets[@]}"; do # Temp script until shfmt implement the support for formatting variables. # @see https://github.com/mvdan/sh/issues/1029 - if ! "${ROOT_DIR}/.scaffold/tests/vendor/bin/shellvar" lint "${file}"; then + if ! "${ROOT_DIR}/.vortex/tests/vendor/bin/shellvar" lint "${file}"; then exit 1 fi diff --git a/.scaffold/tests/lint.scripts.sh b/.vortex/tests/lint.scripts.sh similarity index 73% rename from .scaffold/tests/lint.scripts.sh rename to .vortex/tests/lint.scripts.sh index 02ea4a40a..94658f126 100755 --- a/.scaffold/tests/lint.scripts.sh +++ b/.vortex/tests/lint.scripts.sh @@ -1,15 +1,15 @@ #!/usr/bin/env bash ## -# Lint Scaffold scripts. +# Lint Vortex scripts. # # LCOV_EXCL_START set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" -[ ! -f "${ROOT_DIR}/.scaffold/tests/vendor/bin/shellvar" ] && composer --working-dir="${ROOT_DIR}/.scaffold/tests" install +[ ! -f "${ROOT_DIR}/.vortex/tests/vendor/bin/shellvar" ] && composer --working-dir="${ROOT_DIR}/.vortex/tests" install targets=() while IFS= read -r -d $'\0'; do @@ -19,20 +19,20 @@ done < <( "${ROOT_DIR}"/scripts \ "${ROOT_DIR}"/.circleci \ "${ROOT_DIR}"/hooks/library \ - "${ROOT_DIR}"/.scaffold/docs \ + "${ROOT_DIR}"/.vortex/docs \ -type f \ \( -name "*.sh" -or -name "*.bash" -or -name "*.bats" \) \ -not -path "*vendor*" -not -path "*node_modules*" -not -path "*fixtures*" \ -print0 ) -echo "==> Linting Scaffold scripts and tests in ${ROOT_DIR}." +echo "==> Linting Vortex scripts and tests in ${ROOT_DIR}." for file in "${targets[@]}"; do if [ -f "${file}" ]; then echo "Checking file ${file}" - if ! "${ROOT_DIR}/.scaffold/tests/vendor/bin/shellvar" lint "${file}"; then + if ! "${ROOT_DIR}/.vortex/tests/vendor/bin/shellvar" lint "${file}"; then # Skip the file with a false positive. # @see https://github.com/AlexSkrypnyk/shellvar/issues/65 if [[ ! "${file}" =~ github-labels ]]; then diff --git a/.scaffold/tests/package-lock.json b/.vortex/tests/package-lock.json similarity index 96% rename from .scaffold/tests/package-lock.json rename to .vortex/tests/package-lock.json index 8f7a73854..e800615f9 100644 --- a/.scaffold/tests/package-lock.json +++ b/.vortex/tests/package-lock.json @@ -1,11 +1,11 @@ { - "name": "scaffold-tests", + "name": "vortex-tests", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "scaffold-tests", + "name": "vortex-tests", "version": "1.0.0", "license": "GPL-2.0-or-later", "devDependencies": { diff --git a/.scaffold/tests/package.json b/.vortex/tests/package.json similarity index 62% rename from .scaffold/tests/package.json rename to .vortex/tests/package.json index 6cf650132..59ff04c47 100644 --- a/.scaffold/tests/package.json +++ b/.vortex/tests/package.json @@ -1,7 +1,7 @@ { - "name": "scaffold-tests", + "name": "vortex-tests", "version": "1.0.0", - "description": "Packages used for testing of Scaffold", + "description": "Packages used for testing of Vortex", "license": "GPL-2.0-or-later", "devDependencies": { "bats-helpers": "npm:@drevops/bats-helpers@^1.3.1" diff --git a/.scaffold/tests/test.common.sh b/.vortex/tests/test.common.sh similarity index 89% rename from .scaffold/tests/test.common.sh rename to .vortex/tests/test.common.sh index 47ffbc10b..f5c954c40 100755 --- a/.scaffold/tests/test.common.sh +++ b/.vortex/tests/test.common.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash ## -# Run Scaffold tests in CI. +# Run Vortex tests in CI. # # LCOV_EXCL_START set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" -SCRIPTS_DIR="${ROOT_DIR}/scripts/drevops" +SCRIPTS_DIR="${ROOT_DIR}/scripts/vortex" -TEST_DIR="${ROOT_DIR}/.scaffold/tests" +TEST_DIR="${ROOT_DIR}/.vortex/tests" # ------------------------------------------------------------------------------ @@ -47,4 +47,4 @@ bats "${TEST_DIR}/bats/install.parameters.bats" bats "${TEST_DIR}/bats/install.integrations.bats" bats "${TEST_DIR}/bats/install.demo.bats" bats "${TEST_DIR}/bats/reset.bats" -bats "${TEST_DIR}/bats/update-scaffold.bats" +bats "${TEST_DIR}/bats/update-vortex.bats" diff --git a/.scaffold/tests/test.deployment.sh b/.vortex/tests/test.deployment.sh similarity index 89% rename from .scaffold/tests/test.deployment.sh rename to .vortex/tests/test.deployment.sh index a4778eee5..1a63429a8 100755 --- a/.scaffold/tests/test.deployment.sh +++ b/.vortex/tests/test.deployment.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash ## -# Run Scaffold deployment tests. +# Run Vortex deployment tests. # # LCOV_EXCL_START set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" -SCRIPTS_DIR="${ROOT_DIR}/scripts/drevops" +SCRIPTS_DIR="${ROOT_DIR}/scripts/vortex" -TEST_DIR="${ROOT_DIR}/.scaffold/tests" +TEST_DIR="${ROOT_DIR}/.vortex/tests" # ------------------------------------------------------------------------------ diff --git a/.scaffold/tests/test.postbuild.sh b/.vortex/tests/test.postbuild.sh similarity index 83% rename from .scaffold/tests/test.postbuild.sh rename to .vortex/tests/test.postbuild.sh index 62ae8cea4..465d60010 100755 --- a/.scaffold/tests/test.postbuild.sh +++ b/.vortex/tests/test.postbuild.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash ## -# Run Scaffold CI post-build tests. +# Run Vortex CI post-build tests. # # LCOV_EXCL_START set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" -SCRIPTS_DIR="${ROOT_DIR}/scripts/drevops" +SCRIPTS_DIR="${ROOT_DIR}/scripts/vortex" -TEST_DIR="${ROOT_DIR}/.scaffold/tests" +TEST_DIR="${ROOT_DIR}/.vortex/tests" # ------------------------------------------------------------------------------ diff --git a/.scaffold/tests/test.workflow.sh b/.vortex/tests/test.workflow.sh similarity index 93% rename from .scaffold/tests/test.workflow.sh rename to .vortex/tests/test.workflow.sh index d60c9872f..135f328fd 100755 --- a/.scaffold/tests/test.workflow.sh +++ b/.vortex/tests/test.workflow.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash ## -# Run Scaffold workflow tests. +# Run Vortex workflow tests. # # LCOV_EXCL_START set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" -SCRIPTS_DIR="${ROOT_DIR}/scripts/drevops" +SCRIPTS_DIR="${ROOT_DIR}/scripts/vortex" -TEST_DIR="${ROOT_DIR}/.scaffold/tests" +TEST_DIR="${ROOT_DIR}/.vortex/tests" # ------------------------------------------------------------------------------ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0fc327f9c..36a7bfa85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,13 @@ # Contributing -DrevOps Scaffold is an open source project. There are numerous ways to -contribute to DrevOps Scaffold whether you’re a developer or a non-technical +DrevOps Vortex is an open source project. There are numerous ways to +contribute to DrevOps Vortex whether you’re a developer or a non-technical user. ## What forms of contribution are we looking for? -Any form of contribution to DrevOps Scaffold, be it rectifying a bug, proposing +Any form of contribution to DrevOps Vortex, be it rectifying a bug, proposing a new feature, or enhancing our documentation, is highly appreciated. We are glad for your willingness to assist! @@ -22,7 +22,7 @@ already been reported in the [issue queue](https://github.com/drevops/scaffold/i Fantastic! Please [submit your idea](https://github.com/drevops/scaffold/issues) and we'll gladly review it. While we can't promise every suggestion will be implemented, we are always keen to hear innovative ideas for enhancing -the DrevOps Scaffold. +the DrevOps Vortex. ## Talk to us on Slack @@ -34,4 +34,4 @@ Join today! ## Roadmap -We actively maintain the project's roadmap. See [Roadmap](https://github.com/drevops/scaffold/blob/develop/.scaffold/docs/content/contributing/roadmap.mdx) for more details. +We actively maintain the project's roadmap. See [Roadmap](https://github.com/drevops/scaffold/blob/develop/.vortex/docs/content/contributing/roadmap.mdx) for more details. diff --git a/README.dist.md b/README.dist.md index 9e4284761..a539d0128 100644 --- a/README.dist.md +++ b/README.dist.md @@ -13,7 +13,7 @@ Drupal 10 implementation of YOURSITE for YOURORG [//]: # (DO NOT REMOVE THE BADGE BELOW. IT IS USED BY DREVOPS TO TRACK INTEGRATION) -[![DrevOps](https://img.shields.io/badge/DrevOps-DREVOPS_VERSION_URLENCODED-blue.svg)](https://github.com/drevops/scaffold/tree/DREVOPS_VERSION) +[![DrevOps](https://img.shields.io/badge/DrevOps-VORTEX_VERSION_URLENCODED-blue.svg)](https://github.com/drevops/scaffold/tree/VORTEX_VERSION) ## Onboarding to DrevOps Use [Onboarding checklist](docs/onboarding.md) to track the project onboarding @@ -34,7 +34,7 @@ to DrevOps progress. Remove this section once onboarding is finished. 1. Create your Acquia Cloud API token:
Acquia Cloud UI -> Account -> API tokens -> Create Token 2. Copy `.env.local.default` to `.env.local`. - 3. Populate `$DREVOPS_ACQUIA_KEY` and `$DREVOPS_ACQUIA_SECRET` environment + 3. Populate `$VORTEX_ACQUIA_KEY` and `$VORTEX_ACQUIA_SECRET` environment variables in `.env.local` file with values generated in the step above. [//]: # (#;> ACQUIA) @@ -44,7 +44,7 @@ to DrevOps progress. Remove this section once onboarding is finished. - Authenticate with Lagoon 1. Create an SSH key and add it to your account in the [Lagoon Dashboard](https://ui-lagoon-master.ch.amazee.io/). 2. Copy `.env.local.default` to `.env.local`. - 3. Update `$DREVOPS_DB_DOWNLOAD_SSH_FILE` environment variable in `.env.local` file + 3. Update `$VORTEX_DB_DOWNLOAD_SSH_FILE` environment variable in `.env.local` file with the path to the SSH key. [//]: # (#;> LAGOON) @@ -67,4 +67,4 @@ to DrevOps progress. Remove this section once onboarding is finished. - [Deployment](docs/deployment.md) --- -_This repository was created using the [DrevOps Scaffold](https://github.com/drevops/scaffold) project template_ +_This repository was created using the [DrevOps Vortex](https://github.com/drevops/scaffold) project template_ diff --git a/README.md b/README.md index 4f9ebbb3d..5384d2384 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@
- - Scaffold Logo + + Vortex Logo

- Scaffold
Drupal project template + Vortex
Drupal project template

-[![Test](https://github.com/drevops/scaffold/actions/workflows/scaffold-test-common.yml/badge.svg)](https://github.com/drevops/scaffold/actions/workflows/scaffold-test-common.yml) -[![Test docs](https://github.com/drevops/scaffold/actions/workflows/scaffold-test-docs.yml/badge.svg)](https://github.com/drevops/scaffold/actions/workflows/scaffold-test-docs.yml) +[![Test](https://github.com/drevops/scaffold/actions/workflows/vortex-test-common.yml/badge.svg)](https://github.com/drevops/scaffold/actions/workflows/vortex-test-common.yml) +[![Test docs](https://github.com/drevops/scaffold/actions/workflows/vortex-test-docs.yml/badge.svg)](https://github.com/drevops/scaffold/actions/workflows/vortex-test-docs.yml) [![CircleCI](https://circleci.com/gh/drevops/scaffold.svg?style=shield)](https://circleci.com/gh/drevops/scaffold) [![codecov](https://codecov.io/gh/drevops/scaffold/graph/badge.svg?token=YDTAEWWT5H)](https://codecov.io/gh/drevops/scaffold) ![GitHub release](https://img.shields.io/github/v/release/drevops/scaffold?logo=github) @@ -20,7 +20,7 @@
-Welcome to Scaffold — a project template for Drupal designed to simplify onboarding and website maintenance. +Welcome to Vortex — a project template for Drupal designed to simplify onboarding and website maintenance. At [DrevOps®](https://www.drevops.com/), we carefully maintain this template, keeping it aligned with the latest tools and validating it through @@ -52,8 +52,8 @@ for more details.
- - DrevOps diagram + + DrevOps diagram
@@ -119,12 +119,12 @@ The following list includes ✅ completed and 🚧 upcoming features. * 📖 Documentation * ✅ Your project [README.md](README.dist.md) * ✅ Your [project documentation](docs) - * ✅ [Scaffold documentation](https://docs.drevops.com/) + * ✅ [Vortex documentation](https://docs.drevops.com/) * 🧪 DrevOps * ✅ Unit test coverage for scripts * ✅ Functional test coverage for workflows * ✅ Integration test coverage for deployments - * ✅ Scaffold updates + * ✅ Vortex updates * ✅ [Basic installer](https://install.drevops.com/) * 🚧 Advanced installer CLI UI * 🚧 Advances installer Web UI @@ -133,15 +133,15 @@ The following list includes ✅ completed and 🚧 upcoming features. ## Documentation -The documentation is authored within this repository in the `.scaffold/docs` directory. +The documentation is authored within this repository in the `.vortex/docs` directory. -It is published to [https://docs.drevops.com](https://docs.drevops.com) on Scaffold release. +It is published to [https://docs.drevops.com](https://docs.drevops.com) on Vortex release. -Development version of the documentation is available at [https://drevops-scaffold-docs.netlify.app/](https://drevops-scaffold-docs.netlify.app/). +Development version of the documentation is available at [https://drevops-vortex-docs.netlify.app/](https://drevops-vortex-docs.netlify.app/). ## Support -We provide paid support for **Scaffold**: +We provide paid support for **Vortex**: - New and existing project onboarding - Support plans with SLAs diff --git a/docker-compose.yml b/docker-compose.yml index 1def614d1..17f4d2f6b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,9 +8,9 @@ # - Use inline comments starting with '##' to have the line being automatically # uncommented in CI. #; - Comments starting with '#;', '#;<' or '#;>' (like the ones used for the -#; current paragraph) are explaining Scaffold inner workings and can be +#; current paragraph) are explaining Vortex inner workings and can be #; safely removed for your project. They are automatically removed when -#; installing or updating Scaffold. +#; installing or updating Vortex. #; # See more about Docker at https://docs.drevops.com/docker/ # For YAML support of anchors and references, see http://blog.daemonl.com/2016/02/yaml.html @@ -41,9 +41,9 @@ x-user: &default-user # Note that these variables are not read from here in Lagoon environment. #;> LAGOON x-environment: &default-environment - TZ: ${DREVOPS_TZ:-Australia/Melbourne} + TZ: ${VORTEX_TZ:-Australia/Melbourne} # Local development URL. - DREVOPS_LOCALDEV_URL: &default-url ${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io + VORTEX_LOCALDEV_URL: &default-url ${COMPOSE_PROJECT_NAME:-example-site}.docker.amazee.io # Local development route used in Lagoon images and Pygmy to route requests. LAGOON_ROUTE: *default-url # Local database host (not used in production). @@ -85,7 +85,7 @@ services: context: . dockerfile: .docker/cli.dockerfile args: - WEBROOT: "${DREVOPS_WEBROOT:-web}" + WEBROOT: "${VORTEX_WEBROOT:-web}" GITHUB_TOKEN: "${GITHUB_TOKEN:-}" image: &cli-image ${COMPOSE_PROJECT_NAME:-example_site} @@ -109,7 +109,7 @@ services: dockerfile: .docker/nginx-drupal.dockerfile args: CLI_IMAGE: *cli-image - WEBROOT: "${DREVOPS_WEBROOT:-web}" + WEBROOT: "${VORTEX_WEBROOT:-web}" DRUPAL_CONFIG_PATH: ${DRUPAL_CONFIG_PATH:-/app/config/default} DRUPAL_PUBLIC_FILES: ${DRUPAL_PUBLIC_FILES:-/app/web/sites/default/files} DRUPAL_PRIVATE_FILES: ${DRUPAL_PRIVATE_FILES:-/app/web/sites/default/files/private} @@ -155,7 +155,7 @@ services: context: . dockerfile: .docker/mariadb.dockerfile args: - IMAGE: "${DREVOPS_DB_IMAGE:-uselagoon/mariadb-10.11-drupal:24.8.0}" # Use custom database image (if defined) or fallback to standard database image. + IMAGE: "${VORTEX_DB_IMAGE:-uselagoon/mariadb-10.11-drupal:24.8.0}" # Use custom database image (if defined) or fallback to standard database image. <<: *default-user environment: <<: *default-environment diff --git a/docs/deployment.md b/docs/deployment.md index 08e136039..bcca59c0a 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -109,7 +109,7 @@ To fresh the database in the existing Lagoon environment with the database from production environment, run: ``` -DREVOPS_DEPLOY_BRANCH= DREVOPS_DEPLOY_ACTION=deploy_override_db ahoy deploy +VORTEX_DEPLOY_BRANCH= VORTEX_DEPLOY_ACTION=deploy_override_db ahoy deploy ``` [//]: # (#;> LAGOON) diff --git a/docs/faqs.md b/docs/faqs.md index f5724b564..d5e1ecdf8 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -91,7 +91,7 @@ ahoy drush sql-cli < .data/db.sql But better: ```bash -DREVOPS_PROVISION_POST_OPERATIONS_SKIP=1 ahoy provision +VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 ahoy provision ``` ## How to add Drupal modules diff --git a/docs/onboarding.md b/docs/onboarding.md index d7cf4e52c..f01577030 100644 --- a/docs/onboarding.md +++ b/docs/onboarding.md @@ -2,7 +2,7 @@ Onboarding checklist ==================== Use this checklist to track the process of migration of the existing site -to Scaffold. This file is intended to be committed into repository until +to Vortex. This file is intended to be committed into repository until onboarding process is finished. Put a `x` into `[ ]` if this step was executed OR not required - this will @@ -30,16 +30,16 @@ indicate that it was addressed. ckeditor@4.3.2, https://www.ckeditor.com/archive/ckeditor_4.3.2.zip ``` -## 2. Adding Scaffold +## 2. Adding Vortex - [ ] Create a new GitHub repository, if required: - [ ] Commit generic `README.md` file and push to `master` branch. - [ ] Create new branch `ci`, copy all files from existing repository and push to remote. -- [ ] Add Scaffold configuration using installer script and follow +- [ ] Add Vortex configuration using installer script and follow instructions in `README.md` file added to your project. You will need to commit some files and push them to remote. Note: try to rely on the - default configuration provided by Scaffold as much as possible + default configuration provided by Vortex as much as possible (otherwise you are assuming maintenance responsibility for this custom code). - [ ] Using list of **modules** from "Assessing current site" step, update @@ -126,7 +126,7 @@ indicate that it was addressed. ## 5. Cleanup -- [ ] Cleanup code or set `DREVOPS_CI_LINT_ALLOW_FAILURE=1` in CircleCI to +- [ ] Cleanup code or set `VORTEX_CI_LINT_ALLOW_FAILURE=1` in CircleCI to bypass code linting fails: - [ ] Cleanup PHP code - [ ] Cleanup JS code diff --git a/hooks/library/copy-db.sh b/hooks/library/copy-db.sh index 078cd1e78..6f521f859 100755 --- a/hooks/library/copy-db.sh +++ b/hooks/library/copy-db.sh @@ -5,22 +5,22 @@ # Environment variables must be set in Acquia UI globally or for each environment. set -e -[ -n "${DREVOPS_DEBUG}" ] && set -x +[ -n "${VORTEX_DEBUG}" ] && set -x site="${1}" target_env="${2}" pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1 -[ "${DREVOPS_TASK_COPY_DB_ACQUIA_SKIP}" = "1" ] && echo "Skipping copying of database between Acquia environments." && exit 0 +[ "${VORTEX_TASK_COPY_DB_ACQUIA_SKIP}" = "1" ] && echo "Skipping copying of database between Acquia environments." && exit 0 -export DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY?not set}" -export DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET?not set}" -export DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-${site}}" -export DREVOPS_TASK_COPY_DB_ACQUIA_SRC="${DREVOPS_TASK_COPY_DB_ACQUIA_SRC:-prod}" -export DREVOPS_TASK_COPY_DB_ACQUIA_DST="${DREVOPS_TASK_COPY_DB_ACQUIA_DST:-${target_env}}" -export DREVOPS_TASK_COPY_DB_ACQUIA_NAME="${DREVOPS_TASK_COPY_DB_ACQUIA_NAME?not set}" +export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY?not set}" +export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET?not set}" +export VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${site}}" +export VORTEX_TASK_COPY_DB_ACQUIA_SRC="${VORTEX_TASK_COPY_DB_ACQUIA_SRC:-prod}" +export VORTEX_TASK_COPY_DB_ACQUIA_DST="${VORTEX_TASK_COPY_DB_ACQUIA_DST:-${target_env}}" +export VORTEX_TASK_COPY_DB_ACQUIA_NAME="${VORTEX_TASK_COPY_DB_ACQUIA_NAME?not set}" -./scripts/drevops/task-copy-db-acquia.sh +./scripts/vortex/task-copy-db-acquia.sh popd >/dev/null || exit 1 diff --git a/hooks/library/copy-files.sh b/hooks/library/copy-files.sh index a08f9afb9..b970e93d6 100755 --- a/hooks/library/copy-files.sh +++ b/hooks/library/copy-files.sh @@ -5,21 +5,21 @@ # Environment variables must be set in Acquia UI globally or for each environment. set -e -[ -n "${DREVOPS_DEBUG}" ] && set -x +[ -n "${VORTEX_DEBUG}" ] && set -x site="${1}" target_env="${2}" pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1 -[ "${DREVOPS_TASK_COPY_FILES_ACQUIA_SKIP}" = "1" ] && echo "Skipping copying of files between Acquia environments." && exit 0 +[ "${VORTEX_TASK_COPY_FILES_ACQUIA_SKIP}" = "1" ] && echo "Skipping copying of files between Acquia environments." && exit 0 -export DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY?not set}" -export DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET?not set}" -export DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-${site}}" -export DREVOPS_TASK_COPY_FILES_ACQUIA_SRC="${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC:-prod}" -export DREVOPS_TASK_COPY_FILES_ACQUIA_DST="${DREVOPS_TASK_COPY_FILES_ACQUIA_DST:-${target_env}}" +export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY?not set}" +export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET?not set}" +export VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${site}}" +export VORTEX_TASK_COPY_FILES_ACQUIA_SRC="${VORTEX_TASK_COPY_FILES_ACQUIA_SRC:-prod}" +export VORTEX_TASK_COPY_FILES_ACQUIA_DST="${VORTEX_TASK_COPY_FILES_ACQUIA_DST:-${target_env}}" -./scripts/drevops/task-copy-files-acquia.sh +./scripts/vortex/task-copy-files-acquia.sh popd >/dev/null || exit 1 diff --git a/hooks/library/notify-deployment.sh b/hooks/library/notify-deployment.sh index f4e18e71e..67c028fc5 100755 --- a/hooks/library/notify-deployment.sh +++ b/hooks/library/notify-deployment.sh @@ -4,7 +4,7 @@ # set -e -[ -n "${DREVOPS_DEBUG}" ] && set -x +[ -n "${VORTEX_DEBUG}" ] && set -x site="${1}" target_env="${2}" @@ -13,7 +13,7 @@ ref="${4:-${branch}}" # Custom domain name for the environment, including subdomain. # Examples: "dev.example.com", "test.example.com", "www.example.com" -DREVOPS_NOTIFY_ENVIRONMENT_DOMAIN="${DREVOPS_NOTIFY_ENVIRONMENT_DOMAIN:-}" +VORTEX_NOTIFY_ENVIRONMENT_DOMAIN="${VORTEX_NOTIFY_ENVIRONMENT_DOMAIN:-}" pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1 @@ -21,16 +21,16 @@ pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1 url="https://${AH_SITE_NAME}.${AH_REALM:-prod}.acquia-sites.com" # Use custom domain in URL, if provided. -if [ -n "${DREVOPS_NOTIFY_ENVIRONMENT_DOMAIN}" ]; then - url="https://${DREVOPS_NOTIFY_ENVIRONMENT_DOMAIN}" +if [ -n "${VORTEX_NOTIFY_ENVIRONMENT_DOMAIN}" ]; then + url="https://${VORTEX_NOTIFY_ENVIRONMENT_DOMAIN}" fi -export DREVOPS_NOTIFY_PROJECT="${site}" -export DREVOPS_NOTIFY_BRANCH="${branch}" -export DREVOPS_NOTIFY_REF="${ref}" -export DREVOPS_NOTIFY_SHA="${target_env}" -export DREVOPS_NOTIFY_ENVIRONMENT_URL="${url}" +export VORTEX_NOTIFY_PROJECT="${site}" +export VORTEX_NOTIFY_BRANCH="${branch}" +export VORTEX_NOTIFY_REF="${ref}" +export VORTEX_NOTIFY_SHA="${target_env}" +export VORTEX_NOTIFY_ENVIRONMENT_URL="${url}" -./scripts/drevops/notify.sh || true +./scripts/vortex/notify.sh || true popd >/dev/null || exit 1 diff --git a/hooks/library/provision.sh b/hooks/library/provision.sh index 1e8579ed7..ce030b69c 100755 --- a/hooks/library/provision.sh +++ b/hooks/library/provision.sh @@ -4,7 +4,7 @@ # set -e -[ -n "${DREVOPS_DEBUG}" ] && set -x +[ -n "${VORTEX_DEBUG}" ] && set -x site="${1}" target_env="${2}" @@ -14,6 +14,6 @@ pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1 # Do not unblock admin account. export DRUPAL_UNBLOCK_ADMIN="${DRUPAL_UNBLOCK_ADMIN:-0}" -./scripts/drevops/provision.sh +./scripts/vortex/provision.sh popd >/dev/null || exit 1 diff --git a/hooks/library/purge-cache.sh b/hooks/library/purge-cache.sh index 6a7e0dfcd..b82a20086 100755 --- a/hooks/library/purge-cache.sh +++ b/hooks/library/purge-cache.sh @@ -6,21 +6,21 @@ # Environment variables must be set in Acquia UI globally or for each environment. set -e -[ -n "${DREVOPS_DEBUG}" ] && set -x +[ -n "${VORTEX_DEBUG}" ] && set -x site="${1}" target_env="${2}" pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1 -[ "${DREVOPS_PURGE_CACHE_ACQUIA_SKIP}" = "1" ] && echo "Skipping purging of cache in Acquia environment." && exit 0 +[ "${VORTEX_PURGE_CACHE_ACQUIA_SKIP}" = "1" ] && echo "Skipping purging of cache in Acquia environment." && exit 0 -export DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY?not set}" -export DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET?not set}" -export DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-${site}}" -export DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV:-${target_env}}" -export DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE:-"/var/www/html/${site}.${target_env}/hooks/library/domains.txt"}" +export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY?not set}" +export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET?not set}" +export VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${site}}" +export VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV="${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV:-${target_env}}" +export VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE="${VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE:-"/var/www/html/${site}.${target_env}/hooks/library/domains.txt"}" -./scripts/drevops/task-purge-cache-acquia.sh +./scripts/vortex/task-purge-cache-acquia.sh popd >/dev/null || exit 1 diff --git a/phpmd.xml b/phpmd.xml index aac007b14..e768e4b2e 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -22,7 +22,7 @@ */web/modules/custom/*/*.install - */.scaffold/* + */.vortex/* diff --git a/scripts/README.md b/scripts/README.md index 5822e36b8..534e46ba5 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,4 +1,4 @@ -This directory contains Scaffold and your custom scripts. +This directory contains Vortex and your custom scripts. Add your custom per-project scripts into `./scripts/custom` directory. diff --git a/scripts/custom/provision-10-example.sh b/scripts/custom/provision-10-example.sh index bbd53263f..09b46298c 100644 --- a/scripts/custom/provision-10-example.sh +++ b/scripts/custom/provision-10-example.sh @@ -15,14 +15,14 @@ # shellcheck disable=SC2086 set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # ------------------------------------------------------------------------------ drush() { ./vendor/bin/drush -y "$@"; } # Perform operations based on the current environment. -if echo "${DREVOPS_PROVISION_ENVIRONMENT:-}" | grep -q -e dev -e test -e ci -e local; then +if echo "${VORTEX_PROVISION_ENVIRONMENT:-}" | grep -q -e dev -e test -e ci -e local; then echo "==> Executing example operations in non-production environment." # Below are examples of running operations. @@ -54,7 +54,7 @@ if echo "${DREVOPS_PROVISION_ENVIRONMENT:-}" | grep -q -e dev -e test -e ci -e l drush deploy:hook # Conditionally perform an action if this is a "fresh" database. - if [ "${DREVOPS_PROVISION_OVERRIDE_DB:-0}" = "1" ]; then + if [ "${VORTEX_PROVISION_OVERRIDE_DB:-0}" = "1" ]; then echo " > Fresh database detected. Performing additional example operations." else echo " > Existing database detected. Performing additional example operations." diff --git a/scripts/drevops/download-db-container-registry.sh b/scripts/drevops/download-db-container-registry.sh deleted file mode 100755 index ecde5bd3a..000000000 --- a/scripts/drevops/download-db-container-registry.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env bash -## -# Download DB dump from container image. -# -# IMPORTANT! This script runs outside the container on the host system. -# -# shellcheck disable=SC1090,SC1091,SC2015 - -t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t - -set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x - -# The container image containing database passed in a form of `/`. -DREVOPS_DB_IMAGE="${DREVOPS_DB_IMAGE:-}" - -# Container registry name. -# -# Provide port, if required as `:`. -DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY="${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY:-${DREVOPS_CONTAINER_REGISTRY:-docker.io}}" - -# The username to login into the container registry. -DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_USER="${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_USER:-${DREVOPS_CONTAINER_REGISTRY_USER:-}}" - -# The password to login into the container registry. -DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS="${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS:-${DREVOPS_CONTAINER_REGISTRY_PASS:-}}" - -#------------------------------------------------------------------------------- - -# @formatter:off -note() { printf " %s\n" "${1}"; } -info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } -pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } -fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } -# @formatter:on - -#shellcheck disable=SC2043 -for cmd in docker; do command -v ${cmd} >/dev/null || { - fail "Command ${cmd} is not available" - exit 1 -}; done - -info "Started database data container image download." - -[ -z "${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY}" ] && fail "Missing required value for DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY." && exit 1 -[ -z "${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_USER}" ] && fail "Missing required value for DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_USER." && exit 1 -[ -z "${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS}" ] && fail "Missing required value for DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS." && exit 1 -[ -z "${DREVOPS_DB_IMAGE}" ] && fail "Destination image name is not specified. Please provide container image name as a first argument to this script in a format /." && exit 1 - -docker image inspect "${DREVOPS_DB_IMAGE}" >/dev/null 2>&1 && - note "Found ${DREVOPS_DB_IMAGE} image on host." || - note "Not found ${DREVOPS_DB_IMAGE} image on host." - -image_expanded_successfully=0 -if [ -f "${DREVOPS_DB_DIR}/db.tar" ]; then - note "Found archived database container image file ${DREVOPS_DB_DIR}/db.tar. Expanding..." - # Always use archived image, even if such image already exists on the host. - docker load -q --input "${DREVOPS_DB_DIR}/db.tar" - - # Check that image was expanded and now exists on the host or notify - # that it will be downloaded from the registry. - if docker image inspect "${DREVOPS_DB_IMAGE}" >/dev/null 2>&1; then - note "Found expanded ${DREVOPS_DB_IMAGE} image on host." - image_expanded_successfully=1 - else - note "Not found expanded ${DREVOPS_DB_IMAGE} image on host." - fi -fi - -if [ "${image_expanded_successfully}" -eq 0 ]; then - if [ ! -f "${DREVOPS_DB_DIR}/db.tar" ] && [ -n "${DREVOPS_DB_IMAGE_BASE:-}" ]; then - # If the image archive does not exist and base image was provided - use the - # base image which allows "clean slate" for the database. - note "Database container image was not found. Using base image ${DREVOPS_DB_IMAGE_BASE}." - export DREVOPS_DB_IMAGE="${DREVOPS_DB_IMAGE_BASE}" - fi - - note "Downloading ${DREVOPS_DB_IMAGE} image from the registry." - - export DREVOPS_CONTAINER_REGISTRY="${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY}" - export DREVOPS_CONTAINER_REGISTRY_USER="${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_USER}" - export DREVOPS_CONTAINER_REGISTRY_PASS="${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS}" - ./scripts/drevops/login-container-registry.sh - - docker pull "${DREVOPS_DOWNLOAD_DB_CONTAINER_REGISTRY}/${DREVOPS_DB_IMAGE}" -fi - -pass "Finished database data container image download." diff --git a/scripts/drevops/notify-newrelic.sh b/scripts/drevops/notify-newrelic.sh deleted file mode 100755 index 2db0a7074..000000000 --- a/scripts/drevops/notify-newrelic.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash -## -# Notification dispatch to New Relic. -# -# shellcheck disable=SC1090,SC1091 - -t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t - -set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x - -# Project name to notify. -DREVOPS_NOTIFY_NEWRELIC_PROJECT="${DREVOPS_NOTIFY_NEWRELIC_PROJECT:-${DREVOPS_NOTIFY_PROJECT:-}}" - -# NewRelic API key, usually of type 'USER'. -DREVOPS_NOTIFY_NEWRELIC_APIKEY="${DREVOPS_NOTIFY_NEWRELIC_APIKEY:-}" - -# Deployment reference, such as a git branch or pr. -DREVOPS_NOTIFY_NEWRELIC_REF="${DREVOPS_NOTIFY_NEWRELIC_REF:-${DREVOPS_NOTIFY_REF:-}}" - -# Deployment commit reference, such as a git SHA. -DREVOPS_NOTIFY_NEWRELIC_SHA="${DREVOPS_NOTIFY_NEWRELIC_SHA:-${DREVOPS_NOTIFY_SHA:-}}" - -# NewRelic application name as it appears in the dashboard. -DREVOPS_NOTIFY_NEWRELIC_APP_NAME="${DREVOPS_NOTIFY_NEWRELIC_APP_NAME:-"${DREVOPS_NOTIFY_NEWRELIC_PROJECT}-${DREVOPS_NOTIFY_NEWRELIC_REF}"}" - -# Optional NewRelic Application ID. -# -# Will be discovered automatically from application name if not provided. -DREVOPS_NOTIFY_NEWRELIC_APPID="${DREVOPS_NOTIFY_NEWRELIC_APPID:-}" - -# Optional NewRelic notification description. -DREVOPS_NOTIFY_NEWRELIC_DESCRIPTION="${DREVOPS_NOTIFY_NEWRELIC_DESCRIPTION:-"${DREVOPS_NOTIFY_NEWRELIC_REF} deployed"}" - -# Optional NewRelic notification changelog. -# -# Defaults to the description. -DREVOPS_NOTIFY_NEWRELIC_CHANGELOG="${DREVOPS_NOTIFY_NEWRELIC_CHANGELOG:-${DREVOPS_NOTIFY_NEWRELIC_DESCRIPTION}}" - -# Optional name of the user performing the deployment. -DREVOPS_NOTIFY_NEWRELIC_USER="${DREVOPS_NOTIFY_NEWRELIC_USER:-"Deployment robot"}" - -# Optional NewRelic endpoint. -DREVOPS_NOTIFY_NEWRELIC_ENDPOINT="${DREVOPS_NOTIFY_NEWRELIC_ENDPOINT:-https://api.newrelic.com/v2}" - -# ------------------------------------------------------------------------------ - -# @formatter:off -note() { printf " %s\n" "${1}"; } -info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } -pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } -fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } -# @formatter:on - -#shellcheck disable=SC2043 -for cmd in curl; do command -v ${cmd} >/dev/null || { - fail "Command ${cmd} is not available" - exit 1 -}; done - -[ -z "${DREVOPS_NOTIFY_NEWRELIC_PROJECT}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_PROJECT" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_APIKEY}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_APIKEY" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_REF}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_REF" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_SHA}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_SHA" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_APP_NAME}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_APP_NAME" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_DESCRIPTION}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_DESCRIPTION" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_CHANGELOG}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_CHANGELOG" && exit 1 -[ -z "${DREVOPS_NOTIFY_NEWRELIC_USER}" ] && fail "Missing required value for DREVOPS_NOTIFY_NEWRELIC_USER" && exit 1 - -info "Started New Relic notification." - -# Discover APP id by name if it was not provided. -if [ -z "${DREVOPS_NOTIFY_NEWRELIC_APPID}" ] && [ -n "${DREVOPS_NOTIFY_NEWRELIC_APP_NAME}" ]; then - DREVOPS_NOTIFY_NEWRELIC_APPID="$(curl -s -X GET "${DREVOPS_NOTIFY_NEWRELIC_ENDPOINT}/applications.json" \ - -H "Api-Key:${DREVOPS_NOTIFY_NEWRELIC_APIKEY}" \ - -s -G -d "filter[name]=${DREVOPS_NOTIFY_NEWRELIC_APP_NAME}&exclude_links=true" | - cut -c 24- | - cut -c -10)" -fi - -# Check if the length of the DREVOPS_NOTIFY_NEWRELIC_APPID variable is not 10 OR -# if the variable doesn't contain only numeric values and exit. -{ [ "${#DREVOPS_NOTIFY_NEWRELIC_APPID}" != "10" ] || [ "$(expr "x${DREVOPS_NOTIFY_NEWRELIC_APPID}" : "x[0-9]*$")" -eq 0 ]; } && note "Notification skipped: No New Relic application ID found for ${DREVOPS_NOTIFY_NEWRELIC_APP_NAME}. This is expected for non-configured environments." && exit 0 - -if ! curl -X POST "${DREVOPS_NOTIFY_NEWRELIC_ENDPOINT}/applications/${DREVOPS_NOTIFY_NEWRELIC_APPID}/deployments.json" \ - -L -s -o /dev/null -w "%{http_code}" \ - -H "Api-Key:${DREVOPS_NOTIFY_NEWRELIC_APIKEY}" \ - -H 'Content-Type: application/json' \ - -d \ - "{ - \"deployment\": { - \"revision\": \"${DREVOPS_NOTIFY_NEWRELIC_SHA}\", - \"changelog\": \"${DREVOPS_NOTIFY_NEWRELIC_CHANGELOG}\", - \"description\": \"${DREVOPS_NOTIFY_NEWRELIC_DESCRIPTION}\", - \"user\": \"${DREVOPS_NOTIFY_NEWRELIC_USER}\" - } -}" | grep -q '201'; then - fail "[ERROR] Failed to crate a deployment notification for application ${DREVOPS_NOTIFY_NEWRELIC_APP_NAME} with ID ${DREVOPS_NOTIFY_NEWRELIC_APPID}" - exit 1 -fi - -pass "Finished New Relic notification." diff --git a/scripts/drevops/notify-webhook.sh b/scripts/drevops/notify-webhook.sh deleted file mode 100755 index 078fb1d2f..000000000 --- a/scripts/drevops/notify-webhook.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash -## -# Notification dispatch to any webhook. -# -# shellcheck disable=SC1090,SC1091 - -t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t - -set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x - -# Project name to notify. -DREVOPS_NOTIFY_PROJECT="${DREVOPS_NOTIFY_PROJECT:-}" - -# Git reference to notify about. -DREVOPS_NOTIFY_REF="${DREVOPS_NOTIFY_REF:-}" - -# Deployment environment URL. -DREVOPS_NOTIFY_ENVIRONMENT_URL="${DREVOPS_NOTIFY_ENVIRONMENT_URL:-}" - -# Webhook URL. -DREVOPS_NOTIFY_WEBHOOK_URL="${DREVOPS_NOTIFY_WEBHOOK_URL:-}" - -# Webhook method like POST, GET, PUT. -DREVOPS_NOTIFY_WEBHOOK_METHOD="${DREVOPS_NOTIFY_WEBHOOK_METHOD:-POST}" - -# Webhook headers. -# Separate multiple headers with a pipe `|`. -# Example: `Content-type: application/json|Authorization: Bearer API_KEY`. -DREVOPS_NOTIFY_WEBHOOK_HEADERS="${DREVOPS_NOTIFY_WEBHOOK_HEADERS:-Content-type: application/json}" - -# Webhook message body as json format. -DREVOPS_NOTIFY_WEBHOOK_PAYLOAD="${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD:-{\"channel\": \"Channel 1\", \"message\": \"%message%\", \"project\": \"%project%\", \"ref\": \"%ref%\", \"timestamp\": \"%timestamp%\", \"environment_url\": \"%environment_url%\"}}" - -# The pattern of response code return by curl. -DREVOPS_NOTIFY_WEBHOOK_RESPONSE_STATUS="${DREVOPS_NOTIFY_WEBHOOK_RESPONSE_STATUS:-200}" - -# ------------------------------------------------------------------------------ - -# @formatter:off -note() { printf " %s\n" "${1}"; } -info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } -pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } -fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } -# @formatter:on - -for cmd in php curl; do command -v ${cmd} >/dev/null || { - fail "Command ${cmd} is not available" - exit 1 -}; done - -[ -z "${DREVOPS_NOTIFY_PROJECT}" ] && fail "Missing required value for DREVOPS_NOTIFY_PROJECT" && exit 1 -[ -z "${DREVOPS_NOTIFY_REF}" ] && fail "Missing required value for DREVOPS_NOTIFY_REF" && exit 1 -[ -z "${DREVOPS_NOTIFY_ENVIRONMENT_URL}" ] && fail "Missing required value for DREVOPS_NOTIFY_ENVIRONMENT_URL" && exit 1 -[ -z "${DREVOPS_NOTIFY_WEBHOOK_URL}" ] && fail "Missing required value for DREVOPS_NOTIFY_WEBHOOK_URL" && exit 1 -[ -z "${DREVOPS_NOTIFY_WEBHOOK_METHOD}" ] && fail "Missing required value for DREVOPS_NOTIFY_WEBHOOK_METHOD" && exit 1 -[ -z "${DREVOPS_NOTIFY_WEBHOOK_HEADERS}" ] && fail "Missing required value for DREVOPS_NOTIFY_WEBHOOK_HEADERS" && exit 1 -[ -z "${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}" ] && fail "Missing required value for DREVOPS_NOTIFY_WEBHOOK_PAYLOAD" && exit 1 - -# Build and replace some variables (%variable_name%) for webhook payload. -timestamp=$(date '+%d/%m/%Y %H:%M:%S %Z') -message='## This is an automated message ##\nSite %project% \"%ref%\" branch has been deployed at %timestamp% and is available at %environment_url%.\nLogin at: %environment_url%/user/login' - -DREVOPS_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%message%', '${message}', '${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}');") -DREVOPS_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%timestamp%', '${timestamp}', '${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}');") -DREVOPS_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%ref%', '${DREVOPS_NOTIFY_REF}', '${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}');") -DREVOPS_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%project%', '${DREVOPS_NOTIFY_PROJECT}', '${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}');") -DREVOPS_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%environment_url%', '${DREVOPS_NOTIFY_ENVIRONMENT_URL}', '${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}');") - -info "Started Webhook notification." - -info "Webhook config:" -note "Project : ${DREVOPS_NOTIFY_PROJECT}" -note "Ref : ${DREVOPS_NOTIFY_REF}" -note "Environment url : ${DREVOPS_NOTIFY_ENVIRONMENT_URL}" -note "Webhook url : ${DREVOPS_NOTIFY_WEBHOOK_URL}" -note "Webhook method : ${DREVOPS_NOTIFY_WEBHOOK_METHOD}" -note "Webhook headers : ${DREVOPS_NOTIFY_WEBHOOK_HEADERS}" -note "Webhook payload : ${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}" -note "Webhook response status : ${DREVOPS_NOTIFY_WEBHOOK_RESPONSE_STATUS}" - -# Build headers. -headers=() -IFS=\| read -ra webhook_headers <<<"${DREVOPS_NOTIFY_WEBHOOK_HEADERS}" -for item in "${webhook_headers[@]}"; do - headers+=('-H' "${item}") -done - -# Make curl request. -if ! curl -L -s -o /dev/null -w '%{http_code}' \ - -X "${DREVOPS_NOTIFY_WEBHOOK_METHOD}" \ - "${headers[@]}" \ - -d "${DREVOPS_NOTIFY_WEBHOOK_PAYLOAD}" \ - "${DREVOPS_NOTIFY_WEBHOOK_URL}" | grep -q "${DREVOPS_NOTIFY_WEBHOOK_RESPONSE_STATUS}"; then - fail "Unable to send notification to webhook ${DREVOPS_NOTIFY_WEBHOOK_URL}." - exit 1 -fi - -pass "Finished Webhook notification." diff --git a/scripts/drevops/task-custom-lagoon.sh b/scripts/drevops/task-custom-lagoon.sh deleted file mode 100755 index efab258b2..000000000 --- a/scripts/drevops/task-custom-lagoon.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env bash -## -# Run custom Lagoon task. -# -# @see https://github.com/amazeeio/lagoon-cli -# -# shellcheck disable=SC1090,SC1091 - -t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t - -set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x - -# The task name. -DREVOPS_TASK_LAGOON_NAME="${DREVOPS_TASK_LAGOON_NAME:-Automation task}" - -# The Lagoon project to run tasks for. -DREVOPS_TASK_LAGOON_PROJECT="${DREVOPS_TASK_LAGOON_PROJECT:-${LAGOON_PROJECT:-}}" - -# The Lagoon branch to run the task on. -DREVOPS_TASK_LAGOON_BRANCH="${DREVOPS_TASK_LAGOON_BRANCH:-}" - -# The task command to execute. -DREVOPS_TASK_LAGOON_COMMAND="${DREVOPS_TASK_LAGOON_COMMAND:-}" - -# The Lagoon instance name to interact with. -DREVOPS_TASK_LAGOON_INSTANCE="${DREVOPS_TASK_LAGOON_INSTANCE:-amazeeio}" - -# The Lagoon instance GraphQL endpoint to interact with. -DREVOPS_TASK_LAGOON_INSTANCE_GRAPHQL="${DREVOPS_TASK_LAGOON_INSTANCE_GRAPHQL:-https://api.lagoon.amazeeio.cloud/graphql}" - -# The Lagoon instance hostname to interact with. -DREVOPS_TASK_LAGOON_INSTANCE_HOSTNAME="${DREVOPS_TASK_LAGOON_INSTANCE_HOSTNAME:-ssh.lagoon.amazeeio.cloud}" - -# The Lagoon instance port to interact with. -DREVOPS_TASK_LAGOON_INSTANCE_PORT="${DREVOPS_TASK_LAGOON_INSTANCE_PORT:-32222}" - -# SSH key fingerprint used to connect to a remote. -DREVOPS_TASK_SSH_FINGERPRINT="${DREVOPS_TASK_SSH_FINGERPRINT:-}" - -# Default SSH file used if custom fingerprint is not provided. -DREVOPS_TASK_SSH_FILE="${DREVOPS_TASK_SSH_FILE:-${HOME}/.ssh/id_rsa}" - -# Location of the Lagoon CLI binary. -DREVOPS_LAGOONCLI_PATH="${DREVOPS_LAGOONCLI_PATH:-/tmp}" - -# Flag to force the installation of Lagoon CLI. -DREVOPS_LAGOONCLI_FORCE_INSTALL="${DREVOPS_LAGOONCLI_FORCE_INSTALL:-}" - -# Lagoon CLI version to use. -DREVOPS_LAGOONCLI_VERSION="${DREVOPS_LAGOONCLI_VERSION:-latest}" - -# ------------------------------------------------------------------------------ - -# @formatter:off -note() { printf " %s\n" "${1}"; } -info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } -pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } -fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } -# @formatter:on - -info "Started Lagoon task ${DREVOPS_TASK_LAGOON_NAME}." - -## Check all required values. -[ -z "${DREVOPS_TASK_LAGOON_NAME}" ] && echo "Missing required value for DREVOPS_TASK_LAGOON_NAME." && exit 1 -[ -z "${DREVOPS_TASK_LAGOON_BRANCH}" ] && echo "Missing required value for DREVOPS_TASK_LAGOON_BRANCH." && exit 1 -[ -z "${DREVOPS_TASK_LAGOON_COMMAND}" ] && echo "Missing required value for DREVOPS_TASK_LAGOON_COMMAND." && exit 1 -[ -z "${DREVOPS_TASK_LAGOON_PROJECT}" ] && echo "Missing required value for DREVOPS_TASK_LAGOON_PROJECT." && exit 1 - -export DREVOPS_SSH_PREFIX="TASK" && . ./scripts/drevops/setup-ssh.sh - -if ! command -v lagoon >/dev/null || [ -n "${DREVOPS_LAGOONCLI_FORCE_INSTALL}" ]; then - note "Installing Lagoon CLI." - - lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/latest" - if [ "${DREVOPS_LAGOONCLI_VERSION}" != "latest" ]; then - lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/tags/${DREVOPS_LAGOONCLI_VERSION}" - fi - - curl -sL "${lagooncli_download_url}" | - grep "browser_download_url" | - grep -i "$(uname -s)-amd64\"$" | - cut -d '"' -f 4 | - xargs curl -L -o "${DREVOPS_LAGOONCLI_PATH}/lagoon" - chmod +x "${DREVOPS_LAGOONCLI_PATH}/lagoon" - export PATH="${PATH}:${DREVOPS_LAGOONCLI_PATH}" -fi - -for cmd in curl lagoon; do command -v ${cmd} >/dev/null || { - fail "Command ${cmd} is not available" - exit 1 -}; done - -note "Configuring Lagoon instance." -#shellcheck disable=SC2218 -lagoon config add --force -l "${DREVOPS_TASK_LAGOON_INSTANCE}" -g "${DREVOPS_TASK_LAGOON_INSTANCE_GRAPHQL}" -H "${DREVOPS_TASK_LAGOON_INSTANCE_HOSTNAME}" -P "${DREVOPS_TASK_LAGOON_INSTANCE_PORT}" - -lagoon() { command lagoon --force --skip-update-check -i "${DREVOPS_TASK_SSH_FILE}" -l "${DREVOPS_TASK_LAGOON_INSTANCE}" -p "${DREVOPS_TASK_LAGOON_PROJECT}" "$@"; } - -note "Creating ${DREVOPS_TASK_LAGOON_NAME} task: project ${DREVOPS_TASK_LAGOON_PROJECT}, branch: ${DREVOPS_TASK_LAGOON_BRANCH}." -lagoon run custom -e "${DREVOPS_TASK_LAGOON_BRANCH}" -N "${DREVOPS_TASK_LAGOON_NAME}" -c "${DREVOPS_TASK_LAGOON_COMMAND}" - -pass "Finished Lagoon task ${DREVOPS_TASK_LAGOON_NAME}." diff --git a/scripts/drevops/deploy-artifact.sh b/scripts/vortex/deploy-artifact.sh similarity index 53% rename from scripts/drevops/deploy-artifact.sh rename to scripts/vortex/deploy-artifact.sh index c3b411a51..6b3a42152 100755 --- a/scripts/drevops/deploy-artifact.sh +++ b/scripts/vortex/deploy-artifact.sh @@ -20,36 +20,36 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Remote repository to push code to. -DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE="${DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE:-}" +VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE="${VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE:-}" # Email address of the user who will be committing to a remote repository. -DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME="${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME:-"Deployment Robot"}" +VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME="${VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME:-"Deployment Robot"}" # Name of the user who will be committing to a remote repository. -DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL="${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL:-}" +VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL="${VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL:-}" # Source of the code to be used for artifact building. -DREVOPS_DEPLOY_ARTIFACT_SRC="${DREVOPS_DEPLOY_ARTIFACT_SRC:-}" +VORTEX_DEPLOY_ARTIFACT_SRC="${VORTEX_DEPLOY_ARTIFACT_SRC:-}" # The root directory where the deployment script should run from. Defaults to # the current directory. -DREVOPS_DEPLOY_ARTIFACT_ROOT="${DREVOPS_DEPLOY_ARTIFACT_ROOT:-$(pwd)}" +VORTEX_DEPLOY_ARTIFACT_ROOT="${VORTEX_DEPLOY_ARTIFACT_ROOT:-$(pwd)}" # Remote repository branch. Can be a specific branch or a token. # @see https://github.com/drevops/git-artifact#token-support -DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH="${DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH:-[branch]}" +VORTEX_DEPLOY_ARTIFACT_DST_BRANCH="${VORTEX_DEPLOY_ARTIFACT_DST_BRANCH:-[branch]}" # Deployment log file name. -DREVOPS_DEPLOY_ARTIFACT_LOG="${DREVOPS_DEPLOY_ARTIFACT_LOG:-${DREVOPS_DEPLOY_ARTIFACT_ROOT}/deployment_log.txt}" +VORTEX_DEPLOY_ARTIFACT_LOG="${VORTEX_DEPLOY_ARTIFACT_LOG:-${VORTEX_DEPLOY_ARTIFACT_ROOT}/deployment_log.txt}" # SSH key fingerprint used to connect to remote. -DREVOPS_DEPLOY_SSH_FINGERPRINT="${DREVOPS_DEPLOY_SSH_FINGERPRINT:-}" +VORTEX_DEPLOY_SSH_FINGERPRINT="${VORTEX_DEPLOY_SSH_FINGERPRINT:-}" # Default SSH file used if custom fingerprint is not provided. -DREVOPS_DEPLOY_SSH_FILE="${DREVOPS_DEPLOY_SSH_FILE:-${HOME}/.ssh/id_rsa}" +VORTEX_DEPLOY_SSH_FILE="${VORTEX_DEPLOY_SSH_FILE:-${HOME}/.ssh/id_rsa}" # ------------------------------------------------------------------------------ @@ -63,19 +63,19 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 info "Started ARTIFACT deployment." # Check all required values. -[ -z "${DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE." && exit 1 -[ -z "${DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH." && exit 1 -[ -z "${DREVOPS_DEPLOY_ARTIFACT_SRC}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_SRC." && exit 1 -[ -z "${DREVOPS_DEPLOY_ARTIFACT_ROOT}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_ROOT." && exit 1 -[ -z "${DREVOPS_DEPLOY_ARTIFACT_LOG}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_LOG." && exit 1 -[ -z "${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME." && exit 1 -[ -z "${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL}" ] && echo "Missing required value for DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_DST_BRANCH}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_DST_BRANCH." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_SRC}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_SRC." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_ROOT}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_ROOT." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_LOG}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_LOG." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME." && exit 1 +[ -z "${VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL}" ] && echo "Missing required value for VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL." && exit 1 # Configure global git settings, if they do not exist. -[ "$(git config --global user.name)" = "" ] && note "Configuring global git user name." && git config --global user.name "${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME}" -[ "$(git config --global user.email)" = "" ] && note "Configuring global git user email." && git config --global user.email "${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL}" +[ "$(git config --global user.name)" = "" ] && note "Configuring global git user name." && git config --global user.name "${VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME}" +[ "$(git config --global user.email)" = "" ] && note "Configuring global git user email." && git config --global user.email "${VORTEX_DEPLOY_ARTIFACT_GIT_USER_EMAIL}" -export DREVOPS_SSH_PREFIX="DEPLOY" && . ./scripts/drevops/setup-ssh.sh +export VORTEX_SSH_PREFIX="DEPLOY" && . ./scripts/vortex/setup-ssh.sh note "Installing artifact builder." composer global require --dev -n --ansi --prefer-source --ignore-platform-reqs drevops/git-artifact:^0.7 @@ -86,25 +86,25 @@ if command -v realpath >/dev/null 2>&1; then # singe quotes. This addresses the case where the paths are passed directly # from YAML anchors as literal strings. # shellcheck disable=SC2116 - DREVOPS_DEPLOY_ARTIFACT_ROOT="$(realpath "${DREVOPS_DEPLOY_ARTIFACT_ROOT/#\~/${HOME}}")" + VORTEX_DEPLOY_ARTIFACT_ROOT="$(realpath "${VORTEX_DEPLOY_ARTIFACT_ROOT/#\~/${HOME}}")" # shellcheck disable=SC2116 - DREVOPS_DEPLOY_ARTIFACT_SRC="$(realpath "${DREVOPS_DEPLOY_ARTIFACT_SRC/#\~/${HOME}}")" + VORTEX_DEPLOY_ARTIFACT_SRC="$(realpath "${VORTEX_DEPLOY_ARTIFACT_SRC/#\~/${HOME}}")" fi # Copying git repo files meta file to the deploy code repo as it may not exist # in deploy code source files. -cp -a "${DREVOPS_DEPLOY_ARTIFACT_ROOT}"/.git "${DREVOPS_DEPLOY_ARTIFACT_SRC}" || true +cp -a "${VORTEX_DEPLOY_ARTIFACT_ROOT}"/.git "${VORTEX_DEPLOY_ARTIFACT_SRC}" || true # Copying deployment .gitignore as it may not exist in deploy code source files. -cp -a "${DREVOPS_DEPLOY_ARTIFACT_ROOT}"/.gitignore.artifact "${DREVOPS_DEPLOY_ARTIFACT_SRC}" || true +cp -a "${VORTEX_DEPLOY_ARTIFACT_ROOT}"/.gitignore.artifact "${VORTEX_DEPLOY_ARTIFACT_SRC}" || true note "Running artifact builder." # Add --debug to debug any deployment issues. -"${HOME}/.composer/vendor/bin/git-artifact" "${DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE}" \ - --root="${DREVOPS_DEPLOY_ARTIFACT_ROOT}" \ - --src="${DREVOPS_DEPLOY_ARTIFACT_SRC}" \ - --branch="${DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH}" \ - --gitignore="${DREVOPS_DEPLOY_ARTIFACT_SRC}"/.gitignore.artifact \ - --log="${DREVOPS_DEPLOY_ARTIFACT_LOG}" \ +"${HOME}/.composer/vendor/bin/git-artifact" "${VORTEX_DEPLOY_ARTIFACT_GIT_REMOTE}" \ + --root="${VORTEX_DEPLOY_ARTIFACT_ROOT}" \ + --src="${VORTEX_DEPLOY_ARTIFACT_SRC}" \ + --branch="${VORTEX_DEPLOY_ARTIFACT_DST_BRANCH}" \ + --gitignore="${VORTEX_DEPLOY_ARTIFACT_SRC}"/.gitignore.artifact \ + --log="${VORTEX_DEPLOY_ARTIFACT_LOG}" \ -vvv pass "Finished ARTIFACT deployment." diff --git a/scripts/drevops/deploy-container-registry.sh b/scripts/vortex/deploy-container-registry.sh similarity index 59% rename from scripts/drevops/deploy-container-registry.sh rename to scripts/vortex/deploy-container-registry.sh index 6f3caddda..129771c0b 100755 --- a/scripts/drevops/deploy-container-registry.sh +++ b/scripts/vortex/deploy-container-registry.sh @@ -3,7 +3,7 @@ # Deploy via pushing container images to the container registry. # # Push multiple container images by tagging services provided in the -# $DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable. +# $VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable. # # IMPORTANT! This script runs outside the container on the host system. # @@ -12,25 +12,25 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Comma-separated map of container services and images to use for deployment in # format "service1=org/image1,service2=org/image2". -DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP="${DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP:-}" +VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP="${VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP:-}" # The tag of the container image. -DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="${DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG:-latest}" +VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG="${VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG:-latest}" # Container registry name. # # Provide port, if required as `:`. -DREVOPS_DEPLOY_CONTAINER_REGISTRY="${DREVOPS_DEPLOY_CONTAINER_REGISTRY:-${DREVOPS_CONTAINER_REGISTRY:-docker.io}}" +VORTEX_DEPLOY_CONTAINER_REGISTRY="${VORTEX_DEPLOY_CONTAINER_REGISTRY:-${VORTEX_CONTAINER_REGISTRY:-docker.io}}" # The username to login into the container registry. -DREVOPS_DEPLOY_CONTAINER_REGISTRY_USER="${DREVOPS_DEPLOY_CONTAINER_REGISTRY_USER:-${DREVOPS_CONTAINER_REGISTRY_USER:-}}" +VORTEX_DEPLOY_CONTAINER_REGISTRY_USER="${VORTEX_DEPLOY_CONTAINER_REGISTRY_USER:-${VORTEX_CONTAINER_REGISTRY_USER:-}}" # The password to login into the container registry. -DREVOPS_DEPLOY_CONTAINER_REGISTRY_PASS="${DREVOPS_DEPLOY_CONTAINER_REGISTRY_PASS:-${DREVOPS_CONTAINER_REGISTRY_PASS:-}}" +VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS="${VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS:-${VORTEX_CONTAINER_REGISTRY_PASS:-}}" # ------------------------------------------------------------------------------ @@ -49,19 +49,19 @@ for cmd in docker; do command -v ${cmd} >/dev/null || { info "Started container registry deployment." -[ -z "${DREVOPS_DEPLOY_CONTAINER_REGISTRY}" ] && fail "Missing required value for DREVOPS_DEPLOY_CONTAINER_REGISTRY." && exit 1 -[ -z "${DREVOPS_DEPLOY_CONTAINER_REGISTRY_USER}" ] && fail "Missing required value for DREVOPS_DEPLOY_CONTAINER_REGISTRY_USER." && exit 1 -[ -z "${DREVOPS_DEPLOY_CONTAINER_REGISTRY_PASS}" ] && fail "Missing required value for DREVOPS_DEPLOY_CONTAINER_REGISTRY_PASS." && exit 1 +[ -z "${VORTEX_DEPLOY_CONTAINER_REGISTRY}" ] && fail "Missing required value for VORTEX_DEPLOY_CONTAINER_REGISTRY." && exit 1 +[ -z "${VORTEX_DEPLOY_CONTAINER_REGISTRY_USER}" ] && fail "Missing required value for VORTEX_DEPLOY_CONTAINER_REGISTRY_USER." && exit 1 +[ -z "${VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS}" ] && fail "Missing required value for VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS." && exit 1 # Only deploy if the map was provided, but do not fail if it has not as this # may be called as a part of another task. -# @todo: Handle this better - empty $DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP should use defaults. -[ -z "${DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP}" ] && echo "Services map is not specified in DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP variable. Container registry deployment will not continue." && exit 0 +# @todo: Handle this better - empty $VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP should use defaults. +[ -z "${VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP}" ] && echo "Services map is not specified in VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP variable. Container registry deployment will not continue." && exit 0 services=() images=() # Parse and validate map. -IFS=',' read -r -a values <<<"${DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP}" +IFS=',' read -r -a values <<<"${VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP}" for value in "${values[@]}"; do IFS='=' read -r -a parts <<<"${value}" [ "${#parts[@]}" -ne 2 ] && fail "invalid key/value pair \"${value}\" provided." && exit 1 @@ -69,10 +69,10 @@ for value in "${values[@]}"; do images+=("${parts[1]}") done -export DREVOPS_CONTAINER_REGISTRY="${DREVOPS_DEPLOY_CONTAINER_REGISTRY}" -export DREVOPS_CONTAINER_REGISTRY_USER="${DREVOPS_DEPLOY_CONTAINER_REGISTRY_USER}" -export DREVOPS_CONTAINER_REGISTRY_PASS="${DREVOPS_DEPLOY_CONTAINER_REGISTRY_PASS}" -./scripts/drevops/login-container-registry.sh +export VORTEX_CONTAINER_REGISTRY="${VORTEX_DEPLOY_CONTAINER_REGISTRY}" +export VORTEX_CONTAINER_REGISTRY_USER="${VORTEX_DEPLOY_CONTAINER_REGISTRY_USER}" +export VORTEX_CONTAINER_REGISTRY_PASS="${VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS}" +./scripts/vortex/login-container-registry.sh for key in "${!services[@]}"; do service="${services[${key}]}" @@ -85,8 +85,8 @@ for key in "${!services[@]}"; do [ -z "${cid}" ] && fail "Service \"${service}\" is not running." && exit 1 note "Found \"${service}\" service container with id \"${cid}\"." - [ -n "${image##*:*}" ] && image="${image}:${DREVOPS_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG}" - new_image="${DREVOPS_DEPLOY_CONTAINER_REGISTRY}/${image}" + [ -n "${image##*:*}" ] && image="${image}:${VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG}" + new_image="${VORTEX_DEPLOY_CONTAINER_REGISTRY}/${image}" note "Committing container image with name \"${new_image}\"." iid=$(docker commit "${cid}" "${new_image}") diff --git a/scripts/drevops/deploy-lagoon.sh b/scripts/vortex/deploy-lagoon.sh similarity index 60% rename from scripts/drevops/deploy-lagoon.sh rename to scripts/vortex/deploy-lagoon.sh index d778d6ca6..68ce0a523 100755 --- a/scripts/drevops/deploy-lagoon.sh +++ b/scripts/vortex/deploy-lagoon.sh @@ -11,7 +11,7 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Deployment action. # @@ -19,34 +19,34 @@ set -eu # - deploy: Deploy code and preserve database in the environment. # - deploy_override_db: Deploy code and override database in the environment. # - destroy: Destroy the environment (if the provider supports it). -DREVOPS_DEPLOY_ACTION="${DREVOPS_DEPLOY_ACTION:-create}" +VORTEX_DEPLOY_ACTION="${VORTEX_DEPLOY_ACTION:-create}" # The Lagoon project to perform deployment for. LAGOON_PROJECT="${LAGOON_PROJECT:-}" # The Lagoon branch to deploy. -DREVOPS_DEPLOY_BRANCH="${DREVOPS_DEPLOY_BRANCH:-}" +VORTEX_DEPLOY_BRANCH="${VORTEX_DEPLOY_BRANCH:-}" # The PR number to deploy. -DREVOPS_DEPLOY_PR="${DREVOPS_DEPLOY_PR:-}" +VORTEX_DEPLOY_PR="${VORTEX_DEPLOY_PR:-}" # The PR head branch to deploy. -DREVOPS_DEPLOY_PR_HEAD="${DREVOPS_DEPLOY_PR_HEAD:-}" +VORTEX_DEPLOY_PR_HEAD="${VORTEX_DEPLOY_PR_HEAD:-}" # The PR base branch (the branch the PR is raised against). Defaults to 'develop'. -DREVOPS_DEPLOY_PR_BASE_BRANCH="${DREVOPS_DEPLOY_PR_BASE_BRANCH:-develop}" +VORTEX_DEPLOY_PR_BASE_BRANCH="${VORTEX_DEPLOY_PR_BASE_BRANCH:-develop}" # The Lagoon instance name to interact with. -DREVOPS_DEPLOY_LAGOON_INSTANCE="${DREVOPS_DEPLOY_LAGOON_INSTANCE:-amazeeio}" +VORTEX_DEPLOY_LAGOON_INSTANCE="${VORTEX_DEPLOY_LAGOON_INSTANCE:-amazeeio}" # The Lagoon instance GraphQL endpoint to interact with. -DREVOPS_DEPLOY_LAGOON_INSTANCE_GRAPHQL="${DREVOPS_DEPLOY_LAGOON_INSTANCE_GRAPHQL:-https://api.lagoon.amazeeio.cloud/graphql}" +VORTEX_DEPLOY_LAGOON_INSTANCE_GRAPHQL="${VORTEX_DEPLOY_LAGOON_INSTANCE_GRAPHQL:-https://api.lagoon.amazeeio.cloud/graphql}" # The Lagoon instance hostname to interact with. -DREVOPS_DEPLOY_LAGOON_INSTANCE_HOSTNAME="${DREVOPS_DEPLOY_LAGOON_INSTANCE_HOSTNAME:-ssh.lagoon.amazeeio.cloud}" +VORTEX_DEPLOY_LAGOON_INSTANCE_HOSTNAME="${VORTEX_DEPLOY_LAGOON_INSTANCE_HOSTNAME:-ssh.lagoon.amazeeio.cloud}" # The Lagoon instance port to interact with. -DREVOPS_DEPLOY_LAGOON_INSTANCE_PORT="${DREVOPS_DEPLOY_LAGOON_INSTANCE_PORT:-32222}" +VORTEX_DEPLOY_LAGOON_INSTANCE_PORT="${VORTEX_DEPLOY_LAGOON_INSTANCE_PORT:-32222}" # SSH key fingerprint used to connect to remote. If not used, the currently # loaded default SSH key (the key used for code checkout) will be used or @@ -54,19 +54,19 @@ DREVOPS_DEPLOY_LAGOON_INSTANCE_PORT="${DREVOPS_DEPLOY_LAGOON_INSTANCE_PORT:-3222 # In most cases, the default SSH key does not work (because it is a read-only # key used by CircleCI to checkout code from git), so you should add another # deployment key. -DREVOPS_DEPLOY_SSH_FINGERPRINT="${DREVOPS_DEPLOY_SSH_FINGERPRINT:-}" +VORTEX_DEPLOY_SSH_FINGERPRINT="${VORTEX_DEPLOY_SSH_FINGERPRINT:-}" # Default SSH file used if custom fingerprint is not provided. -DREVOPS_DEPLOY_SSH_FILE="${DREVOPS_DEPLOY_SSH_FILE:-${HOME}/.ssh/id_rsa}" +VORTEX_DEPLOY_SSH_FILE="${VORTEX_DEPLOY_SSH_FILE:-${HOME}/.ssh/id_rsa}" # Location of the Lagoon CLI binary. -DREVOPS_LAGOONCLI_PATH="${DREVOPS_LAGOONCLI_PATH:-/tmp}" +VORTEX_LAGOONCLI_PATH="${VORTEX_LAGOONCLI_PATH:-/tmp}" # Flag to force the installation of Lagoon CLI. -DREVOPS_LAGOONCLI_FORCE_INSTALL="${DREVOPS_LAGOONCLI_FORCE_INSTALL:-}" +VORTEX_LAGOONCLI_FORCE_INSTALL="${VORTEX_LAGOONCLI_FORCE_INSTALL:-}" # Lagoon CLI version to use. -DREVOPS_LAGOONCLI_VERSION="${DREVOPS_LAGOONCLI_VERSION:-latest}" +VORTEX_LAGOONCLI_VERSION="${VORTEX_LAGOONCLI_VERSION:-latest}" # ------------------------------------------------------------------------------ @@ -81,25 +81,25 @@ info "Started LAGOON deployment." ## Check all required values. [ -z "${LAGOON_PROJECT}" ] && fail "Missing required value for LAGOON_PROJECT." && exit 1 -{ [ -z "${DREVOPS_DEPLOY_BRANCH}" ] && [ -z "${DREVOPS_DEPLOY_PR}" ]; } && fail "Missing required value for DREVOPS_DEPLOY_BRANCH or DREVOPS_DEPLOY_PR." && exit 1 +{ [ -z "${VORTEX_DEPLOY_BRANCH}" ] && [ -z "${VORTEX_DEPLOY_PR}" ]; } && fail "Missing required value for VORTEX_DEPLOY_BRANCH or VORTEX_DEPLOY_PR." && exit 1 -export DREVOPS_SSH_PREFIX="DEPLOY" && . ./scripts/drevops/setup-ssh.sh +export VORTEX_SSH_PREFIX="DEPLOY" && . ./scripts/vortex/setup-ssh.sh -if ! command -v lagoon >/dev/null || [ -n "${DREVOPS_LAGOONCLI_FORCE_INSTALL}" ]; then +if ! command -v lagoon >/dev/null || [ -n "${VORTEX_LAGOONCLI_FORCE_INSTALL}" ]; then note "Installing Lagoon CLI." lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/latest" - if [ "${DREVOPS_LAGOONCLI_VERSION}" != "latest" ]; then - lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/tags/${DREVOPS_LAGOONCLI_VERSION}" + if [ "${VORTEX_LAGOONCLI_VERSION}" != "latest" ]; then + lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/tags/${VORTEX_LAGOONCLI_VERSION}" fi curl -sL "${lagooncli_download_url}" | grep "browser_download_url" | grep -i "$(uname -s)-amd64\"$" | cut -d '"' -f 4 | - xargs curl -L -o "${DREVOPS_LAGOONCLI_PATH}/lagoon" - chmod +x "${DREVOPS_LAGOONCLI_PATH}/lagoon" - export PATH="${PATH}:${DREVOPS_LAGOONCLI_PATH}" + xargs curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" + chmod +x "${VORTEX_LAGOONCLI_PATH}/lagoon" + export PATH="${PATH}:${VORTEX_LAGOONCLI_PATH}" fi for cmd in lagoon curl; do command -v ${cmd} >/dev/null || { @@ -109,21 +109,21 @@ for cmd in lagoon curl; do command -v ${cmd} >/dev/null || { note "Configuring Lagoon instance." #shellcheck disable=SC2218 -lagoon config add --force --lagoon "${DREVOPS_DEPLOY_LAGOON_INSTANCE}" --graphql "${DREVOPS_DEPLOY_LAGOON_INSTANCE_GRAPHQL}" --hostname "${DREVOPS_DEPLOY_LAGOON_INSTANCE_HOSTNAME}" --port "${DREVOPS_DEPLOY_LAGOON_INSTANCE_PORT}" +lagoon config add --force --lagoon "${VORTEX_DEPLOY_LAGOON_INSTANCE}" --graphql "${VORTEX_DEPLOY_LAGOON_INSTANCE_GRAPHQL}" --hostname "${VORTEX_DEPLOY_LAGOON_INSTANCE_HOSTNAME}" --port "${VORTEX_DEPLOY_LAGOON_INSTANCE_PORT}" -lagoon() { command lagoon --force --skip-update-check --ssh-key "${DREVOPS_DEPLOY_SSH_FILE}" --lagoon "${DREVOPS_DEPLOY_LAGOON_INSTANCE}" --project "${LAGOON_PROJECT}" "$@"; } +lagoon() { command lagoon --force --skip-update-check --ssh-key "${VORTEX_DEPLOY_SSH_FILE}" --lagoon "${VORTEX_DEPLOY_LAGOON_INSTANCE}" --project "${LAGOON_PROJECT}" "$@"; } # ACTION: 'destroy' # Explicitly specifying "destroy" action as a failsafe. -if [ "${DREVOPS_DEPLOY_ACTION}" = "destroy" ]; then - note "Destroying environment: project ${LAGOON_PROJECT}, branch: ${DREVOPS_DEPLOY_BRANCH}." - lagoon delete environment --environment "${DREVOPS_DEPLOY_BRANCH}" || true +if [ "${VORTEX_DEPLOY_ACTION}" = "destroy" ]; then + note "Destroying environment: project ${LAGOON_PROJECT}, branch: ${VORTEX_DEPLOY_BRANCH}." + lagoon delete environment --environment "${VORTEX_DEPLOY_BRANCH}" || true # ACTION: 'deploy' OR 'deploy_override_db' else # Deploy PR. - if [ -n "${DREVOPS_DEPLOY_PR:-}" ]; then - deploy_pr_full="pr-${DREVOPS_DEPLOY_PR}" + if [ -n "${VORTEX_DEPLOY_PR:-}" ]; then + deploy_pr_full="pr-${VORTEX_DEPLOY_PR}" # Discover all available environments to check if this is a fresh deployment # or a re-deployment of the existing environment. @@ -133,7 +133,7 @@ else is_redeploy=0 for name in ${names}; do if [ "${deploy_pr_full}" = "${name}" ]; then - note "Found already deployed environment for PR \"${DREVOPS_DEPLOY_PR}\"." + note "Found already deployed environment for PR \"${VORTEX_DEPLOY_PR}\"." is_redeploy=1 break fi @@ -144,32 +144,32 @@ else # Explicitly set DB overwrite flag to 0 due to a bug in Lagoon. # @see https://github.com/uselagoon/lagoon/issues/1922 - lagoon update variable --environment "${deploy_pr_full}" --name DREVOPS_PROVISION_OVERRIDE_DB --value 0 --scope global || true + lagoon update variable --environment "${deploy_pr_full}" --name VORTEX_PROVISION_OVERRIDE_DB --value 0 --scope global || true # Override DB during re-deployment. - if [ "${DREVOPS_DEPLOY_ACTION}" = "deploy_override_db" ]; then + if [ "${VORTEX_DEPLOY_ACTION}" = "deploy_override_db" ]; then note "Add a DB import override flag for the current deployment." # To update variable value, we need to remove it and add again. - lagoon update variable --environment "${deploy_pr_full}" --name DREVOPS_PROVISION_OVERRIDE_DB --value 1 --scope global || true + lagoon update variable --environment "${deploy_pr_full}" --name VORTEX_PROVISION_OVERRIDE_DB --value 1 --scope global || true fi - note "Redeploying environment: project ${LAGOON_PROJECT}, PR: ${DREVOPS_DEPLOY_PR}." - lagoon deploy pullrequest --number "${DREVOPS_DEPLOY_PR}" --base-branch-name "${DREVOPS_DEPLOY_PR_BASE_BRANCH}" --base-branch-ref "origin/${DREVOPS_DEPLOY_PR_BASE_BRANCH}" --head-branch-name "${DREVOPS_DEPLOY_BRANCH}" --head-branch-ref "${DREVOPS_DEPLOY_PR_HEAD}" --title "${deploy_pr_full}" + note "Redeploying environment: project ${LAGOON_PROJECT}, PR: ${VORTEX_DEPLOY_PR}." + lagoon deploy pullrequest --number "${VORTEX_DEPLOY_PR}" --base-branch-name "${VORTEX_DEPLOY_PR_BASE_BRANCH}" --base-branch-ref "origin/${VORTEX_DEPLOY_PR_BASE_BRANCH}" --head-branch-name "${VORTEX_DEPLOY_BRANCH}" --head-branch-ref "${VORTEX_DEPLOY_PR_HEAD}" --title "${deploy_pr_full}" - if [ "${DREVOPS_DEPLOY_ACTION:-}" = "deploy_override_db" ]; then + if [ "${VORTEX_DEPLOY_ACTION:-}" = "deploy_override_db" ]; then note "Waiting for deployment to be queued." sleep 10 note "Remove a DB import override flag for the current deployment." # Note that a variable will be read by Lagoon during queuing of the build. - lagoon update variable --environment "${deploy_pr_full}" --name DREVOPS_PROVISION_OVERRIDE_DB --value 0 --scope global || true + lagoon update variable --environment "${deploy_pr_full}" --name VORTEX_PROVISION_OVERRIDE_DB --value 0 --scope global || true fi # Deployment of the fresh environment. else # If PR deployments are not configured in Lagoon - it will filter it out and will not deploy. - note "Deploying environment: project ${LAGOON_PROJECT}, PR: ${DREVOPS_DEPLOY_PR}." - lagoon deploy pullrequest --number "${DREVOPS_DEPLOY_PR}" --base-branch-name "${DREVOPS_DEPLOY_PR_BASE_BRANCH}" --base-branch-ref "origin/${DREVOPS_DEPLOY_PR_BASE_BRANCH}" --head-branch-name "${DREVOPS_DEPLOY_BRANCH}" --head-branch-ref "${DREVOPS_DEPLOY_PR_HEAD}" --title "${deploy_pr_full}" + note "Deploying environment: project ${LAGOON_PROJECT}, PR: ${VORTEX_DEPLOY_PR}." + lagoon deploy pullrequest --number "${VORTEX_DEPLOY_PR}" --base-branch-name "${VORTEX_DEPLOY_PR_BASE_BRANCH}" --base-branch-ref "origin/${VORTEX_DEPLOY_PR_BASE_BRANCH}" --head-branch-name "${VORTEX_DEPLOY_BRANCH}" --head-branch-ref "${VORTEX_DEPLOY_PR_HEAD}" --title "${deploy_pr_full}" fi # Deploy branch. @@ -181,8 +181,8 @@ else is_redeploy=0 for name in ${names}; do - if [ "${DREVOPS_DEPLOY_BRANCH:-}" = "${name}" ]; then - note "Found already deployed environment for branch \"${DREVOPS_DEPLOY_BRANCH}\"." + if [ "${VORTEX_DEPLOY_BRANCH:-}" = "${name}" ]; then + note "Found already deployed environment for branch \"${VORTEX_DEPLOY_BRANCH}\"." is_redeploy=1 break fi @@ -193,32 +193,32 @@ else # Explicitly set DB overwrite flag to 0 due to a bug in Lagoon. # @see https://github.com/uselagoon/lagoon/issues/1922 - lagoon update variable --environment "${DREVOPS_DEPLOY_BRANCH}" --name DREVOPS_PROVISION_OVERRIDE_DB --value 0 --scope global || true + lagoon update variable --environment "${VORTEX_DEPLOY_BRANCH}" --name VORTEX_PROVISION_OVERRIDE_DB --value 0 --scope global || true # Override DB during re-deployment. - if [ "${DREVOPS_DEPLOY_ACTION:-}" = "deploy_override_db" ]; then + if [ "${VORTEX_DEPLOY_ACTION:-}" = "deploy_override_db" ]; then note "Add a DB import override flag for the current deployment." # To update variable value, we need to remove it and add again. - lagoon update variable --environment "${DREVOPS_DEPLOY_BRANCH}" --name DREVOPS_PROVISION_OVERRIDE_DB --value 1 --scope global || true + lagoon update variable --environment "${VORTEX_DEPLOY_BRANCH}" --name VORTEX_PROVISION_OVERRIDE_DB --value 1 --scope global || true fi - note "Redeploying environment: project ${LAGOON_PROJECT}, branch: ${DREVOPS_DEPLOY_BRANCH}." - lagoon deploy latest --environment "${DREVOPS_DEPLOY_BRANCH}" || true + note "Redeploying environment: project ${LAGOON_PROJECT}, branch: ${VORTEX_DEPLOY_BRANCH}." + lagoon deploy latest --environment "${VORTEX_DEPLOY_BRANCH}" || true - if [ "${DREVOPS_DEPLOY_ACTION:-}" = "deploy_override_db" ]; then + if [ "${VORTEX_DEPLOY_ACTION:-}" = "deploy_override_db" ]; then note "Waiting for deployment to be queued." sleep 10 note "Remove a DB import override flag for the current deployment." # Note that a variable will be read by Lagoon during queuing of the build. - lagoon update variable --environment "${DREVOPS_DEPLOY_BRANCH}" --name DREVOPS_PROVISION_OVERRIDE_DB --value 0 --scope global || true + lagoon update variable --environment "${VORTEX_DEPLOY_BRANCH}" --name VORTEX_PROVISION_OVERRIDE_DB --value 0 --scope global || true fi # Deployment of the fresh environment. else # If current branch deployments does not match a regex in Lagoon - it will filter it out and will not deploy. - note "Deploying environment: project ${LAGOON_PROJECT}, branch: ${DREVOPS_DEPLOY_BRANCH}." - lagoon deploy branch --branch "${DREVOPS_DEPLOY_BRANCH}" + note "Deploying environment: project ${LAGOON_PROJECT}, branch: ${VORTEX_DEPLOY_BRANCH}." + lagoon deploy branch --branch "${VORTEX_DEPLOY_BRANCH}" fi fi fi diff --git a/scripts/drevops/deploy-webhook.sh b/scripts/vortex/deploy-webhook.sh similarity index 61% rename from scripts/drevops/deploy-webhook.sh rename to scripts/vortex/deploy-webhook.sh index 1104f0b7f..10579bc72 100755 --- a/scripts/drevops/deploy-webhook.sh +++ b/scripts/vortex/deploy-webhook.sh @@ -9,16 +9,16 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # The URL of the webhook to call. -DREVOPS_DEPLOY_WEBHOOK_URL="${DREVOPS_DEPLOY_WEBHOOK_URL:-}" +VORTEX_DEPLOY_WEBHOOK_URL="${VORTEX_DEPLOY_WEBHOOK_URL:-}" # Webhook call method. -DREVOPS_DEPLOY_WEBHOOK_METHOD="${DREVOPS_DEPLOY_WEBHOOK_METHOD:-GET}" +VORTEX_DEPLOY_WEBHOOK_METHOD="${VORTEX_DEPLOY_WEBHOOK_METHOD:-GET}" # The status code of the expected response. -DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS="${DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS:-200}" +VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS="${VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS:-200}" # ------------------------------------------------------------------------------ @@ -38,11 +38,11 @@ for cmd in curl; do command -v ${cmd} >/dev/null || { info "Started WEBHOOK deployment." # Check all required values. -[ -z "${DREVOPS_DEPLOY_WEBHOOK_URL}" ] && fail "Missing required value for DREVOPS_DEPLOY_WEBHOOK_URL." && exit 1 -[ -z "${DREVOPS_DEPLOY_WEBHOOK_METHOD}" ] && fail "Missing required value for DREVOPS_DEPLOY_WEBHOOK_METHOD." && exit 1 -[ -z "${DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS}" ] && fail "Missing required value for DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS." && exit 1 +[ -z "${VORTEX_DEPLOY_WEBHOOK_URL}" ] && fail "Missing required value for VORTEX_DEPLOY_WEBHOOK_URL." && exit 1 +[ -z "${VORTEX_DEPLOY_WEBHOOK_METHOD}" ] && fail "Missing required value for VORTEX_DEPLOY_WEBHOOK_METHOD." && exit 1 +[ -z "${VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS}" ] && fail "Missing required value for VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS." && exit 1 -if curl --request "${DREVOPS_DEPLOY_WEBHOOK_METHOD}" --location --silent --output /dev/null --write-out "%{http_code}" "${DREVOPS_DEPLOY_WEBHOOK_URL}" | grep --quiet "${DREVOPS_DEPLOY_WEBHOOK_RESPONSE_STATUS}"; then +if curl --request "${VORTEX_DEPLOY_WEBHOOK_METHOD}" --location --silent --output /dev/null --write-out "%{http_code}" "${VORTEX_DEPLOY_WEBHOOK_URL}" | grep --quiet "${VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS}"; then note "Webhook call completed." else fail "Unable to complete webhook deployment." diff --git a/scripts/drevops/deploy.sh b/scripts/vortex/deploy.sh similarity index 54% rename from scripts/drevops/deploy.sh rename to scripts/vortex/deploy.sh index fec50c2d6..35cf32f5f 100755 --- a/scripts/drevops/deploy.sh +++ b/scripts/vortex/deploy.sh @@ -6,7 +6,7 @@ # remote hosting service via webhook call etc. # # Multiple deployments can be configured by providing a comma-separated list of -# deployment types in $DREVOPS_DEPLOY_TYPES variable. +# deployment types in $VORTEX_DEPLOY_TYPES variable. # # This is a router script to call relevant scripts based on type. # @@ -17,18 +17,18 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # The types of deployment. # # Can be a combination of comma-separated values (to support multiple # deployments): code, container_registry, webhook, lagoon. -DREVOPS_DEPLOY_TYPES="${DREVOPS_DEPLOY_TYPES:-}" +VORTEX_DEPLOY_TYPES="${VORTEX_DEPLOY_TYPES:-}" # Deployment mode. # # Values can be one of: branch, tag. -DREVOPS_DEPLOY_MODE="${DREVOPS_DEPLOY_MODE:-branch}" +VORTEX_DEPLOY_MODE="${VORTEX_DEPLOY_MODE:-branch}" # Deployment action. # @@ -36,16 +36,16 @@ DREVOPS_DEPLOY_MODE="${DREVOPS_DEPLOY_MODE:-branch}" # - deploy: Deploy code and preserve database in the environment. # - deploy_override_db: Deploy code and override database in the environment. # - destroy: Destroy the environment (if the provider supports it). -DREVOPS_DEPLOY_ACTION="${DREVOPS_DEPLOY_ACTION:-}" +VORTEX_DEPLOY_ACTION="${VORTEX_DEPLOY_ACTION:-}" # Deployment branch name. -DREVOPS_DEPLOY_BRANCH="${DREVOPS_DEPLOY_BRANCH:-}" +VORTEX_DEPLOY_BRANCH="${VORTEX_DEPLOY_BRANCH:-}" # Deployment pull request number without "pr-" prefix. -DREVOPS_DEPLOY_PR="${DREVOPS_DEPLOY_PR:-}" +VORTEX_DEPLOY_PR="${VORTEX_DEPLOY_PR:-}" # Flag to allow skipping of a deployment using additional flags. -DREVOPS_DEPLOY_ALLOW_SKIP="${DREVOPS_DEPLOY_ALLOW_SKIP:-}" +VORTEX_DEPLOY_ALLOW_SKIP="${VORTEX_DEPLOY_ALLOW_SKIP:-}" # ------------------------------------------------------------------------------ @@ -58,58 +58,58 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 info "Started deployment." -[ -z "${DREVOPS_DEPLOY_TYPES}" ] && fail "Missing required value for DREVOPS_DEPLOY_TYPES. Must be a combination of comma-separated values (to support multiple deployments): code, container_registry, webhook, lagoon." && exit 1 +[ -z "${VORTEX_DEPLOY_TYPES}" ] && fail "Missing required value for VORTEX_DEPLOY_TYPES. Must be a combination of comma-separated values (to support multiple deployments): code, container_registry, webhook, lagoon." && exit 1 -if [ "${DREVOPS_DEPLOY_ALLOW_SKIP:-}" = "1" ]; then +if [ "${VORTEX_DEPLOY_ALLOW_SKIP:-}" = "1" ]; then note "Found flag to skip a deployment." - if [ -n "${DREVOPS_DEPLOY_PR}" ]; then - # Allow skipping deployment by providing `$DREVOPS_DEPLOY_SKIP_PR_` + if [ -n "${VORTEX_DEPLOY_PR}" ]; then + # Allow skipping deployment by providing `$VORTEX_DEPLOY_SKIP_PR_` # variable with value set to "1", where `` is a PR number name with # spaces, hyphens and forward slashes replaced with underscores and then # capitalised. # # Example: - # For PR named 'pr-123', the variable name is $DREVOPS_DEPLOY_SKIP_PR_123 - pr_skip_var="DREVOPS_DEPLOY_SKIP_PR_${DREVOPS_DEPLOY_PR}" + # For PR named 'pr-123', the variable name is $VORTEX_DEPLOY_SKIP_PR_123 + pr_skip_var="VORTEX_DEPLOY_SKIP_PR_${VORTEX_DEPLOY_PR}" if [ -n "${!pr_skip_var}" ]; then - note "Found skip variable ${pr_skip_var} for PR ${DREVOPS_DEPLOY_PR}." - pass "Skipping deployment ${DREVOPS_DEPLOY_TYPES}." && exit 0 + note "Found skip variable ${pr_skip_var} for PR ${VORTEX_DEPLOY_PR}." + pass "Skipping deployment ${VORTEX_DEPLOY_TYPES}." && exit 0 fi fi - if [ -n "${DREVOPS_DEPLOY_BRANCH:-}" ]; then - # Allow skipping deployment by providing 'DREVOPS_DEPLOY_SKIP_BRANCH_' + if [ -n "${VORTEX_DEPLOY_BRANCH:-}" ]; then + # Allow skipping deployment by providing 'VORTEX_DEPLOY_SKIP_BRANCH_' # variable with value set to "1", where is a branch name with # spaces, hyphens and forward slashes replaced with underscores and then # capitalised. # # Example: - # For 'main' branch, the variable name is $DREVOPS_DEPLOY_SKIP_BRANCH_MAIN + # For 'main' branch, the variable name is $VORTEX_DEPLOY_SKIP_BRANCH_MAIN # For 'feature/my complex feature-123 update' branch, the variable name - # is $DREVOPS_DEPLOY_SKIP_BRANCH_MY_COMPLEX_FEATURE_123_UPDATE - safe_branch_name="$(echo "${DREVOPS_DEPLOY_BRANCH}" | tr -d '\n' | tr '[:space:]' '_' | tr '-' '_' | tr '/' '_' | tr -cd '[:alnum:]_' | tr '[:lower:]' '[:upper:]')" - branch_skip_var="DREVOPS_DEPLOY_SKIP_BRANCH_${safe_branch_name}" + # is $VORTEX_DEPLOY_SKIP_BRANCH_MY_COMPLEX_FEATURE_123_UPDATE + safe_branch_name="$(echo "${VORTEX_DEPLOY_BRANCH}" | tr -d '\n' | tr '[:space:]' '_' | tr '-' '_' | tr '/' '_' | tr -cd '[:alnum:]_' | tr '[:lower:]' '[:upper:]')" + branch_skip_var="VORTEX_DEPLOY_SKIP_BRANCH_${safe_branch_name}" if [ -n "${!branch_skip_var:-}" ]; then - note "Found skip variable ${branch_skip_var} for branch ${DREVOPS_DEPLOY_BRANCH}." - pass "Skipping deployment ${DREVOPS_DEPLOY_TYPES}." && exit 0 + note "Found skip variable ${branch_skip_var} for branch ${VORTEX_DEPLOY_BRANCH}." + pass "Skipping deployment ${VORTEX_DEPLOY_TYPES}." && exit 0 fi fi fi -if [ -z "${DREVOPS_DEPLOY_TYPES##*artifact*}" ]; then - [ "${DREVOPS_DEPLOY_MODE}" = "tag" ] && export DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH="deployment/[tags:-]" - ./scripts/drevops/deploy-artifact.sh +if [ -z "${VORTEX_DEPLOY_TYPES##*artifact*}" ]; then + [ "${VORTEX_DEPLOY_MODE}" = "tag" ] && export VORTEX_DEPLOY_ARTIFACT_DST_BRANCH="deployment/[tags:-]" + ./scripts/vortex/deploy-artifact.sh fi -if [ -z "${DREVOPS_DEPLOY_TYPES##*webhook*}" ]; then - ./scripts/drevops/deploy-webhook.sh +if [ -z "${VORTEX_DEPLOY_TYPES##*webhook*}" ]; then + ./scripts/vortex/deploy-webhook.sh fi -if [ -z "${DREVOPS_DEPLOY_TYPES##*container_registry*}" ]; then - ./scripts/drevops/deploy-container-registry.sh +if [ -z "${VORTEX_DEPLOY_TYPES##*container_registry*}" ]; then + ./scripts/vortex/deploy-container-registry.sh fi -if [ -z "${DREVOPS_DEPLOY_TYPES##*lagoon*}" ]; then - ./scripts/drevops/deploy-lagoon.sh +if [ -z "${VORTEX_DEPLOY_TYPES##*lagoon*}" ]; then + ./scripts/vortex/deploy-lagoon.sh fi diff --git a/scripts/drevops/doctor.sh b/scripts/vortex/doctor.sh similarity index 80% rename from scripts/drevops/doctor.sh rename to scripts/vortex/doctor.sh index b80b6b43d..22f89790a 100755 --- a/scripts/drevops/doctor.sh +++ b/scripts/vortex/doctor.sh @@ -12,55 +12,55 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Check minimal Doctor requirements. -DREVOPS_DOCTOR_CHECK_MINIMAL="${DREVOPS_DOCTOR_CHECK_MINIMAL:-0}" +VORTEX_DOCTOR_CHECK_MINIMAL="${VORTEX_DOCTOR_CHECK_MINIMAL:-0}" # Check pre-flight Doctor requirements. -DREVOPS_DOCTOR_CHECK_PREFLIGHT="${DREVOPS_DOCTOR_CHECK_PREFLIGHT:-0}" - -if [ "${DREVOPS_DOCTOR_CHECK_MINIMAL}" = "1" ]; then - DREVOPS_DOCTOR_CHECK_PORT=0 - DREVOPS_DOCTOR_CHECK_PYGMY=0 - DREVOPS_DOCTOR_CHECK_SSH=0 - DREVOPS_DOCTOR_CHECK_WEBSERVER=0 - DREVOPS_DOCTOR_CHECK_BOOTSTRAP=0 +VORTEX_DOCTOR_CHECK_PREFLIGHT="${VORTEX_DOCTOR_CHECK_PREFLIGHT:-0}" + +if [ "${VORTEX_DOCTOR_CHECK_MINIMAL}" = "1" ]; then + VORTEX_DOCTOR_CHECK_PORT=0 + VORTEX_DOCTOR_CHECK_PYGMY=0 + VORTEX_DOCTOR_CHECK_SSH=0 + VORTEX_DOCTOR_CHECK_WEBSERVER=0 + VORTEX_DOCTOR_CHECK_BOOTSTRAP=0 fi -if [ "${DREVOPS_DOCTOR_CHECK_PREFLIGHT}" = "1" ]; then - DREVOPS_DOCTOR_CHECK_TOOLS="${DREVOPS_DOCTOR_CHECK_TOOLS:-1}" - DREVOPS_DOCTOR_CHECK_PORT="${DREVOPS_DOCTOR_CHECK_PORT:-1}" - DREVOPS_DOCTOR_CHECK_PYGMY="${DREVOPS_DOCTOR_CHECK_PYGMY:-1}" - DREVOPS_DOCTOR_CHECK_CONTAINERS="${DREVOPS_DOCTOR_CHECK_CONTAINERS:-0}" - DREVOPS_DOCTOR_CHECK_SSH="${DREVOPS_DOCTOR_CHECK_SSH:-0}" - DREVOPS_DOCTOR_CHECK_WEBSERVER="${DREVOPS_DOCTOR_CHECK_WEBSERVER:-0}" - DREVOPS_DOCTOR_CHECK_BOOTSTRAP="${DREVOPS_DOCTOR_CHECK_BOOTSTRAP:-0}" +if [ "${VORTEX_DOCTOR_CHECK_PREFLIGHT}" = "1" ]; then + VORTEX_DOCTOR_CHECK_TOOLS="${VORTEX_DOCTOR_CHECK_TOOLS:-1}" + VORTEX_DOCTOR_CHECK_PORT="${VORTEX_DOCTOR_CHECK_PORT:-1}" + VORTEX_DOCTOR_CHECK_PYGMY="${VORTEX_DOCTOR_CHECK_PYGMY:-1}" + VORTEX_DOCTOR_CHECK_CONTAINERS="${VORTEX_DOCTOR_CHECK_CONTAINERS:-0}" + VORTEX_DOCTOR_CHECK_SSH="${VORTEX_DOCTOR_CHECK_SSH:-0}" + VORTEX_DOCTOR_CHECK_WEBSERVER="${VORTEX_DOCTOR_CHECK_WEBSERVER:-0}" + VORTEX_DOCTOR_CHECK_BOOTSTRAP="${VORTEX_DOCTOR_CHECK_BOOTSTRAP:-0}" fi # Check Doctor requirements for presence of tools. -DREVOPS_DOCTOR_CHECK_TOOLS="${DREVOPS_DOCTOR_CHECK_TOOLS:-1}" +VORTEX_DOCTOR_CHECK_TOOLS="${VORTEX_DOCTOR_CHECK_TOOLS:-1}" # Check Doctor requirements for port of availability. -DREVOPS_DOCTOR_CHECK_PORT="${DREVOPS_DOCTOR_CHECK_PORT:-1}" +VORTEX_DOCTOR_CHECK_PORT="${VORTEX_DOCTOR_CHECK_PORT:-1}" # Check Doctor requirements for Pygmy of availability. -DREVOPS_DOCTOR_CHECK_PYGMY="${DREVOPS_DOCTOR_CHECK_PYGMY:-1}" +VORTEX_DOCTOR_CHECK_PYGMY="${VORTEX_DOCTOR_CHECK_PYGMY:-1}" # Check Doctor requirements for container status. -DREVOPS_DOCTOR_CHECK_CONTAINERS="${DREVOPS_DOCTOR_CHECK_CONTAINERS:-1}" +VORTEX_DOCTOR_CHECK_CONTAINERS="${VORTEX_DOCTOR_CHECK_CONTAINERS:-1}" # Check Doctor requirements for SSH key. -DREVOPS_DOCTOR_CHECK_SSH="${DREVOPS_DOCTOR_CHECK_SSH:-1}" +VORTEX_DOCTOR_CHECK_SSH="${VORTEX_DOCTOR_CHECK_SSH:-1}" # Check Doctor requirements for webserver status. -DREVOPS_DOCTOR_CHECK_WEBSERVER="${DREVOPS_DOCTOR_CHECK_WEBSERVER:-1}" +VORTEX_DOCTOR_CHECK_WEBSERVER="${VORTEX_DOCTOR_CHECK_WEBSERVER:-1}" # Check Doctor requirements for application bootstrap status. -DREVOPS_DOCTOR_CHECK_BOOTSTRAP="${DREVOPS_DOCTOR_CHECK_BOOTSTRAP:-1}" +VORTEX_DOCTOR_CHECK_BOOTSTRAP="${VORTEX_DOCTOR_CHECK_BOOTSTRAP:-1}" # Default SSH key file. -DREVOPS_SSH_FILE="${DREVOPS_SSH_FILE:-${HOME}/.ssh/id_rsa}" +VORTEX_SSH_FILE="${VORTEX_SSH_FILE:-${HOME}/.ssh/id_rsa}" #------------------------------------------------------------------------------- @@ -85,7 +85,7 @@ main() { info "Checking project requirements" - if [ "${DREVOPS_DOCTOR_CHECK_TOOLS}" = "1" ]; then + if [ "${VORTEX_DOCTOR_CHECK_TOOLS}" = "1" ]; then [ "$(command_exists docker)" = "1" ] && fail "Please install Docker (https://www.docker.com/get-started)." && exit 1 [ "$(command_exists docker compose)" = "1" ] && fail "Please install docker compose (https://docs.docker.com/compose/install/)." && exit 1 [ "$(command_exists pygmy)" = "1" ] && fail "Please install Pygmy (https://pygmy.readthedocs.io/)." && exit 1 @@ -93,7 +93,7 @@ main() { pass "All required tools are present." fi - if [ "${DREVOPS_DOCTOR_CHECK_PORT}" = "1" ] && [ "${OSTYPE}" != "linux-gnu" ]; then + if [ "${VORTEX_DOCTOR_CHECK_PORT}" = "1" ] && [ "${OSTYPE}" != "linux-gnu" ]; then if lsof -i :80 | grep -v 'CLOSED' | grep 'LISTEN' | grep -vq 'om.docke'; then fail "Port 80 is occupied by a service other than Docker. Stop this service and run 'pygmy up'." exit 1 @@ -101,7 +101,7 @@ main() { pass "Port 80 is available." fi - if [ "${DREVOPS_DOCTOR_CHECK_PYGMY}" = "1" ]; then + if [ "${VORTEX_DOCTOR_CHECK_PYGMY}" = "1" ]; then pygmy_status="$(pygmy status | tr -d '\000')" pygmy_services=() @@ -120,7 +120,7 @@ main() { fi # Check that the stack is running. - if [ "${DREVOPS_DOCTOR_CHECK_CONTAINERS}" = "1" ]; then + if [ "${VORTEX_DOCTOR_CHECK_CONTAINERS}" = "1" ]; then container_services=(cli php nginx mariadb) for container_service in "${container_services[@]}"; do if ! docker compose ps --status=running --services | grep -q "${container_service}"; then @@ -133,7 +133,7 @@ main() { pass "All containers are running" fi - if [ "${DREVOPS_DOCTOR_CHECK_SSH}" = "1" ]; then + if [ "${VORTEX_DOCTOR_CHECK_SSH}" = "1" ]; then # SSH key injection is required to access Lagoon services from within # containers. For example, to connect to a production environment to run # a drush script. @@ -162,7 +162,7 @@ main() { ssh_key_volume_mounted=0 # Check that the key is injected into pygmy ssh-agent container. - if ! pygmy status 2>&1 | grep -q "${DREVOPS_SSH_FILE}"; then + if ! pygmy status 2>&1 | grep -q "${VORTEX_SSH_FILE}"; then warn "SSH key is not added to pygmy." note "The SSH key will not be available in CLI container. Run 'pygmy restart' and then 'ahoy up'" else @@ -190,8 +190,8 @@ main() { fi fi - if [ "${DREVOPS_DOCTOR_CHECK_WEBSERVER}" = "1" ]; then - local_dev_url="$(docker compose exec -T cli bash -c 'echo ${DREVOPS_LOCALDEV_URL}')" + if [ "${VORTEX_DOCTOR_CHECK_WEBSERVER}" = "1" ]; then + local_dev_url="$(docker compose exec -T cli bash -c 'echo ${VORTEX_LOCALDEV_URL}')" if [ -n "${local_dev_url}" ]; then # Depending on the type of installation, the homepage may return 200 or 403. if ! curl -L -s -o /dev/null -w "%{http_code}" "${local_dev_url}" | grep -q '200\|403'; then @@ -200,7 +200,7 @@ main() { fi pass "Web server is running and accessible at http://${local_dev_url}." - if [ "${DREVOPS_DOCTOR_CHECK_BOOTSTRAP}" = "1" ]; then + if [ "${VORTEX_DOCTOR_CHECK_BOOTSTRAP}" = "1" ]; then if ! curl -L -s -N "${local_dev_url}" | grep -q -i "charset="; then fail "Website is running, but cannot be bootstrapped. Try pulling latest container images with 'ahoy pull'." exit 1 diff --git a/scripts/drevops/download-db-acquia.sh b/scripts/vortex/download-db-acquia.sh similarity index 69% rename from scripts/drevops/download-db-acquia.sh rename to scripts/vortex/download-db-acquia.sh index 9469d6cb7..da8751efd 100755 --- a/scripts/drevops/download-db-acquia.sh +++ b/scripts/vortex/download-db-acquia.sh @@ -23,28 +23,28 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Acquia Cloud API key. -DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY:-}" +VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:-}" # Acquia Cloud API secret. -DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET:-}" +VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:-}" # Application name. Used to discover UUID. -DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-}" +VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-}" # Source environment name used to download the database dump from. -DREVOPS_DB_DOWNLOAD_ENVIRONMENT="${DREVOPS_DB_DOWNLOAD_ENVIRONMENT:-}" +VORTEX_DB_DOWNLOAD_ENVIRONMENT="${VORTEX_DB_DOWNLOAD_ENVIRONMENT:-}" # Database name within source environment used to download the database dump. -DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME="${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME:-}" +VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME="${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME:-}" # Directory where DB dumps are stored. -DREVOPS_DB_DIR="${DREVOPS_DB_DIR:-./.data}" +VORTEX_DB_DIR="${VORTEX_DB_DIR:-./.data}" # Database dump file name. -DREVOPS_DB_FILE="${DREVOPS_DB_FILE:-db.sql}" +VORTEX_DB_FILE="${VORTEX_DB_FILE:-db.sql}" #------------------------------------------------------------------------------- @@ -82,53 +82,53 @@ extract_json_value() { command -v curl >/dev/null || (fail "curl command is not available." && exit 1) # Check that all required variables are present. -[ -z "${DREVOPS_ACQUIA_KEY}" ] && fail "Missing value for DREVOPS_ACQUIA_KEY." && exit 1 -[ -z "${DREVOPS_ACQUIA_SECRET}" ] && fail "Missing value for DREVOPS_ACQUIA_SECRET." && exit 1 -[ -z "${DREVOPS_ACQUIA_APP_NAME}" ] && fail "Missing value for DREVOPS_ACQUIA_APP_NAME." && exit 1 -[ -z "${DREVOPS_DB_DOWNLOAD_ENVIRONMENT}" ] && fail "Missing value for DREVOPS_DB_DOWNLOAD_ENVIRONMENT." && exit 1 -[ -z "${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}" ] && fail "Missing value for DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME." && exit 1 +[ -z "${VORTEX_ACQUIA_KEY}" ] && fail "Missing value for VORTEX_ACQUIA_KEY." && exit 1 +[ -z "${VORTEX_ACQUIA_SECRET}" ] && fail "Missing value for VORTEX_ACQUIA_SECRET." && exit 1 +[ -z "${VORTEX_ACQUIA_APP_NAME}" ] && fail "Missing value for VORTEX_ACQUIA_APP_NAME." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_ENVIRONMENT}" ] && fail "Missing value for VORTEX_DB_DOWNLOAD_ENVIRONMENT." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}" ] && fail "Missing value for VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME." && exit 1 -mkdir -p "${DREVOPS_DB_DIR}" +mkdir -p "${VORTEX_DB_DIR}" note "Retrieving authentication token." -token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") +token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 -note "Retrieving ${DREVOPS_ACQUIA_APP_NAME} application UUID." -app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${DREVOPS_ACQUIA_APP_NAME/ /%20}") +note "Retrieving ${VORTEX_ACQUIA_APP_NAME} application UUID." +app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${VORTEX_ACQUIA_APP_NAME/ /%20}") app_uuid=$(echo "${app_uuid_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "uuid") [ -z "${app_uuid}" ] && fail "Unable to retrieve an environment UUID." && exit 1 -note "Retrieving ${DREVOPS_DB_DOWNLOAD_ENVIRONMENT} environment ID." -envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${DREVOPS_DB_DOWNLOAD_ENVIRONMENT}") +note "Retrieving ${VORTEX_DB_DOWNLOAD_ENVIRONMENT} environment ID." +envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${VORTEX_DB_DOWNLOAD_ENVIRONMENT}") env_id=$(echo "${envs_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${env_id}" ] && fail "Unable to retrieve an environment ID." && exit 1 -note "Discovering latest backup ID for DB ${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}." -backups_json=$(curl --progress-bar -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/environments/${env_id}/databases/${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}/backups?sort=created") +note "Discovering latest backup ID for DB ${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}." +backups_json=$(curl --progress-bar -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/environments/${env_id}/databases/${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}/backups?sort=created") # Acquia response has all backups sorted chronologically by created date. backup_id=$(echo "${backups_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${backup_id}" ] && fail "Unable to discover backup ID." && exit 1 # Insert backup id as a suffix. -file_extension="${DREVOPS_DB_FILE##*.}" -file_prefix="${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}_backup_" -file_name="${DREVOPS_DB_DIR}/${file_prefix}${backup_id}.${file_extension}" +file_extension="${VORTEX_DB_FILE##*.}" +file_prefix="${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}_backup_" +file_name="${VORTEX_DB_DIR}/${file_prefix}${backup_id}.${file_extension}" file_name_discovered="${file_name}" file_name_compressed="${file_name}.gz" if [ -f "${file_name_discovered}" ]; then - note "Found existing cached DB file \"${file_name_discovered}\" for DB \"${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}\"." + note "Found existing cached DB file \"${file_name_discovered}\" for DB \"${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}\"." else # If the gzipped version exists, then we don't need to re-download it. if [ ! -f "${file_name_compressed}" ]; then - note "Using the latest backup ID ${backup_id} for DB ${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}." + note "Using the latest backup ID ${backup_id} for DB ${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}." - [ ! -d "${DREVOPS_DB_DIR:-}" ] && note "Creating dump directory ${DREVOPS_DB_DIR}" && mkdir -p "${DREVOPS_DB_DIR}" + [ ! -d "${VORTEX_DB_DIR:-}" ] && note "Creating dump directory ${VORTEX_DB_DIR}" && mkdir -p "${VORTEX_DB_DIR}" note "Discovering backup URL." - backup_json=$(curl --progress-bar -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/environments/${env_id}/databases/${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}/backups/${backup_id}/actions/download") + backup_json=$(curl --progress-bar -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/environments/${env_id}/databases/${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}/backups/${backup_id}/actions/download") backup_url=$(echo "${backup_json}" | extract_json_value "url") [ -z "${backup_url}" ] && fail "Unable to discover backup URL." && exit 1 @@ -136,9 +136,9 @@ else curl --progress-bar -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "${backup_url}" -o "${file_name_compressed}" # shellcheck disable=SC2181 - [ $? -ne 0 ] && fail "Unable to download database ${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}." && exit 1 + [ $? -ne 0 ] && fail "Unable to download database ${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}." && exit 1 else - pass "Found existing cached gzipped DB file ${file_name_compressed} for DB ${DREVOPS_DB_DOWNLOAD_ACQUIA_DB_NAME}." + pass "Found existing cached gzipped DB file ${file_name_compressed} for DB ${VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME}." fi note "Expanding DB file ${file_name_compressed} into ${file_name}." @@ -148,7 +148,7 @@ else [ ! -f "${file_name}" ] || [ "${decompress_result}" != 0 ] && fail "Unable to process DB dump file \"${file_name}\"." && rm -f "${file_name_compressed}" && rm -f "${file_name}" && exit 1 fi -note "Renaming file \"${file_name}\" to \"${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}\"." -mv "${file_name}" "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" +note "Renaming file \"${file_name}\" to \"${VORTEX_DB_DIR}/${VORTEX_DB_FILE}\"." +mv "${file_name}" "${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" pass "Finished database dump download from Acquia." diff --git a/scripts/vortex/download-db-container-registry.sh b/scripts/vortex/download-db-container-registry.sh new file mode 100755 index 000000000..df972ecb9 --- /dev/null +++ b/scripts/vortex/download-db-container-registry.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +## +# Download DB dump from container image. +# +# IMPORTANT! This script runs outside the container on the host system. +# +# shellcheck disable=SC1090,SC1091,SC2015 + +t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t + +set -eu +[ "${VORTEX_DEBUG-}" = "1" ] && set -x + +# The container image containing database passed in a form of `/`. +VORTEX_DB_IMAGE="${VORTEX_DB_IMAGE:-}" + +# Container registry name. +# +# Provide port, if required as `:`. +VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY="${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY:-${VORTEX_CONTAINER_REGISTRY:-docker.io}}" + +# The username to login into the container registry. +VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_USER="${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_USER:-${VORTEX_CONTAINER_REGISTRY_USER:-}}" + +# The password to login into the container registry. +VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS="${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS:-${VORTEX_CONTAINER_REGISTRY_PASS:-}}" + +#------------------------------------------------------------------------------- + +# @formatter:off +note() { printf " %s\n" "${1}"; } +info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } +pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } +fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } +# @formatter:on + +#shellcheck disable=SC2043 +for cmd in docker; do command -v ${cmd} >/dev/null || { + fail "Command ${cmd} is not available" + exit 1 +}; done + +info "Started database data container image download." + +[ -z "${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY}" ] && fail "Missing required value for VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY." && exit 1 +[ -z "${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_USER}" ] && fail "Missing required value for VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_USER." && exit 1 +[ -z "${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS}" ] && fail "Missing required value for VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS." && exit 1 +[ -z "${VORTEX_DB_IMAGE}" ] && fail "Destination image name is not specified. Please provide container image name as a first argument to this script in a format /." && exit 1 + +docker image inspect "${VORTEX_DB_IMAGE}" >/dev/null 2>&1 && + note "Found ${VORTEX_DB_IMAGE} image on host." || + note "Not found ${VORTEX_DB_IMAGE} image on host." + +image_expanded_successfully=0 +if [ -f "${VORTEX_DB_DIR}/db.tar" ]; then + note "Found archived database container image file ${VORTEX_DB_DIR}/db.tar. Expanding..." + # Always use archived image, even if such image already exists on the host. + docker load -q --input "${VORTEX_DB_DIR}/db.tar" + + # Check that image was expanded and now exists on the host or notify + # that it will be downloaded from the registry. + if docker image inspect "${VORTEX_DB_IMAGE}" >/dev/null 2>&1; then + note "Found expanded ${VORTEX_DB_IMAGE} image on host." + image_expanded_successfully=1 + else + note "Not found expanded ${VORTEX_DB_IMAGE} image on host." + fi +fi + +if [ "${image_expanded_successfully}" -eq 0 ]; then + if [ ! -f "${VORTEX_DB_DIR}/db.tar" ] && [ -n "${VORTEX_DB_IMAGE_BASE:-}" ]; then + # If the image archive does not exist and base image was provided - use the + # base image which allows "clean slate" for the database. + note "Database container image was not found. Using base image ${VORTEX_DB_IMAGE_BASE}." + export VORTEX_DB_IMAGE="${VORTEX_DB_IMAGE_BASE}" + fi + + note "Downloading ${VORTEX_DB_IMAGE} image from the registry." + + export VORTEX_CONTAINER_REGISTRY="${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY}" + export VORTEX_CONTAINER_REGISTRY_USER="${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_USER}" + export VORTEX_CONTAINER_REGISTRY_PASS="${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_PASS}" + ./scripts/vortex/login-container-registry.sh + + docker pull "${VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY}/${VORTEX_DB_IMAGE}" +fi + +pass "Finished database data container image download." diff --git a/scripts/drevops/download-db-curl.sh b/scripts/vortex/download-db-curl.sh similarity index 76% rename from scripts/drevops/download-db-curl.sh rename to scripts/vortex/download-db-curl.sh index 94f300ba9..4fdcd1ef6 100755 --- a/scripts/drevops/download-db-curl.sh +++ b/scripts/vortex/download-db-curl.sh @@ -9,17 +9,17 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # URL of the remote database. If HTTP authentication required, it must be # included in the variable. -DREVOPS_DB_DOWNLOAD_CURL_URL="${DREVOPS_DB_DOWNLOAD_CURL_URL:-}" +VORTEX_DB_DOWNLOAD_CURL_URL="${VORTEX_DB_DOWNLOAD_CURL_URL:-}" # Directory with database dump file. -DREVOPS_DB_DIR="${DREVOPS_DB_DIR:-./.data}" +VORTEX_DB_DIR="${VORTEX_DB_DIR:-./.data}" # Database dump file name. -DREVOPS_DB_FILE="${DREVOPS_DB_FILE:-db.sql}" +VORTEX_DB_FILE="${VORTEX_DB_FILE:-db.sql}" #------------------------------------------------------------------------------- @@ -39,10 +39,10 @@ for cmd in curl; do command -v ${cmd} >/dev/null || { info "Started database dump download from CURL." # Check all required values. -[ -z "${DREVOPS_DB_DOWNLOAD_CURL_URL}" ] && echo "Missing required value for DREVOPS_DB_DOWNLOAD_CURL_URL." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_CURL_URL}" ] && echo "Missing required value for VORTEX_DB_DOWNLOAD_CURL_URL." && exit 1 -mkdir -p "${DREVOPS_DB_DIR}" +mkdir -p "${VORTEX_DB_DIR}" -curl -L "${DREVOPS_DB_DOWNLOAD_CURL_URL}" -o "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" +curl -L "${VORTEX_DB_DOWNLOAD_CURL_URL}" -o "${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" pass "Finished database dump download from CURL." diff --git a/scripts/drevops/download-db-ftp.sh b/scripts/vortex/download-db-ftp.sh similarity index 51% rename from scripts/drevops/download-db-ftp.sh rename to scripts/vortex/download-db-ftp.sh index f17b187f3..2739f209c 100755 --- a/scripts/drevops/download-db-ftp.sh +++ b/scripts/vortex/download-db-ftp.sh @@ -9,28 +9,28 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # The FTP user. -DREVOPS_DB_DOWNLOAD_FTP_USER="${DREVOPS_DB_DOWNLOAD_FTP_USER:-}" +VORTEX_DB_DOWNLOAD_FTP_USER="${VORTEX_DB_DOWNLOAD_FTP_USER:-}" # The FTP password. -DREVOPS_DB_DOWNLOAD_FTP_PASS="${DREVOPS_DB_DOWNLOAD_FTP_PASS:-}" +VORTEX_DB_DOWNLOAD_FTP_PASS="${VORTEX_DB_DOWNLOAD_FTP_PASS:-}" # The FTP host. -DREVOPS_DB_DOWNLOAD_FTP_HOST="${DREVOPS_DB_DOWNLOAD_FTP_HOST:-}" +VORTEX_DB_DOWNLOAD_FTP_HOST="${VORTEX_DB_DOWNLOAD_FTP_HOST:-}" # The FTP port. -DREVOPS_DB_DOWNLOAD_FTP_PORT="${DREVOPS_DB_DOWNLOAD_FTP_PORT:-}" +VORTEX_DB_DOWNLOAD_FTP_PORT="${VORTEX_DB_DOWNLOAD_FTP_PORT:-}" # The file name, including any directories. -DREVOPS_DB_DOWNLOAD_FTP_FILE="${DREVOPS_DB_DOWNLOAD_FTP_FILE:-}" +VORTEX_DB_DOWNLOAD_FTP_FILE="${VORTEX_DB_DOWNLOAD_FTP_FILE:-}" # Directory with database dump file. -DREVOPS_DB_DIR="${DREVOPS_DB_DIR:-./.data}" +VORTEX_DB_DIR="${VORTEX_DB_DIR:-./.data}" # Database dump file name. -DREVOPS_DB_FILE="${DREVOPS_DB_FILE:-db.sql}" +VORTEX_DB_FILE="${VORTEX_DB_FILE:-db.sql}" #------------------------------------------------------------------------------- @@ -48,16 +48,16 @@ for cmd in curl; do command -v ${cmd} >/dev/null || { }; done # Check all required values. -[ -z "${DREVOPS_DB_DOWNLOAD_FTP_USER}" ] && fail "Missing required value for DREVOPS_DB_DOWNLOAD_FTP_USER." && exit 1 -[ -z "${DREVOPS_DB_DOWNLOAD_FTP_PASS}" ] && fail "Missing required value for DREVOPS_DB_DOWNLOAD_FTP_PASS." && exit 1 -[ -z "${DREVOPS_DB_DOWNLOAD_FTP_HOST}" ] && fail "Missing required value for DREVOPS_DB_DOWNLOAD_FTP_HOST." && exit 1 -[ -z "${DREVOPS_DB_DOWNLOAD_FTP_PORT}" ] && fail "Missing required value for DREVOPS_DB_DOWNLOAD_FTP_PORT." && exit 1 -[ -z "${DREVOPS_DB_DOWNLOAD_FTP_FILE}" ] && fail "Missing required value for DREVOPS_DB_DOWNLOAD_FTP_FILE." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_FTP_USER}" ] && fail "Missing required value for VORTEX_DB_DOWNLOAD_FTP_USER." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_FTP_PASS}" ] && fail "Missing required value for VORTEX_DB_DOWNLOAD_FTP_PASS." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_FTP_HOST}" ] && fail "Missing required value for VORTEX_DB_DOWNLOAD_FTP_HOST." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_FTP_PORT}" ] && fail "Missing required value for VORTEX_DB_DOWNLOAD_FTP_PORT." && exit 1 +[ -z "${VORTEX_DB_DOWNLOAD_FTP_FILE}" ] && fail "Missing required value for VORTEX_DB_DOWNLOAD_FTP_FILE." && exit 1 info "Started database dump download from FTP." -mkdir -p "${DREVOPS_DB_DIR}" +mkdir -p "${VORTEX_DB_DIR}" -curl -u "${DREVOPS_DB_DOWNLOAD_FTP_USER}":"${DREVOPS_DB_DOWNLOAD_FTP_PASS}" "ftp://${DREVOPS_DB_DOWNLOAD_FTP_HOST}:${DREVOPS_DB_DOWNLOAD_FTP_PORT}/${DREVOPS_DB_DOWNLOAD_FTP_FILE}" -o "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" +curl -u "${VORTEX_DB_DOWNLOAD_FTP_USER}":"${VORTEX_DB_DOWNLOAD_FTP_PASS}" "ftp://${VORTEX_DB_DOWNLOAD_FTP_HOST}:${VORTEX_DB_DOWNLOAD_FTP_PORT}/${VORTEX_DB_DOWNLOAD_FTP_FILE}" -o "${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" pass "Finished database dump download from FTP." diff --git a/scripts/drevops/download-db-lagoon.sh b/scripts/vortex/download-db-lagoon.sh similarity index 54% rename from scripts/drevops/download-db-lagoon.sh rename to scripts/vortex/download-db-lagoon.sh index eebcb50c7..3060e2dbe 100755 --- a/scripts/drevops/download-db-lagoon.sh +++ b/scripts/vortex/download-db-lagoon.sh @@ -20,52 +20,52 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Flag to download a fresh copy of the database. -DREVOPS_DB_DOWNLOAD_REFRESH="${DREVOPS_DB_DOWNLOAD_REFRESH:-}" +VORTEX_DB_DOWNLOAD_REFRESH="${VORTEX_DB_DOWNLOAD_REFRESH:-}" # Lagoon project name. LAGOON_PROJECT="${LAGOON_PROJECT:?Missing required environment variable LAGOON_PROJECT.}" # The source environment branch for the database source. -DREVOPS_DB_DOWNLOAD_ENVIRONMENT="${DREVOPS_DB_DOWNLOAD_ENVIRONMENT:-main}" +VORTEX_DB_DOWNLOAD_ENVIRONMENT="${VORTEX_DB_DOWNLOAD_ENVIRONMENT:-main}" # Remote DB dump directory location. -DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR="/tmp" +VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR="/tmp" # Remote DB dump file name. Cached by the date suffix. -DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE="${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE:-db_$(date +%Y%m%d).sql}" +VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE="${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE:-db_$(date +%Y%m%d).sql}" # Wildcard file name to cleanup previously created dump files. # -# Cleanup runs only if the variable is set and $DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE +# Cleanup runs only if the variable is set and $VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE # does not exist. -DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP="${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP:-db_*.sql}" +VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP="${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP:-db_*.sql}" # SSH key fingerprint used to connect to a remote. -DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT="${DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT:-}" +VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT="${VORTEX_DB_DOWNLOAD_SSH_FINGERPRINT:-}" # Default SSH file used if custom fingerprint is not provided. -DREVOPS_DB_DOWNLOAD_SSH_FILE="${DREVOPS_DB_DOWNLOAD_SSH_FILE:-${HOME}/.ssh/id_rsa}" +VORTEX_DB_DOWNLOAD_SSH_FILE="${VORTEX_DB_DOWNLOAD_SSH_FILE:-${HOME}/.ssh/id_rsa}" # The SSH host of the Lagoon environment. -DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST="${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST:-ssh.lagoon.amazeeio.cloud}" +VORTEX_DB_DOWNLOAD_LAGOON_SSH_HOST="${VORTEX_DB_DOWNLOAD_LAGOON_SSH_HOST:-ssh.lagoon.amazeeio.cloud}" # The SSH port of the Lagoon environment. -DREVOPS_DB_DOWNLOAD_LAGOON_SSH_PORT="${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_PORT:-32222}" +VORTEX_DB_DOWNLOAD_LAGOON_SSH_PORT="${VORTEX_DB_DOWNLOAD_LAGOON_SSH_PORT:-32222}" # The SSH user of the Lagoon environment. -DREVOPS_DB_DOWNLOAD_LAGOON_SSH_USER="${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_USER:-${LAGOON_PROJECT}-${DREVOPS_DB_DOWNLOAD_ENVIRONMENT}}" +VORTEX_DB_DOWNLOAD_LAGOON_SSH_USER="${VORTEX_DB_DOWNLOAD_LAGOON_SSH_USER:-${LAGOON_PROJECT}-${VORTEX_DB_DOWNLOAD_ENVIRONMENT}}" # Directory where DB dumps are stored on the host. -DREVOPS_DB_DIR="${DREVOPS_DB_DIR:-./.data}" +VORTEX_DB_DIR="${VORTEX_DB_DIR:-./.data}" # Database dump file name on the host. -DREVOPS_DB_FILE="${DREVOPS_DB_FILE:-db.sql}" +VORTEX_DB_FILE="${VORTEX_DB_FILE:-db.sql}" # Name of the webroot directory with Drupal codebase. -DREVOPS_WEBROOT="${DREVOPS_WEBROOT:-web}" +VORTEX_WEBROOT="${VORTEX_WEBROOT:-web}" #------------------------------------------------------------------------------- @@ -83,7 +83,7 @@ for cmd in ssh rsync; do command -v ${cmd} >/dev/null || { info "Started database dump download from Lagoon." -mkdir -p "${DREVOPS_DB_DIR}" +mkdir -p "${VORTEX_DB_DIR}" # Try to read credentials from the credentials file. if [ -f ".env.local" ]; then @@ -91,15 +91,15 @@ if [ -f ".env.local" ]; then t=$(mktemp) && export -p >"${t}" && set -a && . ".env.local" && set +a && . "${t}" && rm "${t}" && unset t fi -export DREVOPS_SSH_PREFIX="DB_DOWNLOAD" && . ./scripts/drevops/setup-ssh.sh +export VORTEX_SSH_PREFIX="DB_DOWNLOAD" && . ./scripts/vortex/setup-ssh.sh ssh_opts=(-o "UserKnownHostsFile=/dev/null") ssh_opts+=(-o "StrictHostKeyChecking=no") ssh_opts+=(-o "LogLevel=error") ssh_opts+=(-o "IdentitiesOnly=yes") -ssh_opts+=(-p "${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_PORT}") -if [ "${DREVOPS_DB_DOWNLOAD_SSH_FILE:-}" != false ]; then - ssh_opts+=(-i "${DREVOPS_DB_DOWNLOAD_SSH_FILE}") +ssh_opts+=(-p "${VORTEX_DB_DOWNLOAD_LAGOON_SSH_PORT}") +if [ "${VORTEX_DB_DOWNLOAD_SSH_FILE:-}" != false ]; then + ssh_opts+=(-i "${VORTEX_DB_DOWNLOAD_SSH_FILE}") fi # Initiates an SSH connection to a remote server using provided SSH options. @@ -111,18 +111,18 @@ fi # 3. If the file exists and no refresh is requested, notifies of using the existing dump. ssh \ "${ssh_opts[@]}" \ - "${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_USER}@${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST}" service=cli container=cli \ - "if [ ! -f \"${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE}\" ] || [ \"${DREVOPS_DB_DOWNLOAD_REFRESH}\" == \"1\" ] ; then \ - [ -n \"${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP}\" ] && rm -f \"${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR}\"\/${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP} && echo \"Removed previously created DB dumps.\"; \ - echo \" > Creating a database dump ${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE}.\"; \ - /app/vendor/bin/drush --root=./${DREVOPS_WEBROOT} sql:dump --structure-tables-key=common --structure-tables-list=ban,event_log_track,flood,login_security_track,purge_queue,queue,webform_submission,webform_submission_data,webform_submission_log,watchdog,cache* --extra-dump=--no-tablespaces > \"${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE}\"; \ + "${VORTEX_DB_DOWNLOAD_LAGOON_SSH_USER}@${VORTEX_DB_DOWNLOAD_LAGOON_SSH_HOST}" service=cli container=cli \ + "if [ ! -f \"${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE}\" ] || [ \"${VORTEX_DB_DOWNLOAD_REFRESH}\" == \"1\" ] ; then \ + [ -n \"${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP}\" ] && rm -f \"${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR}\"\/${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP} && echo \"Removed previously created DB dumps.\"; \ + echo \" > Creating a database dump ${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE}.\"; \ + /app/vendor/bin/drush --root=./${VORTEX_WEBROOT} sql:dump --structure-tables-key=common --structure-tables-list=ban,event_log_track,flood,login_security_track,purge_queue,queue,webform_submission,webform_submission_data,webform_submission_log,watchdog,cache* --extra-dump=--no-tablespaces > \"${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE}\"; \ else \ - echo \" > Using existing dump ${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE}.\"; \ + echo \" > Using existing dump ${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR}/${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE}.\"; \ fi" note "Downloading a database dump." ssh_opts_string="${ssh_opts[@]}" rsync_opts=(-e "ssh ${ssh_opts_string}") -rsync "${rsync_opts[@]}" "${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_USER}@${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST}":"${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_DIR}"/"${DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE}" "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" +rsync "${rsync_opts[@]}" "${VORTEX_DB_DOWNLOAD_LAGOON_SSH_USER}@${VORTEX_DB_DOWNLOAD_LAGOON_SSH_HOST}":"${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_DIR}"/"${VORTEX_DB_DOWNLOAD_LAGOON_REMOTE_FILE}" "${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" pass "Finished database dump download from Lagoon." diff --git a/scripts/drevops/download-db.sh b/scripts/vortex/download-db.sh similarity index 52% rename from scripts/drevops/download-db.sh rename to scripts/vortex/download-db.sh index 4aca8b113..7081f6230 100755 --- a/scripts/drevops/download-db.sh +++ b/scripts/vortex/download-db.sh @@ -11,18 +11,18 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Note that `container_registry` works only for database-in-image -# database storage (when $DREVOPS_DB_IMAGE variable has a value). -DREVOPS_DB_DOWNLOAD_SOURCE="${DREVOPS_DB_DOWNLOAD_SOURCE:-curl}" +# database storage (when $VORTEX_DB_IMAGE variable has a value). +VORTEX_DB_DOWNLOAD_SOURCE="${VORTEX_DB_DOWNLOAD_SOURCE:-curl}" # Force DB download even if the cache exists. # Usually set in CircleCI UI to override per build cache. -DREVOPS_DB_DOWNLOAD_FORCE="${DREVOPS_DB_DOWNLOAD_FORCE:-}" +VORTEX_DB_DOWNLOAD_FORCE="${VORTEX_DB_DOWNLOAD_FORCE:-}" # Proceed with download. -DREVOPS_DB_DOWNLOAD_PROCEED="${DREVOPS_DB_DOWNLOAD_PROCEED:-1}" +VORTEX_DB_DOWNLOAD_PROCEED="${VORTEX_DB_DOWNLOAD_PROCEED:-1}" # ------------------------------------------------------------------------------ @@ -35,49 +35,49 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 info "Started database download." -[ "${DREVOPS_DB_DOWNLOAD_PROCEED}" != "1" ] && pass "Skipping database download as DB_DOWNLOAD_PROCEED is not set to 1." && exit 0 +[ "${VORTEX_DB_DOWNLOAD_PROCEED}" != "1" ] && pass "Skipping database download as DB_DOWNLOAD_PROCEED is not set to 1." && exit 0 # Check if database file exists. -# @todo: Implement better support based on $DREVOPS_DB_FILE instead of hardcoded 'db*' name. -[ -d "${DREVOPS_DB_DIR:-}" ] && found_db=$(find "${DREVOPS_DB_DIR}" -name "db*.sql" -o -name "db*.tar") +# @todo: Implement better support based on $VORTEX_DB_FILE instead of hardcoded 'db*' name. +[ -d "${VORTEX_DB_DIR:-}" ] && found_db=$(find "${VORTEX_DB_DIR}" -name "db*.sql" -o -name "db*.tar") if [ -n "${found_db:-}" ]; then note "Found existing database dump file(s)." - ls -Alh "${DREVOPS_DB_DIR}" || true + ls -Alh "${VORTEX_DB_DIR}" || true - if [ "${DREVOPS_DB_DOWNLOAD_FORCE}" != "1" ]; then + if [ "${VORTEX_DB_DOWNLOAD_FORCE}" != "1" ]; then note "Using existing database dump file(s)." note "Download will not proceed." - note "Remove existing database file or set DREVOPS_DB_DOWNLOAD_FORCE value to 1 to force download." + note "Remove existing database file or set VORTEX_DB_DOWNLOAD_FORCE value to 1 to force download." exit 0 else note "Forcefully downloading database." fi fi -if [ "${DREVOPS_DB_DOWNLOAD_SOURCE}" = "ftp" ]; then - ./scripts/drevops/download-db-ftp.sh +if [ "${VORTEX_DB_DOWNLOAD_SOURCE}" = "ftp" ]; then + ./scripts/vortex/download-db-ftp.sh fi -if [ "${DREVOPS_DB_DOWNLOAD_SOURCE}" = "curl" ]; then - ./scripts/drevops/download-db-curl.sh +if [ "${VORTEX_DB_DOWNLOAD_SOURCE}" = "curl" ]; then + ./scripts/vortex/download-db-curl.sh fi -if [ "${DREVOPS_DB_DOWNLOAD_SOURCE}" = "acquia" ]; then - ./scripts/drevops/download-db-acquia.sh +if [ "${VORTEX_DB_DOWNLOAD_SOURCE}" = "acquia" ]; then + ./scripts/vortex/download-db-acquia.sh fi -if [ "${DREVOPS_DB_DOWNLOAD_SOURCE}" = "lagoon" ]; then - ./scripts/drevops/download-db-lagoon.sh +if [ "${VORTEX_DB_DOWNLOAD_SOURCE}" = "lagoon" ]; then + ./scripts/vortex/download-db-lagoon.sh fi -if [ "${DREVOPS_DB_DOWNLOAD_SOURCE}" = "container_registry" ]; then - ./scripts/drevops/download-db-container-registry.sh +if [ "${VORTEX_DB_DOWNLOAD_SOURCE}" = "container_registry" ]; then + ./scripts/vortex/download-db-container-registry.sh fi -ls -Alh "${DREVOPS_DB_DIR}" || true +ls -Alh "${VORTEX_DB_DIR}" || true # Create a semaphore file to indicate that the database has been downloaded. -[ -n "${DREVOPS_DB_DOWNLOAD_SEMAPHORE:-}" ] && touch "${DREVOPS_DB_DOWNLOAD_SEMAPHORE}" +[ -n "${VORTEX_DB_DOWNLOAD_SEMAPHORE:-}" ] && touch "${VORTEX_DB_DOWNLOAD_SEMAPHORE}" pass "Finished database download." diff --git a/scripts/drevops/export-db-file.sh b/scripts/vortex/export-db-file.sh similarity index 86% rename from scripts/drevops/export-db-file.sh rename to scripts/vortex/export-db-file.sh index 47df80ccb..05cc65fd3 100755 --- a/scripts/drevops/export-db-file.sh +++ b/scripts/vortex/export-db-file.sh @@ -7,10 +7,10 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Directory with database dump file. -DREVOPS_DB_EXPORT_FILE_DIR="${DREVOPS_DB_EXPORT_FILE_DIR:-${DREVOPS_DB_DIR:-./.data}}" +VORTEX_DB_EXPORT_FILE_DIR="${VORTEX_DB_EXPORT_FILE_DIR:-${VORTEX_DB_DIR:-./.data}}" # ------------------------------------------------------------------------------ @@ -27,7 +27,7 @@ drush() { ./vendor/bin/drush -y "$@"; } # Create dump file name with a timestamp or use the file name provided # as a first argument. -dump_file=$([ "${1:-}" ] && echo "${DREVOPS_DB_EXPORT_FILE_DIR}/${1}" || echo "${DREVOPS_DB_EXPORT_FILE_DIR}/export_db_$(date +%Y%m%d_%H%M%S).sql") +dump_file=$([ "${1:-}" ] && echo "${VORTEX_DB_EXPORT_FILE_DIR}/${1}" || echo "${VORTEX_DB_EXPORT_FILE_DIR}/export_db_$(date +%Y%m%d_%H%M%S).sql") # If dump file is relative - update it to the parent directory, because the # `drush sql:dump` command result file is relative to Drupal root, but provided diff --git a/scripts/drevops/export-db-image.sh b/scripts/vortex/export-db-image.sh similarity index 60% rename from scripts/drevops/export-db-image.sh rename to scripts/vortex/export-db-image.sh index e8abdd7fd..55c71d225 100755 --- a/scripts/drevops/export-db-image.sh +++ b/scripts/vortex/export-db-image.sh @@ -7,22 +7,22 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Container image archive file name. -DREVOPS_DB_EXPORT_IMAGE_ARCHIVE_FILE="${DREVOPS_DB_EXPORT_IMAGE_ARCHIVE_FILE:-${1}}" +VORTEX_DB_EXPORT_IMAGE_ARCHIVE_FILE="${VORTEX_DB_EXPORT_IMAGE_ARCHIVE_FILE:-${1}}" # Container image to store in a form of `/`. -DREVOPS_DB_EXPORT_IMAGE="${DREVOPS_DB_EXPORT_IMAGE:-}" +VORTEX_DB_EXPORT_IMAGE="${VORTEX_DB_EXPORT_IMAGE:-}" # Container registry name. -DREVOPS_DB_EXPORT_CONTAINER_REGISTRY="${DREVOPS_DB_EXPORT_CONTAINER_REGISTRY:-${DREVOPS_CONTAINER_REGISTRY:-docker.io}}" +VORTEX_DB_EXPORT_CONTAINER_REGISTRY="${VORTEX_DB_EXPORT_CONTAINER_REGISTRY:-${VORTEX_CONTAINER_REGISTRY:-docker.io}}" # The service name to capture. -DREVOPS_DB_EXPORT_SERVICE_NAME="${DREVOPS_DB_EXPORT_SERVICE_NAME:-mariadb}" +VORTEX_DB_EXPORT_SERVICE_NAME="${VORTEX_DB_EXPORT_SERVICE_NAME:-mariadb}" # Directory with database image archive file. -DREVOPS_DB_EXPORT_IMAGE_DIR="${DREVOPS_DB_EXPORT_IMAGE_DIR:-${DREVOPS_DB_DIR}}" +VORTEX_DB_EXPORT_IMAGE_DIR="${VORTEX_DB_EXPORT_IMAGE_DIR:-${VORTEX_DB_DIR}}" # ------------------------------------------------------------------------------ @@ -41,23 +41,23 @@ for cmd in docker; do command -v ${cmd} >/dev/null || { info "Started database data container image export." -[ -z "${DREVOPS_DB_EXPORT_IMAGE}" ] && fail "Destination image name is not specified. Please provide container image as a variable DREVOPS_DB_EXPORT_IMAGE in a format /." && exit 1 +[ -z "${VORTEX_DB_EXPORT_IMAGE}" ] && fail "Destination image name is not specified. Please provide container image as a variable VORTEX_DB_EXPORT_IMAGE in a format /." && exit 1 -cid="$(docker compose ps -q "${DREVOPS_DB_EXPORT_SERVICE_NAME}")" -note "Found ${DREVOPS_DB_EXPORT_SERVICE_NAME} service container with id ${cid}." +cid="$(docker compose ps -q "${VORTEX_DB_EXPORT_SERVICE_NAME}")" +note "Found ${VORTEX_DB_EXPORT_SERVICE_NAME} service container with id ${cid}." -new_image="${DREVOPS_DB_EXPORT_CONTAINER_REGISTRY}/${DREVOPS_DB_EXPORT_IMAGE}" +new_image="${VORTEX_DB_EXPORT_CONTAINER_REGISTRY}/${VORTEX_DB_EXPORT_IMAGE}" note "Locking and unlocking tables before upgrade." -docker compose exec -T "${DREVOPS_DB_EXPORT_SERVICE_NAME}" mysql -e "FLUSH TABLES WITH READ LOCK;" +docker compose exec -T "${VORTEX_DB_EXPORT_SERVICE_NAME}" mysql -e "FLUSH TABLES WITH READ LOCK;" sleep 5 -docker compose exec -T "${DREVOPS_DB_EXPORT_SERVICE_NAME}" mysql -e "UNLOCK TABLES;" +docker compose exec -T "${VORTEX_DB_EXPORT_SERVICE_NAME}" mysql -e "UNLOCK TABLES;" note "Running forced service upgrade." -docker compose exec -T "${DREVOPS_DB_EXPORT_SERVICE_NAME}" sh -c "mysql_upgrade --force" +docker compose exec -T "${VORTEX_DB_EXPORT_SERVICE_NAME}" sh -c "mysql_upgrade --force" note "Locking tables after upgrade." -docker compose exec -T "${DREVOPS_DB_EXPORT_SERVICE_NAME}" mysql -e "FLUSH TABLES WITH READ LOCK;" +docker compose exec -T "${VORTEX_DB_EXPORT_SERVICE_NAME}" mysql -e "FLUSH TABLES WITH READ LOCK;" note "Committing exported container image with name ${new_image}." iid=$(docker commit "${cid}" "${new_image}") @@ -65,11 +65,11 @@ iid="${iid#sha256:}" note "Committed exported container image with id ${iid}." # Create directory to store database dump. -mkdir -p "${DREVOPS_DB_EXPORT_IMAGE_DIR}" +mkdir -p "${VORTEX_DB_EXPORT_IMAGE_DIR}" # Create dump file name with a timestamp or use the file name provided # as a first argument. Also, make sure that the extension is correct. -archive_file=$([ "${DREVOPS_DB_EXPORT_IMAGE_ARCHIVE_FILE}" ] && echo "${DREVOPS_DB_EXPORT_IMAGE_DIR}/${DREVOPS_DB_EXPORT_IMAGE_ARCHIVE_FILE//.sql/.tar}" || echo "${DREVOPS_DB_EXPORT_IMAGE_DIR}/export_db_$(date +%Y%m%d_%H%M%S).tar") +archive_file=$([ "${VORTEX_DB_EXPORT_IMAGE_ARCHIVE_FILE}" ] && echo "${VORTEX_DB_EXPORT_IMAGE_DIR}/${VORTEX_DB_EXPORT_IMAGE_ARCHIVE_FILE//.sql/.tar}" || echo "${VORTEX_DB_EXPORT_IMAGE_DIR}/export_db_$(date +%Y%m%d_%H%M%S).tar") note "Exporting database image archive to file ${archive_file}." diff --git a/scripts/drevops/export-db.sh b/scripts/vortex/export-db.sh similarity index 75% rename from scripts/drevops/export-db.sh rename to scripts/vortex/export-db.sh index 6d927ad31..2549c0281 100755 --- a/scripts/drevops/export-db.sh +++ b/scripts/vortex/export-db.sh @@ -9,12 +9,12 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Name of the database container image to use. 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="${DREVOPS_DB_IMAGE:-}" +VORTEX_DB_IMAGE="${VORTEX_DB_IMAGE:-}" # ------------------------------------------------------------------------------ @@ -33,18 +33,18 @@ for cmd in docker; do command -v ${cmd} >/dev/null || { info "Started database export." -if [ -z "${DREVOPS_DB_IMAGE}" ]; then +if [ -z "${VORTEX_DB_IMAGE}" ]; then # Export database as a file. - docker compose exec -T cli ./scripts/drevops/export-db-file.sh "$@" + docker compose exec -T cli ./scripts/vortex/export-db-file.sh "$@" else # Export database as a container image. - DREVOPS_DB_EXPORT_IMAGE="${DREVOPS_DB_IMAGE}" ./scripts/drevops/export-db-image.sh "$@" + VORTEX_DB_EXPORT_IMAGE="${VORTEX_DB_IMAGE}" ./scripts/vortex/export-db-image.sh "$@" # Deploy container image. # @todo Move deployment into a separate script. - if [ "${DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED:-}" = "1" ]; then - DREVOPS_DEPLOY_CONTAINER_REGISTRY_MAP=mariadb=${DREVOPS_DB_IMAGE} \ - ./scripts/drevops/deploy-container-registry.sh + if [ "${VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED:-}" = "1" ]; then + VORTEX_DEPLOY_CONTAINER_REGISTRY_MAP=mariadb=${VORTEX_DB_IMAGE} \ + ./scripts/vortex/deploy-container-registry.sh fi fi diff --git a/scripts/drevops/github-labels.sh b/scripts/vortex/github-labels.sh similarity index 93% rename from scripts/drevops/github-labels.sh rename to scripts/vortex/github-labels.sh index 618fcaec1..89f957d28 100755 --- a/scripts/drevops/github-labels.sh +++ b/scripts/vortex/github-labels.sh @@ -8,23 +8,23 @@ # # Silent, if $GITHUB_TOKEN or $GITHUB_TOKEN is set in an environment and # a repository provided as an argument: -# GITHUB_TOKEN=ghp_123 DREVOPS_GITHUB_REPO=myorg/myrepo ./github-labels.sh +# GITHUB_TOKEN=ghp_123 VORTEX_GITHUB_REPO=myorg/myrepo ./github-labels.sh # # shellcheck disable=SC1090,SC1091,SC2155 t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # GitHub repository as "org/name" to perform operations on. -DREVOPS_GITHUB_REPO="${DREVOPS_GITHUB_REPO:-${1:-}}" +VORTEX_GITHUB_REPO="${VORTEX_GITHUB_REPO:-${1:-}}" # GitHub token to perform operations. GITHUB_TOKEN="${GITHUB_TOKEN:-}" # Delete existing labels to mirror the list below. -DREVOPS_GITHUB_DELETE_EXISTING_LABELS="${DREVOPS_GITHUB_DELETE_EXISTING_LABELS:-1}" +VORTEX_GITHUB_DELETE_EXISTING_LABELS="${VORTEX_GITHUB_DELETE_EXISTING_LABELS:-1}" # ------------------------------------------------------------------------------ @@ -85,7 +85,7 @@ main() { info "Processing GitHub labels." echo - if [ "${DREVOPS_GITHUB_DELETE_EXISTING_LABELS:-}" = "1" ]; then + if [ "${VORTEX_GITHUB_DELETE_EXISTING_LABELS:-}" = "1" ]; then echo " This script will remove the default GitHub labels." else echo " This script will not remove the default GitHub labels." @@ -94,13 +94,13 @@ main() { echo " A personal access token is required to access private repositories." echo - if [ "${DREVOPS_GITHUB_REPO}" = "" ]; then + if [ "${VORTEX_GITHUB_REPO}" = "" ]; then echo '' echo -n 'Enter GitHub Org/Repo (e.g. myorg/myrepo): ' - read -r DREVOPS_GITHUB_REPO + read -r VORTEX_GITHUB_REPO fi - [ "${DREVOPS_GITHUB_REPO}" = "" ] && fail "GitHub repository name is required" && exit 1 + [ "${VORTEX_GITHUB_REPO}" = "" ] && fail "GitHub repository name is required" && exit 1 if [ "${GITHUB_TOKEN}" = "" ]; then echo '' @@ -109,8 +109,8 @@ main() { fi [ "${GITHUB_TOKEN}" = "" ] && fail "GitHub token is required" && exit 1 - repo_org=$(echo "${DREVOPS_GITHUB_REPO}" | cut -f1 -d /) - repo_name=$(echo "${DREVOPS_GITHUB_REPO}" | cut -f2 -d /) + repo_org=$(echo "${VORTEX_GITHUB_REPO}" | cut -f1 -d /) + repo_name=$(echo "${VORTEX_GITHUB_REPO}" | cut -f2 -d /) if ! user_has_access; then fail "User does not have access to specified repository. Please check your credentials" && exit 1 @@ -123,7 +123,7 @@ main() { timeout 5 echo - if [ "${DREVOPS_GITHUB_DELETE_EXISTING_LABELS}" = "1" ]; then + if [ "${VORTEX_GITHUB_DELETE_EXISTING_LABELS}" = "1" ]; then note "Checking existing labels" existing_labels_strings="$(label_all)" # shellcheck disable=SC2207 diff --git a/scripts/drevops/info.sh b/scripts/vortex/info.sh similarity index 62% rename from scripts/drevops/info.sh rename to scripts/vortex/info.sh index fcadc45d6..4b8d97f3a 100755 --- a/scripts/drevops/info.sh +++ b/scripts/vortex/info.sh @@ -7,13 +7,13 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Name of the webroot directory with Drupal codebase. -DREVOPS_WEBROOT="${DREVOPS_WEBROOT:-web}" +VORTEX_WEBROOT="${VORTEX_WEBROOT:-web}" # Show one-time login link. -DREVOPS_SHOW_LOGIN="${DREVOPS_SHOW_LOGIN:-}" +VORTEX_SHOW_LOGIN="${VORTEX_SHOW_LOGIN:-}" # ------------------------------------------------------------------------------ @@ -24,34 +24,34 @@ pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } # @formatter:on -[ -n "${DREVOPS_HOST_HAS_SEQUELACE:-}" ] && sequelace="('ahoy db' to start SequelAce)" || sequelace="" +[ -n "${VORTEX_HOST_HAS_SEQUELACE:-}" ] && sequelace="('ahoy db' to start SequelAce)" || sequelace="" info "Project information" echo -note "Project name : ${DREVOPS_PROJECT}" +note "Project name : ${VORTEX_PROJECT}" note "Docker Compose project name : ${COMPOSE_PROJECT_NAME:-}" -note "Site local URL : http://${DREVOPS_LOCALDEV_URL}" -note "Path to web root : $(pwd)/${DREVOPS_WEBROOT}" +note "Site local URL : http://${VORTEX_LOCALDEV_URL}" +note "Path to web root : $(pwd)/${VORTEX_WEBROOT}" note "DB host : ${MARIADB_HOST}" note "DB username : ${MARIADB_USERNAME}" note "DB password : ${MARIADB_PASSWORD}" note "DB port : ${MARIADB_PORT}" -note "DB port on host : ${DREVOPS_HOST_DB_PORT} ${sequelace}" -if [ -n "${DREVOPS_DB_IMAGE:-}" ]; then - note "DB-in-image : ${DREVOPS_DB_IMAGE}" +note "DB port on host : ${VORTEX_HOST_DB_PORT} ${sequelace}" +if [ -n "${VORTEX_DB_IMAGE:-}" ]; then + note "DB-in-image : ${VORTEX_DB_IMAGE}" fi -if [ -n "${DREVOPS_HOST_SOLR_PORT:-}" ]; then - note "Solr URL on host : http://127.0.0.1:${DREVOPS_HOST_SOLR_PORT}" +if [ -n "${VORTEX_HOST_SOLR_PORT:-}" ]; then + note "Solr URL on host : http://127.0.0.1:${VORTEX_HOST_SOLR_PORT}" fi -if [ -n "${DREVOPS_HOST_SELENIUM_VNC_PORT:-}" ]; then - note "Selenium VNC URL on host : http://localhost:${DREVOPS_HOST_SELENIUM_VNC_PORT}/?autoconnect=1&password=secret" +if [ -n "${VORTEX_HOST_SELENIUM_VNC_PORT:-}" ]; then + note "Selenium VNC URL on host : http://localhost:${VORTEX_HOST_SELENIUM_VNC_PORT}/?autoconnect=1&password=secret" fi note "Mailhog URL : http://mailhog.docker.amazee.io/" note "Xdebug : $(php -v | grep -q Xdebug && echo "Enabled ('ahoy up cli' to disable)" || echo "Disabled ('ahoy debug' to enable)")" -if [ "${DREVOPS_SHOW_LOGIN}" = "1" ] || [ -n "${1:-}" ]; then +if [ "${VORTEX_SHOW_LOGIN}" = "1" ] || [ -n "${1:-}" ]; then echo -n " Site login link : " - ./scripts/drevops/login.sh + ./scripts/vortex/login.sh else echo note "Use 'ahoy login' to generate Drupal login link." diff --git a/scripts/drevops/login-container-registry.sh b/scripts/vortex/login-container-registry.sh similarity index 52% rename from scripts/drevops/login-container-registry.sh rename to scripts/vortex/login-container-registry.sh index 453f96eba..5b21bfbb8 100755 --- a/scripts/drevops/login-container-registry.sh +++ b/scripts/vortex/login-container-registry.sh @@ -12,18 +12,18 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Container registry name. # # Provide port, if required as `:`. -DREVOPS_CONTAINER_REGISTRY="${DREVOPS_CONTAINER_REGISTRY:-docker.io}" +VORTEX_CONTAINER_REGISTRY="${VORTEX_CONTAINER_REGISTRY:-docker.io}" # The username to login into the container registry. -DREVOPS_CONTAINER_REGISTRY_USER="${DREVOPS_CONTAINER_REGISTRY_USER?Missing required value for DREVOPS_CONTAINER_REGISTRY_USER.}" +VORTEX_CONTAINER_REGISTRY_USER="${VORTEX_CONTAINER_REGISTRY_USER?Missing required value for VORTEX_CONTAINER_REGISTRY_USER.}" # The password to login into the container registry. -DREVOPS_CONTAINER_REGISTRY_PASS="${DREVOPS_CONTAINER_REGISTRY_PASS?Missing required value for DREVOPS_CONTAINER_REGISTRY_PASS.}" +VORTEX_CONTAINER_REGISTRY_PASS="${VORTEX_CONTAINER_REGISTRY_PASS?Missing required value for VORTEX_CONTAINER_REGISTRY_PASS.}" # ------------------------------------------------------------------------------ @@ -40,13 +40,13 @@ for cmd in docker; do command -v ${cmd} >/dev/null || { exit 1 }; done -[ -z "${DREVOPS_CONTAINER_REGISTRY}" ] && fail "Missing required value for DREVOPS_CONTAINER_REGISTRY." && exit 1 +[ -z "${VORTEX_CONTAINER_REGISTRY}" ] && fail "Missing required value for VORTEX_CONTAINER_REGISTRY." && exit 1 -if [ -f "${HOME}/.docker/config.json" ] && grep -q "${DREVOPS_CONTAINER_REGISTRY}" "${HOME}/.docker/config.json"; then - note "Already logged in to the registry \"${DREVOPS_CONTAINER_REGISTRY}\"." -elif [ -n "${DREVOPS_CONTAINER_REGISTRY_USER}" ] && [ -n "${DREVOPS_CONTAINER_REGISTRY_PASS}" ]; then - note "Logging in to registry \"${DREVOPS_CONTAINER_REGISTRY}\"." - echo "${DREVOPS_CONTAINER_REGISTRY_PASS}" | docker login --username "${DREVOPS_CONTAINER_REGISTRY_USER}" --password-stdin "${DREVOPS_CONTAINER_REGISTRY}" +if [ -f "${HOME}/.docker/config.json" ] && grep -q "${VORTEX_CONTAINER_REGISTRY}" "${HOME}/.docker/config.json"; then + note "Already logged in to the registry \"${VORTEX_CONTAINER_REGISTRY}\"." +elif [ -n "${VORTEX_CONTAINER_REGISTRY_USER}" ] && [ -n "${VORTEX_CONTAINER_REGISTRY_PASS}" ]; then + note "Logging in to registry \"${VORTEX_CONTAINER_REGISTRY}\"." + echo "${VORTEX_CONTAINER_REGISTRY_PASS}" | docker login --username "${VORTEX_CONTAINER_REGISTRY_USER}" --password-stdin "${VORTEX_CONTAINER_REGISTRY}" else - note "Skipping login into the container registry as eithe DREVOPS_CONTAINER_REGISTRY_USER or DREVOPS_CONTAINER_REGISTRY_PASS was not provided." + note "Skipping login into the container registry as eithe VORTEX_CONTAINER_REGISTRY_USER or VORTEX_CONTAINER_REGISTRY_PASS was not provided." fi diff --git a/scripts/drevops/login.sh b/scripts/vortex/login.sh similarity index 97% rename from scripts/drevops/login.sh rename to scripts/vortex/login.sh index ca9061239..9aeb40cb3 100755 --- a/scripts/drevops/login.sh +++ b/scripts/vortex/login.sh @@ -7,7 +7,7 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Flag to block or unblock admin. DRUPAL_UNBLOCK_ADMIN="${DRUPAL_UNBLOCK_ADMIN:-1}" diff --git a/scripts/drevops/logout.sh b/scripts/vortex/logout.sh similarity index 94% rename from scripts/drevops/logout.sh rename to scripts/vortex/logout.sh index 86b40b1f5..73769d405 100755 --- a/scripts/drevops/logout.sh +++ b/scripts/vortex/logout.sh @@ -7,7 +7,7 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Flag to block or unblock admin. DRUPAL_UNBLOCK_ADMIN="${DRUPAL_UNBLOCK_ADMIN:-1}" diff --git a/scripts/drevops/mirror-code.sh b/scripts/vortex/mirror-code.sh similarity index 54% rename from scripts/drevops/mirror-code.sh rename to scripts/vortex/mirror-code.sh index 154af9b25..15818784a 100755 --- a/scripts/drevops/mirror-code.sh +++ b/scripts/vortex/mirror-code.sh @@ -9,31 +9,31 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Source branch name to mirror code. -DREVOPS_MIRROR_CODE_BRANCH_SRC="${DREVOPS_MIRROR_CODE_BRANCH_SRC:-${1}}" +VORTEX_MIRROR_CODE_BRANCH_SRC="${VORTEX_MIRROR_CODE_BRANCH_SRC:-${1}}" # Destination branch name to mirror code. -DREVOPS_MIRROR_CODE_BRANCH_DST="${DREVOPS_MIRROR_CODE_BRANCH_DST:-${2}}" +VORTEX_MIRROR_CODE_BRANCH_DST="${VORTEX_MIRROR_CODE_BRANCH_DST:-${2}}" # Destination remote name. -DREVOPS_MIRROR_CODE_REMOTE_DST="${DREVOPS_MIRROR_CODE_REMOTE_DST:-origin}" +VORTEX_MIRROR_CODE_REMOTE_DST="${VORTEX_MIRROR_CODE_REMOTE_DST:-origin}" # Flag to push the branch. -DREVOPS_MIRROR_CODE_PUSH="${DREVOPS_MIRROR_CODE_PUSH:-}" +VORTEX_MIRROR_CODE_PUSH="${VORTEX_MIRROR_CODE_PUSH:-}" # SSH key fingerprint used to connect to a remote. -DREVOPS_MIRROR_CODE_SSH_FINGERPRINT="${DREVOPS_MIRROR_CODE_SSH_FINGERPRINT:-}" +VORTEX_MIRROR_CODE_SSH_FINGERPRINT="${VORTEX_MIRROR_CODE_SSH_FINGERPRINT:-}" # Default SSH file used if custom fingerprint is not provided. -DREVOPS_MIRROR_CODE_SSH_FILE="${DREVOPS_MIRROR_CODE_SSH_FILE:-}" +VORTEX_MIRROR_CODE_SSH_FILE="${VORTEX_MIRROR_CODE_SSH_FILE:-}" # Email address of the user who will be committing to a remote repository. -DREVOPS_MIRROR_CODE_GIT_USER_NAME="${DREVOPS_MIRROR_CODE_GIT_USER_NAME:-"Deployment Robot"}" +VORTEX_MIRROR_CODE_GIT_USER_NAME="${VORTEX_MIRROR_CODE_GIT_USER_NAME:-"Deployment Robot"}" # Name of the user who will be committing to a remote repository. -DREVOPS_MIRROR_CODE_GIT_USER_EMAIL="${DREVOPS_MIRROR_CODE_GIT_USER_EMAIL:-}" +VORTEX_MIRROR_CODE_GIT_USER_EMAIL="${VORTEX_MIRROR_CODE_GIT_USER_EMAIL:-}" # ------------------------------------------------------------------------------ @@ -52,17 +52,17 @@ for cmd in git rsync; do command -v ${cmd} >/dev/null || { info "Started code mirroring." # Check all required values. -[ -z "${DREVOPS_MIRROR_CODE_BRANCH_SRC}" ] && fail "Missing required value for DREVOPS_MIRROR_CODE_BRANCH_SRC." && exit 1 -[ -z "${DREVOPS_MIRROR_CODE_BRANCH_DST}" ] && fail "Missing required value for DREVOPS_MIRROR_CODE_BRANCH_SRC_REMOTE." && exit 1 -[ -z "${DREVOPS_MIRROR_CODE_REMOTE_DST}" ] && fail "Missing required value for DREVOPS_MIRROR_CODE_REMOTE_DST." && exit 1 -[ -z "${DREVOPS_MIRROR_CODE_GIT_USER_NAME}" ] && fail "Missing required value for DREVOPS_MIRROR_CODE_USER_NAME." && exit 1 -[ -z "${DREVOPS_MIRROR_CODE_GIT_USER_EMAIL}" ] && fail "Missing required value for DREVOPS_MIRROR_CODE_GIT_USER_EMAIL." && exit 1 +[ -z "${VORTEX_MIRROR_CODE_BRANCH_SRC}" ] && fail "Missing required value for VORTEX_MIRROR_CODE_BRANCH_SRC." && exit 1 +[ -z "${VORTEX_MIRROR_CODE_BRANCH_DST}" ] && fail "Missing required value for VORTEX_MIRROR_CODE_BRANCH_SRC_REMOTE." && exit 1 +[ -z "${VORTEX_MIRROR_CODE_REMOTE_DST}" ] && fail "Missing required value for VORTEX_MIRROR_CODE_REMOTE_DST." && exit 1 +[ -z "${VORTEX_MIRROR_CODE_GIT_USER_NAME}" ] && fail "Missing required value for VORTEX_MIRROR_CODE_USER_NAME." && exit 1 +[ -z "${VORTEX_MIRROR_CODE_GIT_USER_EMAIL}" ] && fail "Missing required value for VORTEX_MIRROR_CODE_GIT_USER_EMAIL." && exit 1 # Configure global git settings, if they do not exist. -[ "$(git config --global user.name)" == "" ] && note "Configuring global git user name." && git config --global user.name "${DREVOPS_MIRROR_CODE_GIT_USER_NAME}" -[ "$(git config --global user.email)" == "" ] && note "Configuring global git user email." && git config --global user.email "${DREVOPS_MIRROR_CODE_GIT_USER_EMAIL}" +[ "$(git config --global user.name)" == "" ] && note "Configuring global git user name." && git config --global user.name "${VORTEX_MIRROR_CODE_GIT_USER_NAME}" +[ "$(git config --global user.email)" == "" ] && note "Configuring global git user email." && git config --global user.email "${VORTEX_MIRROR_CODE_GIT_USER_EMAIL}" -export DREVOPS_SSH_PREFIX="MIRROR_CODE" && . ./scripts/drevops/setup-ssh.sh +export VORTEX_SSH_PREFIX="MIRROR_CODE" && . ./scripts/vortex/setup-ssh.sh # Create a temp directory to copy source repository into to prevent changes to source. SRC_TMPDIR=$(mktemp -d) @@ -70,7 +70,7 @@ SRC_TMPDIR=$(mktemp -d) note "Copying files from the source repository to ${SRC_TMPDIR}." rsync -a --keep-dirlinks ./. "${SRC_TMPDIR}" # @docs:skip -[ -n "${DREVOPS_DEBUG}" ] && tree -L 4 "${SRC_TMPDIR}" +[ -n "${VORTEX_DEBUG}" ] && tree -L 4 "${SRC_TMPDIR}" # Move to the temp source repo directory. pushd "${SRC_TMPDIR}" >/dev/null || exit 1 @@ -80,14 +80,14 @@ git reset --hard # Checkout the branch, but only if the current branch is not the same. current_branch="$(git rev-parse --abbrev-ref HEAD)" -if [ "${DREVOPS_MIRROR_CODE_BRANCH_SRC:-}" != "${current_branch}" ]; then - git checkout -b "${DREVOPS_MIRROR_CODE_BRANCH_SRC}" "${DREVOPS_MIRROR_CODE_REMOTE_DST}/${DREVOPS_MIRROR_CODE_BRANCH_SRC}" +if [ "${VORTEX_MIRROR_CODE_BRANCH_SRC:-}" != "${current_branch}" ]; then + git checkout -b "${VORTEX_MIRROR_CODE_BRANCH_SRC}" "${VORTEX_MIRROR_CODE_REMOTE_DST}/${VORTEX_MIRROR_CODE_BRANCH_SRC}" fi -if [ "${DREVOPS_MIRROR_CODE_PUSH:-}" = "1" ]; then - git push "${DREVOPS_MIRROR_CODE_REMOTE_DST}" "${DREVOPS_MIRROR_CODE_BRANCH_SRC}:${DREVOPS_MIRROR_CODE_BRANCH_DST}" --force +if [ "${VORTEX_MIRROR_CODE_PUSH:-}" = "1" ]; then + git push "${VORTEX_MIRROR_CODE_REMOTE_DST}" "${VORTEX_MIRROR_CODE_BRANCH_SRC}:${VORTEX_MIRROR_CODE_BRANCH_DST}" --force else - note "Would push to ${DREVOPS_MIRROR_CODE_BRANCH_SRC}" + note "Would push to ${VORTEX_MIRROR_CODE_BRANCH_SRC}" fi popd >/dev/null || exit 1 diff --git a/scripts/drevops/notify-email.sh b/scripts/vortex/notify-email.sh similarity index 60% rename from scripts/drevops/notify-email.sh rename to scripts/vortex/notify-email.sh index 96f55ac72..0f93dac0e 100755 --- a/scripts/drevops/notify-email.sh +++ b/scripts/vortex/notify-email.sh @@ -5,11 +5,11 @@ # Notification dispatch to email recipients. # # Usage: -# DREVOPS_NOTIFY_PROJECT="Site Name" \ +# VORTEX_NOTIFY_PROJECT="Site Name" \ # DRUPAL_SITE_EMAIL="from@example.com" \ -# DREVOPS_NOTIFY_EMAIL_RECIPIENTS="to1@example.com|Jane Doe, to2@example.com|John Doe" \ -# DREVOPS_NOTIFY_REF="git-branch" \ -# DREVOPS_NOTIFY_ENVIRONMENT_URL="https://environment-url-example.com" \ +# VORTEX_NOTIFY_EMAIL_RECIPIENTS="to1@example.com|Jane Doe, to2@example.com|John Doe" \ +# VORTEX_NOTIFY_REF="git-branch" \ +# VORTEX_NOTIFY_ENVIRONMENT_URL="https://environment-url-example.com" \ # ./notify-email.sh # # shellcheck disable=SC1090,SC1091 @@ -17,26 +17,26 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Project name to notify. -DREVOPS_NOTIFY_EMAIL_PROJECT="${DREVOPS_NOTIFY_EMAIL_PROJECT:-${DREVOPS_NOTIFY_PROJECT:-}}" +VORTEX_NOTIFY_EMAIL_PROJECT="${VORTEX_NOTIFY_EMAIL_PROJECT:-${VORTEX_NOTIFY_PROJECT:-}}" # Email address to send notifications from. -DREVOPS_NOTIFY_EMAIL_FROM="${DREVOPS_NOTIFY_EMAIL_FROM:-${DRUPAL_SITE_EMAIL:-}}" +VORTEX_NOTIFY_EMAIL_FROM="${VORTEX_NOTIFY_EMAIL_FROM:-${DRUPAL_SITE_EMAIL:-}}" # Email address(es) to send notifications to. # # Multiple names can be specified as a comma-separated list of email addresses # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" -DREVOPS_NOTIFY_EMAIL_RECIPIENTS="${DREVOPS_NOTIFY_EMAIL_RECIPIENTS:-}" +VORTEX_NOTIFY_EMAIL_RECIPIENTS="${VORTEX_NOTIFY_EMAIL_RECIPIENTS:-}" # Git reference to notify about. -DREVOPS_NOTIFY_EMAIL_REF="${DREVOPS_NOTIFY_EMAIL_REF:-${DREVOPS_NOTIFY_REF:-}}" +VORTEX_NOTIFY_EMAIL_REF="${VORTEX_NOTIFY_EMAIL_REF:-${VORTEX_NOTIFY_REF:-}}" # Environment URL to notify about. -DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL="${DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL:-${DREVOPS_NOTIFY_ENVIRONMENT_URL:-}}" +VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL="${VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL:-${VORTEX_NOTIFY_ENVIRONMENT_URL:-}}" #------------------------------------------------------------------------------- @@ -47,11 +47,11 @@ pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } # @formatter:on -[ -z "${DREVOPS_NOTIFY_EMAIL_PROJECT}" ] && fail "Missing required value for DREVOPS_NOTIFY_EMAIL_PROJECT." && exit 1 -[ -z "${DREVOPS_NOTIFY_EMAIL_FROM}" ] && fail "Missing required value for DREVOPS_NOTIFY_EMAIL_FROM." && exit 1 -[ -z "${DREVOPS_NOTIFY_EMAIL_RECIPIENTS}" ] && fail "Missing required value for DREVOPS_NOTIFY_EMAIL_RECIPIENTS." && exit 1 -[ -z "${DREVOPS_NOTIFY_EMAIL_REF}" ] && fail "Missing required value for DREVOPS_NOTIFY_EMAIL_REF." && exit 1 -[ -z "${DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL}" ] && fail "Missing required value for DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL." && exit 1 +[ -z "${VORTEX_NOTIFY_EMAIL_PROJECT}" ] && fail "Missing required value for VORTEX_NOTIFY_EMAIL_PROJECT." && exit 1 +[ -z "${VORTEX_NOTIFY_EMAIL_FROM}" ] && fail "Missing required value for VORTEX_NOTIFY_EMAIL_FROM." && exit 1 +[ -z "${VORTEX_NOTIFY_EMAIL_RECIPIENTS}" ] && fail "Missing required value for VORTEX_NOTIFY_EMAIL_RECIPIENTS." && exit 1 +[ -z "${VORTEX_NOTIFY_EMAIL_REF}" ] && fail "Missing required value for VORTEX_NOTIFY_EMAIL_REF." && exit 1 +[ -z "${VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL}" ] && fail "Missing required value for VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL." && exit 1 info "Started email notification." @@ -69,17 +69,17 @@ else fi timestamp=$(date '+%d/%m/%Y %H:%M:%S %Z') -subject="${DREVOPS_NOTIFY_EMAIL_PROJECT} deployment notification of \"${DREVOPS_NOTIFY_EMAIL_REF}\"" +subject="${VORTEX_NOTIFY_EMAIL_PROJECT} deployment notification of \"${VORTEX_NOTIFY_EMAIL_REF}\"" content="## This is an automated message ## -Site ${DREVOPS_NOTIFY_EMAIL_PROJECT} \"${DREVOPS_NOTIFY_EMAIL_REF}\" branch has been deployed at ${timestamp} and is available at ${DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL}. +Site ${VORTEX_NOTIFY_EMAIL_PROJECT} \"${VORTEX_NOTIFY_EMAIL_REF}\" branch has been deployed at ${timestamp} and is available at ${VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL}. -Login at: ${DREVOPS_NOTIFY_EMAIL_ENVIRONMENT_URL}/user/login" +Login at: ${VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL}/user/login" sent="" IFS="," # shellcheck disable=SC2086 -set -- ${DREVOPS_NOTIFY_EMAIL_RECIPIENTS} +set -- ${VORTEX_NOTIFY_EMAIL_RECIPIENTS} for email_with_name; do old_ifs="${IFS}" IFS="|" @@ -97,14 +97,14 @@ for email_with_name; do ( echo "To: ${to}" echo "Subject: ${subject}" - echo "From: ${DREVOPS_NOTIFY_EMAIL_FROM}" + echo "From: ${VORTEX_NOTIFY_EMAIL_FROM}" echo echo "${content}" ) | sendmail -t sent="${sent} ${email}" elif [ "${has_mail}" = "1" ]; then mail -s "${subject}" "${to}" <<-EOF - From: ${DREVOPS_NOTIFY_EMAIL_FROM} + From: ${VORTEX_NOTIFY_EMAIL_FROM} ${content} EOF diff --git a/scripts/drevops/notify-github.sh b/scripts/vortex/notify-github.sh similarity index 61% rename from scripts/drevops/notify-github.sh rename to scripts/vortex/notify-github.sh index 96495c3aa..bdbcf4c2e 100755 --- a/scripts/drevops/notify-github.sh +++ b/scripts/vortex/notify-github.sh @@ -14,25 +14,25 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Deployment GitHub token. -DREVOPS_NOTIFY_GITHUB_TOKEN="${DREVOPS_NOTIFY_GITHUB_TOKEN:-${GITHUB_TOKEN}}" +VORTEX_NOTIFY_GITHUB_TOKEN="${VORTEX_NOTIFY_GITHUB_TOKEN:-${GITHUB_TOKEN}}" # Deployment repository. -DREVOPS_NOTIFY_REPOSITORY="${DREVOPS_NOTIFY_REPOSITORY:-}" +VORTEX_NOTIFY_REPOSITORY="${VORTEX_NOTIFY_REPOSITORY:-}" # Deployment reference branch. -DREVOPS_NOTIFY_BRANCH="${DREVOPS_NOTIFY_BRANCH:-}" +VORTEX_NOTIFY_BRANCH="${VORTEX_NOTIFY_BRANCH:-}" # The event to notify about. Can be 'pre_deployment' or 'post_deployment'. -DREVOPS_NOTIFY_EVENT="${DREVOPS_NOTIFY_EVENT:-}" +VORTEX_NOTIFY_EVENT="${VORTEX_NOTIFY_EVENT:-}" # Deployment environment URL. -DREVOPS_NOTIFY_ENVIRONMENT_URL="${DREVOPS_NOTIFY_ENVIRONMENT_URL:-}" +VORTEX_NOTIFY_ENVIRONMENT_URL="${VORTEX_NOTIFY_ENVIRONMENT_URL:-}" # Deployment environment type: production, uat, dev, pr. -DREVOPS_NOTIFY_ENVIRONMENT_TYPE="${DREVOPS_NOTIFY_ENVIRONMENT_TYPE:-PR}" +VORTEX_NOTIFY_ENVIRONMENT_TYPE="${VORTEX_NOTIFY_ENVIRONMENT_TYPE:-PR}" # ------------------------------------------------------------------------------ @@ -48,13 +48,13 @@ for cmd in php curl; do command -v ${cmd} >/dev/null || { exit 1 }; done -[ -z "${DREVOPS_NOTIFY_GITHUB_TOKEN}" ] && fail "Missing required value for DREVOPS_NOTIFY_GITHUB_TOKEN" && exit 1 -[ -z "${DREVOPS_NOTIFY_REPOSITORY}" ] && fail "Missing required value for DREVOPS_NOTIFY_REPOSITORY" && exit 1 -[ -z "${DREVOPS_NOTIFY_BRANCH}" ] && fail "Missing required value for DREVOPS_NOTIFY_BRANCH" && exit 1 -[ -z "${DREVOPS_NOTIFY_EVENT}" ] && fail "Missing required value for DREVOPS_NOTIFY_EVENT" && exit 1 -[ -z "${DREVOPS_NOTIFY_ENVIRONMENT_TYPE}" ] && fail "Missing required value for DREVOPS_NOTIFY_ENVIRONMENT_TYPE" && exit 1 +[ -z "${VORTEX_NOTIFY_GITHUB_TOKEN}" ] && fail "Missing required value for VORTEX_NOTIFY_GITHUB_TOKEN" && exit 1 +[ -z "${VORTEX_NOTIFY_REPOSITORY}" ] && fail "Missing required value for VORTEX_NOTIFY_REPOSITORY" && exit 1 +[ -z "${VORTEX_NOTIFY_BRANCH}" ] && fail "Missing required value for VORTEX_NOTIFY_BRANCH" && exit 1 +[ -z "${VORTEX_NOTIFY_EVENT}" ] && fail "Missing required value for VORTEX_NOTIFY_EVENT" && exit 1 +[ -z "${VORTEX_NOTIFY_ENVIRONMENT_TYPE}" ] && fail "Missing required value for VORTEX_NOTIFY_ENVIRONMENT_TYPE" && exit 1 -info "Started GitHub notification for ${DREVOPS_NOTIFY_EVENT} event." +info "Started GitHub notification for ${VORTEX_NOTIFY_EVENT} event." # # Function to extract last value from JSON object passed via STDIN. @@ -72,41 +72,41 @@ extract_json_value() { php -r "\$data=json_decode(file_get_contents('php://stdin'), TRUE); isset(\$data[\"${key}\"]) ? print trim(json_encode(\$data[\"${key}\"], JSON_UNESCAPED_SLASHES), '\"') : exit(1);" } -if [ "${DREVOPS_NOTIFY_EVENT}" = "pre_deployment" ]; then +if [ "${VORTEX_NOTIFY_EVENT}" = "pre_deployment" ]; then payload="$(curl \ -X POST \ - -H "Authorization: token ${DREVOPS_NOTIFY_GITHUB_TOKEN}" \ + -H "Authorization: token ${VORTEX_NOTIFY_GITHUB_TOKEN}" \ -H "Accept: application/vnd.github.v3+json" \ -s \ - "https://api.github.com/repos/${DREVOPS_NOTIFY_REPOSITORY}/deployments" \ - -d "{\"ref\":\"${DREVOPS_NOTIFY_BRANCH}\", \"environment\": \"${DREVOPS_NOTIFY_ENVIRONMENT_TYPE}\", \"auto_merge\": false}")" + "https://api.github.com/repos/${VORTEX_NOTIFY_REPOSITORY}/deployments" \ + -d "{\"ref\":\"${VORTEX_NOTIFY_BRANCH}\", \"environment\": \"${VORTEX_NOTIFY_ENVIRONMENT_TYPE}\", \"auto_merge\": false}")" deployment_id="$(echo "${payload}" | extract_json_value "id" || true)" # Check deployment ID. if [ -z "${deployment_id}" ] || [ "${#deployment_id}" -lt 9 ] || [ "${#deployment_id}" -gt 11 ] || [ "$(expr "x${deployment_id}" : "x[0-9]*$")" -eq 0 ]; then - fail "Failed to get a deployment ID for a ${DREVOPS_NOTIFY_EVENT} operation. Payload: ${payload}" + fail "Failed to get a deployment ID for a ${VORTEX_NOTIFY_EVENT} operation. Payload: ${payload}" fail "Wait for GitHub checks to finish and try again." exit 1 fi note "Marked deployment as started." else - [ -z "${DREVOPS_NOTIFY_ENVIRONMENT_URL}" ] && fail "Missing required value for DREVOPS_NOTIFY_ENVIRONMENT_URL" && exit 1 + [ -z "${VORTEX_NOTIFY_ENVIRONMENT_URL}" ] && fail "Missing required value for VORTEX_NOTIFY_ENVIRONMENT_URL" && exit 1 # Returns all deployment for this SHA sorted from the latest to the oldest. payload="$(curl \ -X GET \ - -H "Authorization: token ${DREVOPS_NOTIFY_GITHUB_TOKEN}" \ + -H "Authorization: token ${VORTEX_NOTIFY_GITHUB_TOKEN}" \ -H "Accept: application/vnd.github.v3+json" \ -s \ - "https://api.github.com/repos/${DREVOPS_NOTIFY_REPOSITORY}/deployments?ref=${DREVOPS_NOTIFY_BRANCH}")" + "https://api.github.com/repos/${VORTEX_NOTIFY_REPOSITORY}/deployments?ref=${VORTEX_NOTIFY_BRANCH}")" deployment_id="$(echo "${payload}" | extract_json_first_value "id" || true)" # Check deployment ID. if [ -z "${deployment_id}" ] || [ "${#deployment_id}" -lt 9 ] || [ "${#deployment_id}" -gt 11 ] || [ "$(expr "x${deployment_id}" : "x[0-9]*$")" -eq 0 ]; then - fail "Failed to get a deployment ID for a ${DREVOPS_NOTIFY_EVENT} operation. Payload: ${payload}" + fail "Failed to get a deployment ID for a ${VORTEX_NOTIFY_EVENT} operation. Payload: ${payload}" fail "Check that a pre_deployment notification was dispatched." exit 1 fi @@ -115,10 +115,10 @@ else payload="$(curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${DREVOPS_NOTIFY_GITHUB_TOKEN}" \ - "https://api.github.com/repos/${DREVOPS_NOTIFY_REPOSITORY}/deployments/${deployment_id}/statuses" \ + -H "Authorization: token ${VORTEX_NOTIFY_GITHUB_TOKEN}" \ + "https://api.github.com/repos/${VORTEX_NOTIFY_REPOSITORY}/deployments/${deployment_id}/statuses" \ -s \ - -d "{\"state\":\"success\", \"environment_url\": \"${DREVOPS_NOTIFY_ENVIRONMENT_URL}\"}")" + -d "{\"state\":\"success\", \"environment_url\": \"${VORTEX_NOTIFY_ENVIRONMENT_URL}\"}")" status="$(echo "${payload}" | extract_json_value "state")" @@ -130,4 +130,4 @@ else note "Marked deployment as finished." fi -pass "Finished GitHub notification for ${DREVOPS_NOTIFY_EVENT} event." +pass "Finished GitHub notification for ${VORTEX_NOTIFY_EVENT} event." diff --git a/scripts/drevops/notify-jira.sh b/scripts/vortex/notify-jira.sh similarity index 65% rename from scripts/drevops/notify-jira.sh rename to scripts/vortex/notify-jira.sh index 6bbf185f5..f0742ce02 100755 --- a/scripts/drevops/notify-jira.sh +++ b/scripts/vortex/notify-jira.sh @@ -14,35 +14,35 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # JIRA user. -DREVOPS_NOTIFY_JIRA_USER="${DREVOPS_NOTIFY_JIRA_USER:-}" +VORTEX_NOTIFY_JIRA_USER="${VORTEX_NOTIFY_JIRA_USER:-}" # JIRA token. -DREVOPS_NOTIFY_JIRA_TOKEN="${DREVOPS_NOTIFY_JIRA_TOKEN:-}" +VORTEX_NOTIFY_JIRA_TOKEN="${VORTEX_NOTIFY_JIRA_TOKEN:-}" # Deployment reference, such as a git SHA. -DREVOPS_NOTIFY_BRANCH="${DREVOPS_NOTIFY_BRANCH:-}" +VORTEX_NOTIFY_BRANCH="${VORTEX_NOTIFY_BRANCH:-}" # Deployment environment URL. -DREVOPS_NOTIFY_ENVIRONMENT_URL="${DREVOPS_NOTIFY_ENVIRONMENT_URL:-}" +VORTEX_NOTIFY_ENVIRONMENT_URL="${VORTEX_NOTIFY_ENVIRONMENT_URL:-}" # Deployment comment prefix. -DREVOPS_NOTIFY_JIRA_COMMENT_PREFIX="${DREVOPS_NOTIFY_JIRA_COMMENT_PREFIX:-"Deployed to "}" +VORTEX_NOTIFY_JIRA_COMMENT_PREFIX="${VORTEX_NOTIFY_JIRA_COMMENT_PREFIX:-"Deployed to "}" # State to move the ticket to. # # If left empty - no transition will be performed. -DREVOPS_NOTIFY_JIRA_TRANSITION="${DREVOPS_NOTIFY_JIRA_TRANSITION:-}" +VORTEX_NOTIFY_JIRA_TRANSITION="${VORTEX_NOTIFY_JIRA_TRANSITION:-}" # Assign the ticket to this account. # # If left empty - no assignment will be performed. -DREVOPS_NOTIFY_JIRA_ASSIGNEE="${DREVOPS_NOTIFY_JIRA_ASSIGNEE:-}" +VORTEX_NOTIFY_JIRA_ASSIGNEE="${VORTEX_NOTIFY_JIRA_ASSIGNEE:-}" # JIRA API endpoint. -DREVOPS_NOTIFY_JIRA_ENDPOINT="${DREVOPS_NOTIFY_JIRA_ENDPOINT:-https://jira.atlassian.com}" +VORTEX_NOTIFY_JIRA_ENDPOINT="${VORTEX_NOTIFY_JIRA_ENDPOINT:-https://jira.atlassian.com}" # ------------------------------------------------------------------------------ @@ -58,9 +58,9 @@ for cmd in php curl; do command -v ${cmd} >/dev/null || { exit 1 }; done -[ -z "${DREVOPS_NOTIFY_JIRA_USER}" ] && fail "Missing required value for DREVOPS_NOTIFY_JIRA_USER" && exit 1 -[ -z "${DREVOPS_NOTIFY_JIRA_TOKEN}" ] && fail "Missing required value for DREVOPS_NOTIFY_JIRA_TOKEN" && exit 1 -[ -z "${DREVOPS_NOTIFY_BRANCH}" ] && fail "Missing required value for DREVOPS_NOTIFY_BRANCH" && exit 1 +[ -z "${VORTEX_NOTIFY_JIRA_USER}" ] && fail "Missing required value for VORTEX_NOTIFY_JIRA_USER" && exit 1 +[ -z "${VORTEX_NOTIFY_JIRA_TOKEN}" ] && fail "Missing required value for VORTEX_NOTIFY_JIRA_TOKEN" && exit 1 +[ -z "${VORTEX_NOTIFY_BRANCH}" ] && fail "Missing required value for VORTEX_NOTIFY_BRANCH" && exit 1 info "Started JIRA notification." @@ -99,13 +99,13 @@ extract_issue() { } note "Extracting issue" -issue="$(extract_issue "${DREVOPS_NOTIFY_BRANCH}")" -[ "${issue}" = "" ] && pass "Branch ${DREVOPS_NOTIFY_BRANCH} does not contain issue number." && exit 0 +issue="$(extract_issue "${VORTEX_NOTIFY_BRANCH}")" +[ "${issue}" = "" ] && pass "Branch ${VORTEX_NOTIFY_BRANCH} does not contain issue number." && exit 0 note "Found issue ${issue}." note "Creating API token" base64_opts=() && [ "$(uname)" != "Darwin" ] && base64_opts=(-w 0) -token="$(echo -n "${DREVOPS_NOTIFY_JIRA_USER}:${DREVOPS_NOTIFY_JIRA_TOKEN}" | base64 "${base64_opts[@]}")" +token="$(echo -n "${VORTEX_NOTIFY_JIRA_USER}:${VORTEX_NOTIFY_JIRA_TOKEN}" | base64 "${base64_opts[@]}")" echo -n " Checking API access..." payload="$(curl \ @@ -113,25 +113,25 @@ payload="$(curl \ -X GET \ -H "Authorization: Basic ${token}" \ -H "Content-Type: application/json" \ - "${DREVOPS_NOTIFY_JIRA_ENDPOINT}/rest/api/3/myself")" + "${VORTEX_NOTIFY_JIRA_ENDPOINT}/rest/api/3/myself")" account_id="$(echo "${payload}" | extract_json_value "accountId" || echo "error")" [ "${#account_id}" -lt 24 ] && fail "Unable to authenticate" && echo "${payload}" && exit 1 echo "success" -if [ -n "${DREVOPS_NOTIFY_JIRA_COMMENT_PREFIX}" ]; then +if [ -n "${VORTEX_NOTIFY_JIRA_COMMENT_PREFIX}" ]; then note "Posting a comment." - [ -z "${DREVOPS_NOTIFY_ENVIRONMENT_URL}" ] && fail "Missing required value for DREVOPS_NOTIFY_ENVIRONMENT_URL." && exit 1 + [ -z "${VORTEX_NOTIFY_ENVIRONMENT_URL}" ] && fail "Missing required value for VORTEX_NOTIFY_ENVIRONMENT_URL." && exit 1 - comment="[{\"type\": \"text\",\"text\": \"${DREVOPS_NOTIFY_JIRA_COMMENT_PREFIX}\"},{\"type\": \"inlineCard\",\"attrs\": {\"url\": \"${DREVOPS_NOTIFY_ENVIRONMENT_URL}\"}}]" + comment="[{\"type\": \"text\",\"text\": \"${VORTEX_NOTIFY_JIRA_COMMENT_PREFIX}\"},{\"type\": \"inlineCard\",\"attrs\": {\"url\": \"${VORTEX_NOTIFY_ENVIRONMENT_URL}\"}}]" payload="$(curl \ -s \ -X POST \ -H "Authorization: Basic ${token}" \ -H "Content-Type: application/json" \ - --url "${DREVOPS_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/comment" \ + --url "${VORTEX_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/comment" \ --data "{\"body\": {\"type\": \"doc\", \"version\": 1, \"content\": [{\"type\": \"paragraph\", \"content\": ${comment}}]}}")" comment_id="$(echo "${payload}" | extract_json_value "id" || echo "error")" @@ -140,18 +140,18 @@ if [ -n "${DREVOPS_NOTIFY_JIRA_COMMENT_PREFIX}" ]; then pass "Posted comment with ID ${comment_id}." fi -if [ -n "${DREVOPS_NOTIFY_JIRA_TRANSITION}" ]; then - note "Transitioning issue to ${DREVOPS_NOTIFY_JIRA_TRANSITION}" +if [ -n "${VORTEX_NOTIFY_JIRA_TRANSITION}" ]; then + note "Transitioning issue to ${VORTEX_NOTIFY_JIRA_TRANSITION}" - echo -n " Discovering transition ID for ${DREVOPS_NOTIFY_JIRA_TRANSITION}..." + echo -n " Discovering transition ID for ${VORTEX_NOTIFY_JIRA_TRANSITION}..." payload="$(curl \ -s \ -X GET \ -H "Authorization: Basic ${token}" \ -H "Content-Type: application/json" \ - --url "${DREVOPS_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/transitions")" + --url "${VORTEX_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/transitions")" - transition_id="$(echo "${payload}" | extract_json_value "transitions" | extract_json_value_by_value "name" "${DREVOPS_NOTIFY_JIRA_TRANSITION}" "id" || echo "error")" + transition_id="$(echo "${payload}" | extract_json_value "transitions" | extract_json_value_by_value "name" "${VORTEX_NOTIFY_JIRA_TRANSITION}" "id" || echo "error")" { [ "${transition_id}" = "" ] || [ "$(expr "x${transition_id}" : "x[0-9]*$")" -eq 0 ]; } && fail "Unable to retrieve transition ID" && exit 1 echo "success" @@ -160,22 +160,22 @@ if [ -n "${DREVOPS_NOTIFY_JIRA_TRANSITION}" ]; then -X POST \ -H "Authorization: Basic ${token}" \ -H "Content-Type: application/json" \ - --url "${DREVOPS_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/transitions" \ + --url "${VORTEX_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/transitions" \ --data "{ \"transition\": {\"id\": \"${transition_id}\"}}")" - pass "Transitioned issue to ${DREVOPS_NOTIFY_JIRA_TRANSITION} " + pass "Transitioned issue to ${VORTEX_NOTIFY_JIRA_TRANSITION} " fi -if [ -n "${DREVOPS_NOTIFY_JIRA_ASSIGNEE:-}" ]; then - note "Assigning issue to ${DREVOPS_NOTIFY_JIRA_ASSIGNEE}" +if [ -n "${VORTEX_NOTIFY_JIRA_ASSIGNEE:-}" ]; then + note "Assigning issue to ${VORTEX_NOTIFY_JIRA_ASSIGNEE}" - echo -n " Discovering user ID for ${DREVOPS_NOTIFY_JIRA_ASSIGNEE}..." + echo -n " Discovering user ID for ${VORTEX_NOTIFY_JIRA_ASSIGNEE}..." payload="$(curl \ -s \ -X GET \ -H "Authorization: Basic ${token}" \ -H "Content-Type: application/json" \ - --url "${DREVOPS_NOTIFY_JIRA_ENDPOINT}/rest/api/3/user/assignable/search?query=${DREVOPS_NOTIFY_JIRA_ASSIGNEE}&issueKey=${issue}")" + --url "${VORTEX_NOTIFY_JIRA_ENDPOINT}/rest/api/3/user/assignable/search?query=${VORTEX_NOTIFY_JIRA_ASSIGNEE}&issueKey=${issue}")" account_id="$(echo "${payload}" | extract_json_first_value "accountId" || echo "error")" [ "${#account_id}" -lt 24 ] && fail "Unable to retrieve assignee account ID" && echo "${payload}" && exit 1 @@ -186,10 +186,10 @@ if [ -n "${DREVOPS_NOTIFY_JIRA_ASSIGNEE:-}" ]; then -X PUT \ -H "Authorization: Basic ${token}" \ -H "Content-Type: application/json" \ - --url "${DREVOPS_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/assignee" \ + --url "${VORTEX_NOTIFY_JIRA_ENDPOINT}/rest/api/3/issue/${issue}/assignee" \ --data "{ \"accountId\": \"${account_id}\"}")" - pass "Assigned issue to ${DREVOPS_NOTIFY_JIRA_ASSIGNEE}" + pass "Assigned issue to ${VORTEX_NOTIFY_JIRA_ASSIGNEE}" fi pass "Finished JIRA notification." diff --git a/scripts/vortex/notify-newrelic.sh b/scripts/vortex/notify-newrelic.sh new file mode 100755 index 000000000..95d8d0fbc --- /dev/null +++ b/scripts/vortex/notify-newrelic.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +## +# Notification dispatch to New Relic. +# +# shellcheck disable=SC1090,SC1091 + +t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t + +set -eu +[ "${VORTEX_DEBUG-}" = "1" ] && set -x + +# Project name to notify. +VORTEX_NOTIFY_NEWRELIC_PROJECT="${VORTEX_NOTIFY_NEWRELIC_PROJECT:-${VORTEX_NOTIFY_PROJECT:-}}" + +# NewRelic API key, usually of type 'USER'. +VORTEX_NOTIFY_NEWRELIC_APIKEY="${VORTEX_NOTIFY_NEWRELIC_APIKEY:-}" + +# Deployment reference, such as a git branch or pr. +VORTEX_NOTIFY_NEWRELIC_REF="${VORTEX_NOTIFY_NEWRELIC_REF:-${VORTEX_NOTIFY_REF:-}}" + +# Deployment commit reference, such as a git SHA. +VORTEX_NOTIFY_NEWRELIC_SHA="${VORTEX_NOTIFY_NEWRELIC_SHA:-${VORTEX_NOTIFY_SHA:-}}" + +# NewRelic application name as it appears in the dashboard. +VORTEX_NOTIFY_NEWRELIC_APP_NAME="${VORTEX_NOTIFY_NEWRELIC_APP_NAME:-"${VORTEX_NOTIFY_NEWRELIC_PROJECT}-${VORTEX_NOTIFY_NEWRELIC_REF}"}" + +# Optional NewRelic Application ID. +# +# Will be discovered automatically from application name if not provided. +VORTEX_NOTIFY_NEWRELIC_APPID="${VORTEX_NOTIFY_NEWRELIC_APPID:-}" + +# Optional NewRelic notification description. +VORTEX_NOTIFY_NEWRELIC_DESCRIPTION="${VORTEX_NOTIFY_NEWRELIC_DESCRIPTION:-"${VORTEX_NOTIFY_NEWRELIC_REF} deployed"}" + +# Optional NewRelic notification changelog. +# +# Defaults to the description. +VORTEX_NOTIFY_NEWRELIC_CHANGELOG="${VORTEX_NOTIFY_NEWRELIC_CHANGELOG:-${VORTEX_NOTIFY_NEWRELIC_DESCRIPTION}}" + +# Optional name of the user performing the deployment. +VORTEX_NOTIFY_NEWRELIC_USER="${VORTEX_NOTIFY_NEWRELIC_USER:-"Deployment robot"}" + +# Optional NewRelic endpoint. +VORTEX_NOTIFY_NEWRELIC_ENDPOINT="${VORTEX_NOTIFY_NEWRELIC_ENDPOINT:-https://api.newrelic.com/v2}" + +# ------------------------------------------------------------------------------ + +# @formatter:off +note() { printf " %s\n" "${1}"; } +info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } +pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } +fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } +# @formatter:on + +#shellcheck disable=SC2043 +for cmd in curl; do command -v ${cmd} >/dev/null || { + fail "Command ${cmd} is not available" + exit 1 +}; done + +[ -z "${VORTEX_NOTIFY_NEWRELIC_PROJECT}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_PROJECT" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_APIKEY}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_APIKEY" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_REF}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_REF" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_SHA}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_SHA" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_APP_NAME}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_APP_NAME" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_DESCRIPTION}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_DESCRIPTION" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_CHANGELOG}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_CHANGELOG" && exit 1 +[ -z "${VORTEX_NOTIFY_NEWRELIC_USER}" ] && fail "Missing required value for VORTEX_NOTIFY_NEWRELIC_USER" && exit 1 + +info "Started New Relic notification." + +# Discover APP id by name if it was not provided. +if [ -z "${VORTEX_NOTIFY_NEWRELIC_APPID}" ] && [ -n "${VORTEX_NOTIFY_NEWRELIC_APP_NAME}" ]; then + VORTEX_NOTIFY_NEWRELIC_APPID="$(curl -s -X GET "${VORTEX_NOTIFY_NEWRELIC_ENDPOINT}/applications.json" \ + -H "Api-Key:${VORTEX_NOTIFY_NEWRELIC_APIKEY}" \ + -s -G -d "filter[name]=${VORTEX_NOTIFY_NEWRELIC_APP_NAME}&exclude_links=true" | + cut -c 24- | + cut -c -10)" +fi + +# Check if the length of the VORTEX_NOTIFY_NEWRELIC_APPID variable is not 10 OR +# if the variable doesn't contain only numeric values and exit. +{ [ "${#VORTEX_NOTIFY_NEWRELIC_APPID}" != "10" ] || [ "$(expr "x${VORTEX_NOTIFY_NEWRELIC_APPID}" : "x[0-9]*$")" -eq 0 ]; } && note "Notification skipped: No New Relic application ID found for ${VORTEX_NOTIFY_NEWRELIC_APP_NAME}. This is expected for non-configured environments." && exit 0 + +if ! curl -X POST "${VORTEX_NOTIFY_NEWRELIC_ENDPOINT}/applications/${VORTEX_NOTIFY_NEWRELIC_APPID}/deployments.json" \ + -L -s -o /dev/null -w "%{http_code}" \ + -H "Api-Key:${VORTEX_NOTIFY_NEWRELIC_APIKEY}" \ + -H 'Content-Type: application/json' \ + -d \ + "{ + \"deployment\": { + \"revision\": \"${VORTEX_NOTIFY_NEWRELIC_SHA}\", + \"changelog\": \"${VORTEX_NOTIFY_NEWRELIC_CHANGELOG}\", + \"description\": \"${VORTEX_NOTIFY_NEWRELIC_DESCRIPTION}\", + \"user\": \"${VORTEX_NOTIFY_NEWRELIC_USER}\" + } +}" | grep -q '201'; then + fail "[ERROR] Failed to crate a deployment notification for application ${VORTEX_NOTIFY_NEWRELIC_APP_NAME} with ID ${VORTEX_NOTIFY_NEWRELIC_APPID}" + exit 1 +fi + +pass "Finished New Relic notification." diff --git a/scripts/vortex/notify-webhook.sh b/scripts/vortex/notify-webhook.sh new file mode 100755 index 000000000..989f8c70a --- /dev/null +++ b/scripts/vortex/notify-webhook.sh @@ -0,0 +1,99 @@ +#!/usr/bin/env bash +## +# Notification dispatch to any webhook. +# +# shellcheck disable=SC1090,SC1091 + +t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t + +set -eu +[ "${VORTEX_DEBUG-}" = "1" ] && set -x + +# Project name to notify. +VORTEX_NOTIFY_PROJECT="${VORTEX_NOTIFY_PROJECT:-}" + +# Git reference to notify about. +VORTEX_NOTIFY_REF="${VORTEX_NOTIFY_REF:-}" + +# Deployment environment URL. +VORTEX_NOTIFY_ENVIRONMENT_URL="${VORTEX_NOTIFY_ENVIRONMENT_URL:-}" + +# Webhook URL. +VORTEX_NOTIFY_WEBHOOK_URL="${VORTEX_NOTIFY_WEBHOOK_URL:-}" + +# Webhook method like POST, GET, PUT. +VORTEX_NOTIFY_WEBHOOK_METHOD="${VORTEX_NOTIFY_WEBHOOK_METHOD:-POST}" + +# Webhook headers. +# Separate multiple headers with a pipe `|`. +# Example: `Content-type: application/json|Authorization: Bearer API_KEY`. +VORTEX_NOTIFY_WEBHOOK_HEADERS="${VORTEX_NOTIFY_WEBHOOK_HEADERS:-Content-type: application/json}" + +# Webhook message body as json format. +VORTEX_NOTIFY_WEBHOOK_PAYLOAD="${VORTEX_NOTIFY_WEBHOOK_PAYLOAD:-{\"channel\": \"Channel 1\", \"message\": \"%message%\", \"project\": \"%project%\", \"ref\": \"%ref%\", \"timestamp\": \"%timestamp%\", \"environment_url\": \"%environment_url%\"}}" + +# The pattern of response code return by curl. +VORTEX_NOTIFY_WEBHOOK_RESPONSE_STATUS="${VORTEX_NOTIFY_WEBHOOK_RESPONSE_STATUS:-200}" + +# ------------------------------------------------------------------------------ + +# @formatter:off +note() { printf " %s\n" "${1}"; } +info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } +pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } +fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } +# @formatter:on + +for cmd in php curl; do command -v ${cmd} >/dev/null || { + fail "Command ${cmd} is not available" + exit 1 +}; done + +[ -z "${VORTEX_NOTIFY_PROJECT}" ] && fail "Missing required value for VORTEX_NOTIFY_PROJECT" && exit 1 +[ -z "${VORTEX_NOTIFY_REF}" ] && fail "Missing required value for VORTEX_NOTIFY_REF" && exit 1 +[ -z "${VORTEX_NOTIFY_ENVIRONMENT_URL}" ] && fail "Missing required value for VORTEX_NOTIFY_ENVIRONMENT_URL" && exit 1 +[ -z "${VORTEX_NOTIFY_WEBHOOK_URL}" ] && fail "Missing required value for VORTEX_NOTIFY_WEBHOOK_URL" && exit 1 +[ -z "${VORTEX_NOTIFY_WEBHOOK_METHOD}" ] && fail "Missing required value for VORTEX_NOTIFY_WEBHOOK_METHOD" && exit 1 +[ -z "${VORTEX_NOTIFY_WEBHOOK_HEADERS}" ] && fail "Missing required value for VORTEX_NOTIFY_WEBHOOK_HEADERS" && exit 1 +[ -z "${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}" ] && fail "Missing required value for VORTEX_NOTIFY_WEBHOOK_PAYLOAD" && exit 1 + +# Build and replace some variables (%variable_name%) for webhook payload. +timestamp=$(date '+%d/%m/%Y %H:%M:%S %Z') +message='## This is an automated message ##\nSite %project% \"%ref%\" branch has been deployed at %timestamp% and is available at %environment_url%.\nLogin at: %environment_url%/user/login' + +VORTEX_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%message%', '${message}', '${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}');") +VORTEX_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%timestamp%', '${timestamp}', '${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}');") +VORTEX_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%ref%', '${VORTEX_NOTIFY_REF}', '${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}');") +VORTEX_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%project%', '${VORTEX_NOTIFY_PROJECT}', '${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}');") +VORTEX_NOTIFY_WEBHOOK_PAYLOAD=$(php -r "echo str_replace('%environment_url%', '${VORTEX_NOTIFY_ENVIRONMENT_URL}', '${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}');") + +info "Started Webhook notification." + +info "Webhook config:" +note "Project : ${VORTEX_NOTIFY_PROJECT}" +note "Ref : ${VORTEX_NOTIFY_REF}" +note "Environment url : ${VORTEX_NOTIFY_ENVIRONMENT_URL}" +note "Webhook url : ${VORTEX_NOTIFY_WEBHOOK_URL}" +note "Webhook method : ${VORTEX_NOTIFY_WEBHOOK_METHOD}" +note "Webhook headers : ${VORTEX_NOTIFY_WEBHOOK_HEADERS}" +note "Webhook payload : ${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}" +note "Webhook response status : ${VORTEX_NOTIFY_WEBHOOK_RESPONSE_STATUS}" + +# Build headers. +headers=() +IFS=\| read -ra webhook_headers <<<"${VORTEX_NOTIFY_WEBHOOK_HEADERS}" +for item in "${webhook_headers[@]}"; do + headers+=('-H' "${item}") +done + +# Make curl request. +if ! curl -L -s -o /dev/null -w '%{http_code}' \ + -X "${VORTEX_NOTIFY_WEBHOOK_METHOD}" \ + "${headers[@]}" \ + -d "${VORTEX_NOTIFY_WEBHOOK_PAYLOAD}" \ + "${VORTEX_NOTIFY_WEBHOOK_URL}" | grep -q "${VORTEX_NOTIFY_WEBHOOK_RESPONSE_STATUS}"; then + fail "Unable to send notification to webhook ${VORTEX_NOTIFY_WEBHOOK_URL}." + exit 1 +fi + +pass "Finished Webhook notification." diff --git a/scripts/drevops/notify.sh b/scripts/vortex/notify.sh similarity index 59% rename from scripts/drevops/notify.sh rename to scripts/vortex/notify.sh index 87340f487..7d06b683b 100755 --- a/scripts/drevops/notify.sh +++ b/scripts/vortex/notify.sh @@ -12,23 +12,23 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # The channels of the notifications. # # Can be a combination of comma-separated values: email,newrelic,github,jira -DREVOPS_NOTIFY_CHANNELS="${DREVOPS_NOTIFY_CHANNELS:-email}" +VORTEX_NOTIFY_CHANNELS="${VORTEX_NOTIFY_CHANNELS:-email}" # The event to notify about. # # Can be only 'pre_deployment' or 'post_deployment'. Used internally. -DREVOPS_NOTIFY_EVENT="${DREVOPS_NOTIFY_EVENT:-post_deployment}" +VORTEX_NOTIFY_EVENT="${VORTEX_NOTIFY_EVENT:-post_deployment}" # Flag to skip running of all notifications. -DREVOPS_NOTIFY_SKIP="${DREVOPS_NOTIFY_SKIP:-}" +VORTEX_NOTIFY_SKIP="${VORTEX_NOTIFY_SKIP:-}" # The project to notify about. -DREVOPS_NOTIFY_PROJECT="${DREVOPS_NOTIFY_PROJECT:-${DREVOPS_PROJECT:-}}" +VORTEX_NOTIFY_PROJECT="${VORTEX_NOTIFY_PROJECT:-${VORTEX_PROJECT:-}}" # ------------------------------------------------------------------------------ @@ -41,37 +41,37 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 info "Started dispatching notifications." -[ -n "${DREVOPS_NOTIFY_SKIP:-}" ] && pass "Skipping dispatching notifications." && exit 0 +[ -n "${VORTEX_NOTIFY_SKIP:-}" ] && pass "Skipping dispatching notifications." && exit 0 # Narrow-down the notification type based on the event. # @note This logic may be moved into notification scripts in the future. -if [ "${DREVOPS_NOTIFY_EVENT:-}" == "pre_deployment" ]; then - DREVOPS_NOTIFY_CHANNELS="github" -elif [ "${DREVOPS_NOTIFY_EVENT:-}" == "post_deployment" ]; then +if [ "${VORTEX_NOTIFY_EVENT:-}" == "pre_deployment" ]; then + VORTEX_NOTIFY_CHANNELS="github" +elif [ "${VORTEX_NOTIFY_EVENT:-}" == "post_deployment" ]; then # Preserve the value. true else - fail "Unsupported event ${DREVOPS_NOTIFY_EVENT} provided." && exit 1 + fail "Unsupported event ${VORTEX_NOTIFY_EVENT} provided." && exit 1 fi -if [ -z "${DREVOPS_NOTIFY_CHANNELS##*email*}" ]; then - ./scripts/drevops/notify-email.sh "$@" +if [ -z "${VORTEX_NOTIFY_CHANNELS##*email*}" ]; then + ./scripts/vortex/notify-email.sh "$@" fi -if [ -z "${DREVOPS_NOTIFY_CHANNELS##*newrelic*}" ]; then - ./scripts/drevops/notify-newrelic.sh "$@" +if [ -z "${VORTEX_NOTIFY_CHANNELS##*newrelic*}" ]; then + ./scripts/vortex/notify-newrelic.sh "$@" fi -if [ -z "${DREVOPS_NOTIFY_CHANNELS##*github*}" ]; then - ./scripts/drevops/notify-github.sh "$@" +if [ -z "${VORTEX_NOTIFY_CHANNELS##*github*}" ]; then + ./scripts/vortex/notify-github.sh "$@" fi -if [ -z "${DREVOPS_NOTIFY_CHANNELS##*jira*}" ]; then - ./scripts/drevops/notify-jira.sh "$@" +if [ -z "${VORTEX_NOTIFY_CHANNELS##*jira*}" ]; then + ./scripts/vortex/notify-jira.sh "$@" fi -if [ -z "${DREVOPS_NOTIFY_CHANNELS##*webhook*}" ]; then - ./scripts/drevops/notify-webhook.sh "$@" +if [ -z "${VORTEX_NOTIFY_CHANNELS##*webhook*}" ]; then + ./scripts/vortex/notify-webhook.sh "$@" fi pass "Finished dispatching notifications." diff --git a/scripts/drevops/provision-sanitize-db.sh b/scripts/vortex/provision-sanitize-db.sh similarity index 69% rename from scripts/drevops/provision-sanitize-db.sh rename to scripts/vortex/provision-sanitize-db.sh index 530f7058a..38c42fadb 100755 --- a/scripts/drevops/provision-sanitize-db.sh +++ b/scripts/vortex/provision-sanitize-db.sh @@ -7,22 +7,22 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Database sanitized account email replacement. -DREVOPS_PROVISION_SANITIZE_DB_EMAIL="${DREVOPS_PROVISION_SANITIZE_DB_EMAIL:-user+%uid@localhost}" +VORTEX_PROVISION_SANITIZE_DB_EMAIL="${VORTEX_PROVISION_SANITIZE_DB_EMAIL:-user+%uid@localhost}" # Database sanitized account password replacement. -DREVOPS_PROVISION_SANITIZE_DB_PASSWORD="${DREVOPS_PROVISION_SANITIZE_DB_PASSWORD:-${RANDOM}${RANDOM}${RANDOM}${RANDOM}}" +VORTEX_PROVISION_SANITIZE_DB_PASSWORD="${VORTEX_PROVISION_SANITIZE_DB_PASSWORD:-${RANDOM}${RANDOM}${RANDOM}${RANDOM}}" # Replace username with mail. -DREVOPS_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL="${DREVOPS_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL:-0}" +VORTEX_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL="${VORTEX_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL:-0}" # Path to file with custom sanitization SQL queries. # # To skip custom sanitization, remove the file defined in -# DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE variable from the codebase. -DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE="${DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE:-./scripts/sanitize.sql}" +# VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE variable from the codebase. +VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE="${VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE:-./scripts/sanitize.sql}" # ------------------------------------------------------------------------------ @@ -38,19 +38,19 @@ info "Sanitizing database." drush() { ./vendor/bin/drush -y "$@"; } # Always sanitize password and email using standard methods. -drush sql:sanitize --sanitize-password="${DREVOPS_PROVISION_SANITIZE_DB_PASSWORD}" --sanitize-email="${DREVOPS_PROVISION_SANITIZE_DB_EMAIL}" +drush sql:sanitize --sanitize-password="${VORTEX_PROVISION_SANITIZE_DB_PASSWORD}" --sanitize-email="${VORTEX_PROVISION_SANITIZE_DB_EMAIL}" pass "Sanitized database using drush sql:sanitize." -if [ "${DREVOPS_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL:-}" = "1" ]; then +if [ "${VORTEX_PROVISION_SANITIZE_DB_REPLACE_USERNAME_WITH_EMAIL:-}" = "1" ]; then drush sql:query "UPDATE \`users_field_data\` set users_field_data.name=users_field_data.mail WHERE uid <> '0';" pass "Updated username with user email." fi # Sanitize using additional SQL commands provided in file. -if [ -f "${DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE:-}" ]; then +if [ -f "${VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE:-}" ]; then # The file path is relative to the project root, but drush expects it to be # relative to the Drupal root. - drush sql:query --file="${DREVOPS_PROVISION_SANITIZE_DB_ADDITIONAL_FILE/.\//../}" + drush sql:query --file="${VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE/.\//../}" pass "Applied custom sanitization commands from file." fi diff --git a/scripts/drevops/provision.sh b/scripts/vortex/provision.sh similarity index 75% rename from scripts/drevops/provision.sh rename to scripts/vortex/provision.sh index 41192960a..6df653688 100755 --- a/scripts/drevops/provision.sh +++ b/scripts/vortex/provision.sh @@ -11,38 +11,38 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Flag to skip site provisioning. -DREVOPS_PROVISION_SKIP="${DREVOPS_PROVISION_SKIP:-}" +VORTEX_PROVISION_SKIP="${VORTEX_PROVISION_SKIP:-}" # Provision a site from profile instead of database file dump. -DREVOPS_PROVISION_USE_PROFILE="${DREVOPS_PROVISION_USE_PROFILE:-0}" +VORTEX_PROVISION_USE_PROFILE="${VORTEX_PROVISION_USE_PROFILE:-0}" # Flag to always overwrite existing database. Usually set to 0 in deployed # environments. -DREVOPS_PROVISION_OVERRIDE_DB="${DREVOPS_PROVISION_OVERRIDE_DB:-0}" +VORTEX_PROVISION_OVERRIDE_DB="${VORTEX_PROVISION_OVERRIDE_DB:-0}" # Skip database sanitization. -DREVOPS_PROVISION_SANITIZE_DB_SKIP="${DREVOPS_PROVISION_SANITIZE_DB_SKIP:-0}" +VORTEX_PROVISION_SANITIZE_DB_SKIP="${VORTEX_PROVISION_SANITIZE_DB_SKIP:-0}" # Put the site into a maintenance mode during site provisioning phase. -DREVOPS_PROVISION_USE_MAINTENANCE_MODE="${DREVOPS_PROVISION_USE_MAINTENANCE_MODE:-1}" +VORTEX_PROVISION_USE_MAINTENANCE_MODE="${VORTEX_PROVISION_USE_MAINTENANCE_MODE:-1}" # Flag to skip running of operations after site provision is complete. # Useful to only import the database from file (or install from profile) and not # perform any additional operations. For example, when need to capture database # state before any updates ran (for example, DB caching in CI). -DREVOPS_PROVISION_POST_OPERATIONS_SKIP="${DREVOPS_PROVISION_POST_OPERATIONS_SKIP:-0}" +VORTEX_PROVISION_POST_OPERATIONS_SKIP="${VORTEX_PROVISION_POST_OPERATIONS_SKIP:-0}" # Current environment name discovered during site provisioning. -DREVOPS_PROVISION_ENVIRONMENT="${DREVOPS_PROVISION_ENVIRONMENT:-}" +VORTEX_PROVISION_ENVIRONMENT="${VORTEX_PROVISION_ENVIRONMENT:-}" # Name of the webroot directory with Drupal codebase. -DREVOPS_WEBROOT="${DREVOPS_WEBROOT:-web}" +VORTEX_WEBROOT="${VORTEX_WEBROOT:-web}" # Drupal site name. -DRUPAL_SITE_NAME="${DRUPAL_SITE_NAME:-${DREVOPS_PROJECT:-Example site}}" +DRUPAL_SITE_NAME="${DRUPAL_SITE_NAME:-${VORTEX_PROJECT:-Example site}}" # Drupal site email. DRUPAL_SITE_EMAIL="${DRUPAL_SITE_EMAIL:-webmaster@example.com}" @@ -55,10 +55,10 @@ DRUPAL_PROFILE="${DRUPAL_PROFILE:-standard}" DRUPAL_CONFIG_PATH="${DRUPAL_CONFIG_PATH:-}" # Directory with database dump file. -DREVOPS_DB_DIR="${DREVOPS_DB_DIR:-./.data}" +VORTEX_DB_DIR="${VORTEX_DB_DIR:-./.data}" # Database dump file name. -DREVOPS_DB_FILE="${DREVOPS_DB_FILE:-db.sql}" +VORTEX_DB_FILE="${VORTEX_DB_FILE:-db.sql}" # ------------------------------------------------------------------------------ @@ -76,10 +76,10 @@ yesno() { [ "${1}" = "1" ] && echo "Yes" || echo "No"; } info "Started site provisioning." -[ "${DREVOPS_PROVISION_SKIP}" = "1" ] && pass "Skipped site provisioning as DREVOPS_PROVISION_SKIP is set to 1." && exit 0 +[ "${VORTEX_PROVISION_SKIP}" = "1" ] && pass "Skipped site provisioning as VORTEX_PROVISION_SKIP is set to 1." && exit 0 ## Convert DB dir starting with './' to a full path. -[ "${DREVOPS_DB_DIR#./}" != "${DREVOPS_DB_DIR}" ] && DREVOPS_DB_DIR="$(pwd)${DREVOPS_DB_DIR#.}" +[ "${VORTEX_DB_DIR#./}" != "${VORTEX_DB_DIR}" ] && VORTEX_DB_DIR="$(pwd)${VORTEX_DB_DIR#.}" drush_version="$(drush --version | cut -d' ' -f4)" drupal_version="$(drush status --field=drupal-version)" @@ -100,25 +100,25 @@ echo note "Drupal core version : ${drupal_version}" note "Drush version : ${drush_version}" echo -note "Webroot path : $(pwd)/${DREVOPS_WEBROOT}" +note "Webroot path : $(pwd)/${VORTEX_WEBROOT}" note "Public files path : ${DRUPAL_PUBLIC_FILES-}" note "Private files path : ${DRUPAL_PRIVATE_FILES-}" note "Temporary files path : ${DRUPAL_TEMPORARY_FILES-}" note "Config files path : ${DRUPAL_CONFIG_PATH}" -note "DB dump file path : ${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE} ($([ -f "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" ] && echo "present" || echo "absent"))" -if [ -n "${DREVOPS_DB_IMAGE:-}" ]; then - note "DB dump container image : ${DREVOPS_DB_IMAGE}" +note "DB dump file path : ${VORTEX_DB_DIR}/${VORTEX_DB_FILE} ($([ -f "${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" ] && echo "present" || echo "absent"))" +if [ -n "${VORTEX_DB_IMAGE:-}" ]; then + note "DB dump container image : ${VORTEX_DB_IMAGE}" fi echo note "Profile : ${DRUPAL_PROFILE}" note "Configuration files present : $(yesno "${site_has_config}")" note "Existing site found : $(yesno "${site_is_installed}")" echo -note "Install from profile : $(yesno "${DREVOPS_PROVISION_USE_PROFILE}")" -note "Overwrite existing DB : $(yesno "${DREVOPS_PROVISION_OVERRIDE_DB}")" -note "Skip DB sanitization : $(yesno "${DREVOPS_PROVISION_SANITIZE_DB_SKIP}")" -note "Skip post-provision operations : $(yesno "${DREVOPS_PROVISION_POST_OPERATIONS_SKIP}")" -note "Use maintenance mode : $(yesno "${DREVOPS_PROVISION_USE_MAINTENANCE_MODE}")" +note "Install from profile : $(yesno "${VORTEX_PROVISION_USE_PROFILE}")" +note "Overwrite existing DB : $(yesno "${VORTEX_PROVISION_OVERRIDE_DB}")" +note "Skip DB sanitization : $(yesno "${VORTEX_PROVISION_SANITIZE_DB_SKIP}")" +note "Skip post-provision operations : $(yesno "${VORTEX_PROVISION_POST_OPERATIONS_SKIP}")" +note "Use maintenance mode : $(yesno "${VORTEX_PROVISION_USE_MAINTENANCE_MODE}")" echo ################################################################################ @@ -126,17 +126,17 @@ echo # Provision site by importing the database from the dump file. # provision_from_db() { - if [ ! -f "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" ]; then + if [ ! -f "${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" ]; then echo fail "Unable to import database from file." - note "Dump file ${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE} does not exist." + note "Dump file ${VORTEX_DB_DIR}/${VORTEX_DB_FILE} does not exist." note "Site content was not changed." exit 1 fi drush sql:drop - drush sql:cli <"${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" + drush sql:cli <"${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" pass "Imported database from the dump file." } @@ -173,27 +173,27 @@ provision_from_profile() { # The code block below has explicit if-else conditions and verbose output to # ensure that this significant operation is executed correctly and has # sufficient output for debugging. -if [ "${DREVOPS_PROVISION_USE_PROFILE}" != "1" ]; then +if [ "${VORTEX_PROVISION_USE_PROFILE}" != "1" ]; then info "Provisioning site from the database dump file." - note "Dump file path: ${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" + note "Dump file path: ${VORTEX_DB_DIR}/${VORTEX_DB_FILE}" if [ "${site_is_installed}" = "1" ]; then note "Existing site was found when provisioning from the database dump file." - if [ "${DREVOPS_PROVISION_OVERRIDE_DB}" = "1" ]; then + if [ "${VORTEX_PROVISION_OVERRIDE_DB}" = "1" ]; then note "Existing site content will be removed and fresh content will be imported from the database dump file." provision_from_db else note "Site content will be preserved." note "Sanitization will be skipped for an existing database." - export DREVOPS_PROVISION_SANITIZE_DB_SKIP=1 + export VORTEX_PROVISION_SANITIZE_DB_SKIP=1 fi else note "Existing site was not found when installing from the database dump file." note "Fresh site content will be imported from the database dump file." provision_from_db # Let the downstream scripts know that the database was imported. - export DREVOPS_PROVISION_OVERRIDE_DB=1 + export VORTEX_PROVISION_OVERRIDE_DB=1 fi else info "Provisioning site from the profile." @@ -202,34 +202,34 @@ else if [ "${site_is_installed}" = "1" ]; then note "Existing site was found when provisioning from the profile." - if [ "${DREVOPS_PROVISION_OVERRIDE_DB}" = "1" ]; then + if [ "${VORTEX_PROVISION_OVERRIDE_DB}" = "1" ]; then note "Existing site content will be removed and new content will be created from the profile." provision_from_profile # Let the downstream scripts know that the database was imported. - export DREVOPS_PROVISION_OVERRIDE_DB=1 + export VORTEX_PROVISION_OVERRIDE_DB=1 else note "Site content will be preserved." note "Sanitization will be skipped for an existing database." - export DREVOPS_PROVISION_SANITIZE_DB_SKIP=1 + export VORTEX_PROVISION_SANITIZE_DB_SKIP=1 fi else note "Existing site was not found when provisioning from the profile." note "Fresh site content will be created from the profile." provision_from_profile - export DREVOPS_PROVISION_OVERRIDE_DB=1 + export VORTEX_PROVISION_OVERRIDE_DB=1 fi fi echo -if [ "${DREVOPS_PROVISION_POST_OPERATIONS_SKIP}" = "1" ]; then - info "Skipped running of post-provision operations as DREVOPS_PROVISION_POST_OPERATIONS_SKIP is set to 1." +if [ "${VORTEX_PROVISION_POST_OPERATIONS_SKIP}" = "1" ]; then + info "Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." echo info "Finished site provisioning." exit 0 fi -if [ "${DREVOPS_PROVISION_USE_MAINTENANCE_MODE}" = "1" ]; then +if [ "${VORTEX_PROVISION_USE_MAINTENANCE_MODE}" = "1" ]; then info "Enabling maintenance mode." drush maint:set 1 pass "Enabled maintenance mode." @@ -237,10 +237,10 @@ if [ "${DREVOPS_PROVISION_USE_MAINTENANCE_MODE}" = "1" ]; then fi # Get the current environment and export it for the downstream scripts. -DREVOPS_PROVISION_ENVIRONMENT="$(drush php:eval "print \Drupal\core\Site\Settings::get('environment');")" -info "Current Drupal environment: ${DREVOPS_PROVISION_ENVIRONMENT}" +VORTEX_PROVISION_ENVIRONMENT="$(drush php:eval "print \Drupal\core\Site\Settings::get('environment');")" +info "Current Drupal environment: ${VORTEX_PROVISION_ENVIRONMENT}" echo -export DREVOPS_PROVISION_ENVIRONMENT +export VORTEX_PROVISION_ENVIRONMENT # Use 'drush deploy' if configuration files are present or use standalone commands otherwise. if [ "${site_has_config}" = "1" ]; then @@ -284,8 +284,8 @@ else fi # Sanitize database. -if [ "${DREVOPS_PROVISION_SANITIZE_DB_SKIP}" != "1" ]; then - ./scripts/drevops/provision-sanitize-db.sh +if [ "${VORTEX_PROVISION_SANITIZE_DB_SKIP}" != "1" ]; then + ./scripts/vortex/provision-sanitize-db.sh else info "Skipped database sanitization." echo @@ -308,7 +308,7 @@ if [ -d "./scripts/custom" ]; then unset file fi -if [ "${DREVOPS_PROVISION_USE_MAINTENANCE_MODE}" = "1" ]; then +if [ "${VORTEX_PROVISION_USE_MAINTENANCE_MODE}" = "1" ]; then info "Disabling maintenance mode." drush maint:set 0 pass "Disabled maintenance mode." diff --git a/scripts/drevops/reset.sh b/scripts/vortex/reset.sh similarity index 84% rename from scripts/drevops/reset.sh rename to scripts/vortex/reset.sh index 7784750f6..7024d4432 100755 --- a/scripts/drevops/reset.sh +++ b/scripts/vortex/reset.sh @@ -7,7 +7,7 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # ------------------------------------------------------------------------------ @@ -30,12 +30,12 @@ info "Started reset." rm -rf \ "./vendor" \ - "./${DREVOPS_WEBROOT}/core" \ - "./${DREVOPS_WEBROOT}/profiles/contrib" \ - "./${DREVOPS_WEBROOT}/modules/contrib" \ - "./${DREVOPS_WEBROOT}/themes/contrib" \ - "./${DREVOPS_WEBROOT}/themes/custom/*/build" \ - "./${DREVOPS_WEBROOT}/themes/custom/*/scss/_components.scss" + "./${VORTEX_WEBROOT}/core" \ + "./${VORTEX_WEBROOT}/profiles/contrib" \ + "./${VORTEX_WEBROOT}/modules/contrib" \ + "./${VORTEX_WEBROOT}/themes/contrib" \ + "./${VORTEX_WEBROOT}/themes/custom/*/build" \ + "./${VORTEX_WEBROOT}/themes/custom/*/scss/_components.scss" # shellcheck disable=SC2038 find . -type d -name node_modules | xargs rm -Rf diff --git a/scripts/drevops/setup-ssh.sh b/scripts/vortex/setup-ssh.sh similarity index 89% rename from scripts/drevops/setup-ssh.sh rename to scripts/vortex/setup-ssh.sh index 65b43dc09..17e835ff2 100755 --- a/scripts/drevops/setup-ssh.sh +++ b/scripts/vortex/setup-ssh.sh @@ -15,14 +15,14 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Prefix used to load SSH key from prefixes environment variables: -# - DREVOPS_${DREVOPS_SSH_PREFIX}_SSH_FINGERPRINT - the variable name with the +# - VORTEX_${VORTEX_SSH_PREFIX}_SSH_FINGERPRINT - the variable name with the # SSH key fingerprint value. -# - DREVOPS_${DREVOPS_SSH_PREFIX}_SSH_FILE - the variable name with the SSH +# - VORTEX_${VORTEX_SSH_PREFIX}_SSH_FILE - the variable name with the SSH # key file path. -DREVOPS_SSH_PREFIX="${DREVOPS_SSH_PREFIX?Missing the required DREVOPS_SSH_PREFIX environment variable.}" +VORTEX_SSH_PREFIX="${VORTEX_SSH_PREFIX?Missing the required VORTEX_SSH_PREFIX environment variable.}" # ------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03 info "Started SSH setup." -fingerprint_var="DREVOPS_${DREVOPS_SSH_PREFIX}_SSH_FINGERPRINT" +fingerprint_var="VORTEX_${VORTEX_SSH_PREFIX}_SSH_FINGERPRINT" if [ -n "${!fingerprint_var-}" ]; then fingerprint="${!fingerprint_var}" note "Found fingerprint variable ${fingerprint_var} with value ${fingerprint}." @@ -43,7 +43,7 @@ else note "Did not find fingerprint variable ${fingerprint_var}." fi -file_var="DREVOPS_${DREVOPS_SSH_PREFIX}_SSH_FILE" +file_var="VORTEX_${VORTEX_SSH_PREFIX}_SSH_FILE" if [ -n "${!file_var-}" ]; then file="${!file_var}" note "Found variable ${file_var} with value ${file}." diff --git a/scripts/drevops/task-copy-db-acquia.sh b/scripts/vortex/task-copy-db-acquia.sh similarity index 65% rename from scripts/drevops/task-copy-db-acquia.sh rename to scripts/vortex/task-copy-db-acquia.sh index 7abc3cba7..2d1a99497 100755 --- a/scripts/drevops/task-copy-db-acquia.sh +++ b/scripts/vortex/task-copy-db-acquia.sh @@ -16,32 +16,32 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Acquia Cloud API key. -DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY:-${DREVOPS_ACQUIA_KEY}}" +VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:-${VORTEX_ACQUIA_KEY}}" # Acquia Cloud API secret. -DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET:-${DREVOPS_ACQUIA_SECRET}}" +VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:-${VORTEX_ACQUIA_SECRET}}" # Application name. Used to discover UUID. -DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-${DREVOPS_ACQUIA_APP_NAME}}" +VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${VORTEX_ACQUIA_APP_NAME}}" # Source environment name to copy DB from. -DREVOPS_TASK_COPY_DB_ACQUIA_SRC="${DREVOPS_TASK_COPY_DB_ACQUIA_SRC:-}" +VORTEX_TASK_COPY_DB_ACQUIA_SRC="${VORTEX_TASK_COPY_DB_ACQUIA_SRC:-}" # Destination environment name to copy DB to. -DREVOPS_TASK_COPY_DB_ACQUIA_DST="${DREVOPS_TASK_COPY_DB_ACQUIA_DST:-}" +VORTEX_TASK_COPY_DB_ACQUIA_DST="${VORTEX_TASK_COPY_DB_ACQUIA_DST:-}" # Database name to copy. -DREVOPS_TASK_COPY_DB_ACQUIA_NAME="${DREVOPS_TASK_COPY_DB_ACQUIA_NAME:-}" +VORTEX_TASK_COPY_DB_ACQUIA_NAME="${VORTEX_TASK_COPY_DB_ACQUIA_NAME:-}" # Number of status retrieval retries. If this limit reached and task has not # yet finished, the task is considered failed. -DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_RETRIES="${DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_RETRIES:-600}" +VORTEX_TASK_COPY_DB_ACQUIA_STATUS_RETRIES="${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_RETRIES:-600}" # Interval in seconds to check task status. -DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL="${DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL:-10}" +VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL="${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL:-10}" #------------------------------------------------------------------------------- @@ -78,51 +78,51 @@ for cmd in curl; do command -v ${cmd} >/dev/null || { }; done # Check that all required variables are present. -[ -z "${DREVOPS_ACQUIA_KEY}" ] && fail "Missing value for DREVOPS_ACQUIA_KEY." && exit 1 -[ -z "${DREVOPS_ACQUIA_SECRET}" ] && fail "Missing value for DREVOPS_ACQUIA_SECRET." && exit 1 -[ -z "${DREVOPS_ACQUIA_APP_NAME}" ] && fail "Missing value for DREVOPS_ACQUIA_APP_NAME." && exit 1 -[ -z "${DREVOPS_TASK_COPY_DB_ACQUIA_SRC}" ] && fail "Missing value for DREVOPS_TASK_COPY_DB_ACQUIA_SRC." && exit 1 -[ -z "${DREVOPS_TASK_COPY_DB_ACQUIA_DST}" ] && fail "Missing value for DREVOPS_TASK_COPY_DB_ACQUIA_DST." && exit 1 -[ -z "${DREVOPS_TASK_COPY_DB_ACQUIA_NAME}" ] && fail "Missing value for DREVOPS_TASK_COPY_DB_ACQUIA_NAME." && exit 1 -[ -z "${DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_RETRIES}" ] && fail "Missing value for DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_RETRIES." && exit 1 -[ -z "${DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL}" ] && fail "Missing value for DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL." && exit 1 +[ -z "${VORTEX_ACQUIA_KEY}" ] && fail "Missing value for VORTEX_ACQUIA_KEY." && exit 1 +[ -z "${VORTEX_ACQUIA_SECRET}" ] && fail "Missing value for VORTEX_ACQUIA_SECRET." && exit 1 +[ -z "${VORTEX_ACQUIA_APP_NAME}" ] && fail "Missing value for VORTEX_ACQUIA_APP_NAME." && exit 1 +[ -z "${VORTEX_TASK_COPY_DB_ACQUIA_SRC}" ] && fail "Missing value for VORTEX_TASK_COPY_DB_ACQUIA_SRC." && exit 1 +[ -z "${VORTEX_TASK_COPY_DB_ACQUIA_DST}" ] && fail "Missing value for VORTEX_TASK_COPY_DB_ACQUIA_DST." && exit 1 +[ -z "${VORTEX_TASK_COPY_DB_ACQUIA_NAME}" ] && fail "Missing value for VORTEX_TASK_COPY_DB_ACQUIA_NAME." && exit 1 +[ -z "${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_RETRIES}" ] && fail "Missing value for VORTEX_TASK_COPY_DB_ACQUIA_STATUS_RETRIES." && exit 1 +[ -z "${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL}" ] && fail "Missing value for VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL." && exit 1 note "Retrieving authentication token." -token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") +token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 -note "Retrieving ${DREVOPS_ACQUIA_APP_NAME} application UUID." -app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${DREVOPS_ACQUIA_APP_NAME/ /%20}") +note "Retrieving ${VORTEX_ACQUIA_APP_NAME} application UUID." +app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${VORTEX_ACQUIA_APP_NAME/ /%20}") app_uuid=$(echo "${app_uuid_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "uuid") [ -z "${app_uuid}" ] && fail "Unable to retrieve an environment UUID." && exit 1 note "Retrieving source environment ID." -envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${DREVOPS_TASK_COPY_DB_ACQUIA_SRC}") +envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${VORTEX_TASK_COPY_DB_ACQUIA_SRC}") src_env_id=$(echo "${envs_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${src_env_id}" ] && fail "Unable to retrieve source environment ID." && exit 1 note "Retrieving destination environment ID." -envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${DREVOPS_TASK_COPY_DB_ACQUIA_DST}") +envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${VORTEX_TASK_COPY_DB_ACQUIA_DST}") dst_env_id=$(echo "${envs_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${dst_env_id}" ] && fail "Unable to retrieve destination environment ID." && exit 1 -note "Copying DB from ${DREVOPS_TASK_COPY_DB_ACQUIA_SRC} to ${DREVOPS_TASK_COPY_DB_ACQUIA_DST} environment." -task_status_json=$(curl -X POST -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d "{\"source\":\"${src_env_id}\", \"name\":\"${DREVOPS_TASK_COPY_DB_ACQUIA_NAME}\"}" "https://cloud.acquia.com/api/environments/${dst_env_id}/databases") +note "Copying DB from ${VORTEX_TASK_COPY_DB_ACQUIA_SRC} to ${VORTEX_TASK_COPY_DB_ACQUIA_DST} environment." +task_status_json=$(curl -X POST -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d "{\"source\":\"${src_env_id}\", \"name\":\"${VORTEX_TASK_COPY_DB_ACQUIA_NAME}\"}" "https://cloud.acquia.com/api/environments/${dst_env_id}/databases") notification_url=$(echo "${task_status_json}" | extract_json_value "_links" | extract_json_value "notification" | extract_json_value "href") echo -n " > Checking task status: " task_completed=0 # shellcheck disable=SC2034 -for i in $(seq 1 "${DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_RETRIES}"); do +for i in $(seq 1 "${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_RETRIES}"); do echo -n "." - sleep "${DREVOPS_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL}" + sleep "${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL}" task_status_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "${notification_url}") task_state=$(echo "${task_status_json}" | extract_json_value "status") [ "${task_state}" = "completed" ] && task_completed=1 && break note "Retrieving authentication token." - token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") + token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 done @@ -130,11 +130,11 @@ done echo if [ "${task_completed}" = "0" ]; then - fail "Unable to copy DB from ${DREVOPS_TASK_COPY_DB_ACQUIA_SRC} to ${DREVOPS_TASK_COPY_DB_ACQUIA_DST} environment." + fail "Unable to copy DB from ${VORTEX_TASK_COPY_DB_ACQUIA_SRC} to ${VORTEX_TASK_COPY_DB_ACQUIA_DST} environment." exit 1 fi -note "Copied DB from ${DREVOPS_TASK_COPY_DB_ACQUIA_SRC} to ${DREVOPS_TASK_COPY_DB_ACQUIA_DST} environment." +note "Copied DB from ${VORTEX_TASK_COPY_DB_ACQUIA_SRC} to ${VORTEX_TASK_COPY_DB_ACQUIA_DST} environment." self_elapsed_time=$((SECONDS)) note "Run duration: $((self_elapsed_time / 60)) min $((self_elapsed_time % 60)) sec." diff --git a/scripts/drevops/task-copy-files-acquia.sh b/scripts/vortex/task-copy-files-acquia.sh similarity index 66% rename from scripts/drevops/task-copy-files-acquia.sh rename to scripts/vortex/task-copy-files-acquia.sh index 006ee6c32..9e55f88ea 100755 --- a/scripts/drevops/task-copy-files-acquia.sh +++ b/scripts/vortex/task-copy-files-acquia.sh @@ -16,29 +16,29 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Acquia Cloud API key. -DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY:-${DREVOPS_ACQUIA_KEY}}" +VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:-${VORTEX_ACQUIA_KEY}}" # Acquia Cloud API secret. -DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET:-${DREVOPS_ACQUIA_SECRET}}" +VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:-${VORTEX_ACQUIA_SECRET}}" # Application name. Used to discover UUID. -DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-${DREVOPS_ACQUIA_APP_NAME}}" +VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${VORTEX_ACQUIA_APP_NAME}}" # Source environment name to copy from. -DREVOPS_TASK_COPY_FILES_ACQUIA_SRC="${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC:-}" +VORTEX_TASK_COPY_FILES_ACQUIA_SRC="${VORTEX_TASK_COPY_FILES_ACQUIA_SRC:-}" # Destination environment name to copy to. -DREVOPS_TASK_COPY_FILES_ACQUIA_DST="${DREVOPS_TASK_COPY_FILES_ACQUIA_DST:-}" +VORTEX_TASK_COPY_FILES_ACQUIA_DST="${VORTEX_TASK_COPY_FILES_ACQUIA_DST:-}" # Number of status retrieval retries. If this limit reached and task has not # yet finished, the task is considered failed. -DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES="${DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES:-300}" +VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES="${VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES:-300}" # Interval in seconds to check task status. -DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL="${DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL:-10}" +VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL="${VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL:-10}" #------------------------------------------------------------------------------- @@ -74,50 +74,50 @@ extract_json_value() { } # Check that all required variables are present. -[ -z "${DREVOPS_ACQUIA_KEY}" ] && fail "Missing value for DREVOPS_ACQUIA_KEY." && exit 1 -[ -z "${DREVOPS_ACQUIA_SECRET}" ] && fail "Missing value for DREVOPS_ACQUIA_SECRET." && exit 1 -[ -z "${DREVOPS_ACQUIA_APP_NAME}" ] && fail "Missing value for DREVOPS_ACQUIA_APP_NAME." && exit 1 -[ -z "${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC}" ] && fail "Missing value for DREVOPS_TASK_COPY_FILES_ACQUIA_SRC." && exit 1 -[ -z "${DREVOPS_TASK_COPY_FILES_ACQUIA_DST}" ] && fail "Missing value for DREVOPS_TASK_COPY_FILES_ACQUIA_DST." && exit 1 -[ -z "${DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES}" ] && fail "Missing value for DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES." && exit 1 -[ -z "${DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL}" ] && fail "Missing value for DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL." && exit 1 +[ -z "${VORTEX_ACQUIA_KEY}" ] && fail "Missing value for VORTEX_ACQUIA_KEY." && exit 1 +[ -z "${VORTEX_ACQUIA_SECRET}" ] && fail "Missing value for VORTEX_ACQUIA_SECRET." && exit 1 +[ -z "${VORTEX_ACQUIA_APP_NAME}" ] && fail "Missing value for VORTEX_ACQUIA_APP_NAME." && exit 1 +[ -z "${VORTEX_TASK_COPY_FILES_ACQUIA_SRC}" ] && fail "Missing value for VORTEX_TASK_COPY_FILES_ACQUIA_SRC." && exit 1 +[ -z "${VORTEX_TASK_COPY_FILES_ACQUIA_DST}" ] && fail "Missing value for VORTEX_TASK_COPY_FILES_ACQUIA_DST." && exit 1 +[ -z "${VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES}" ] && fail "Missing value for VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES." && exit 1 +[ -z "${VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL}" ] && fail "Missing value for VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL." && exit 1 note "Retrieving authentication token." -token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") +token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 -note "Retrieving ${DREVOPS_ACQUIA_APP_NAME} application UUID." -app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${DREVOPS_ACQUIA_APP_NAME/ /%20}") +note "Retrieving ${VORTEX_ACQUIA_APP_NAME} application UUID." +app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${VORTEX_ACQUIA_APP_NAME/ /%20}") app_uuid=$(echo "${app_uuid_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "uuid") [ -z "${app_uuid}" ] && fail "Unable to retrieve an environment UUID." && exit 1 note "Retrieving source environment ID." -envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC}") +envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${VORTEX_TASK_COPY_FILES_ACQUIA_SRC}") src_env_id=$(echo "${envs_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${src_env_id}" ] && fail "Unable to retrieve source environment ID." && exit 1 note "Retrieving destination environment ID." -envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${DREVOPS_TASK_COPY_FILES_ACQUIA_DST}") +envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${VORTEX_TASK_COPY_FILES_ACQUIA_DST}") dst_env_id=$(echo "${envs_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${dst_env_id}" ] && fail "Unable to retrieve destination environment ID." && exit 1 -note "Copying files from ${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC} to ${DREVOPS_TASK_COPY_FILES_ACQUIA_DST} environment." +note "Copying files from ${VORTEX_TASK_COPY_FILES_ACQUIA_SRC} to ${VORTEX_TASK_COPY_FILES_ACQUIA_DST} environment." task_status_json=$(curl -X POST -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d "{\"source\":\"${src_env_id}\"}" "https://cloud.acquia.com/api/environments/${dst_env_id}/files") notification_url=$(echo "${task_status_json}" | extract_json_value "_links" | extract_json_value "notification" | extract_json_value "href") echo -n " > Checking task status: " task_completed=0 # shellcheck disable=SC2034 -for i in $(seq 1 "${DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES}"); do +for i in $(seq 1 "${VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_RETRIES}"); do echo -n "." - sleep "${DREVOPS_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL}" + sleep "${VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL}" task_status_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "${notification_url}") task_state=$(echo "${task_status_json}" | extract_json_value "status") [ "${task_state}" = "completed" ] && task_completed=1 && break note "Retrieving authentication token." - token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") + token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 done @@ -125,11 +125,11 @@ done echo if [ "${task_completed}" = "0" ]; then - fail "Unable to copy files from ${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC} to ${DREVOPS_TASK_COPY_FILES_ACQUIA_DST} environment." + fail "Unable to copy files from ${VORTEX_TASK_COPY_FILES_ACQUIA_SRC} to ${VORTEX_TASK_COPY_FILES_ACQUIA_DST} environment." exit 1 fi -note "Copied files from ${DREVOPS_TASK_COPY_FILES_ACQUIA_SRC} to ${DREVOPS_TASK_COPY_FILES_ACQUIA_DST} environment." +note "Copied files from ${VORTEX_TASK_COPY_FILES_ACQUIA_SRC} to ${VORTEX_TASK_COPY_FILES_ACQUIA_DST} environment." self_elapsed_time=$((SECONDS)) note "Run duration: $((self_elapsed_time / 60)) min $((self_elapsed_time % 60)) sec." diff --git a/scripts/vortex/task-custom-lagoon.sh b/scripts/vortex/task-custom-lagoon.sh new file mode 100755 index 000000000..7337508a0 --- /dev/null +++ b/scripts/vortex/task-custom-lagoon.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +## +# Run custom Lagoon task. +# +# @see https://github.com/amazeeio/lagoon-cli +# +# shellcheck disable=SC1090,SC1091 + +t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t + +set -eu +[ "${VORTEX_DEBUG-}" = "1" ] && set -x + +# The task name. +VORTEX_TASK_LAGOON_NAME="${VORTEX_TASK_LAGOON_NAME:-Automation task}" + +# The Lagoon project to run tasks for. +VORTEX_TASK_LAGOON_PROJECT="${VORTEX_TASK_LAGOON_PROJECT:-${LAGOON_PROJECT:-}}" + +# The Lagoon branch to run the task on. +VORTEX_TASK_LAGOON_BRANCH="${VORTEX_TASK_LAGOON_BRANCH:-}" + +# The task command to execute. +VORTEX_TASK_LAGOON_COMMAND="${VORTEX_TASK_LAGOON_COMMAND:-}" + +# The Lagoon instance name to interact with. +VORTEX_TASK_LAGOON_INSTANCE="${VORTEX_TASK_LAGOON_INSTANCE:-amazeeio}" + +# The Lagoon instance GraphQL endpoint to interact with. +VORTEX_TASK_LAGOON_INSTANCE_GRAPHQL="${VORTEX_TASK_LAGOON_INSTANCE_GRAPHQL:-https://api.lagoon.amazeeio.cloud/graphql}" + +# The Lagoon instance hostname to interact with. +VORTEX_TASK_LAGOON_INSTANCE_HOSTNAME="${VORTEX_TASK_LAGOON_INSTANCE_HOSTNAME:-ssh.lagoon.amazeeio.cloud}" + +# The Lagoon instance port to interact with. +VORTEX_TASK_LAGOON_INSTANCE_PORT="${VORTEX_TASK_LAGOON_INSTANCE_PORT:-32222}" + +# SSH key fingerprint used to connect to a remote. +VORTEX_TASK_SSH_FINGERPRINT="${VORTEX_TASK_SSH_FINGERPRINT:-}" + +# Default SSH file used if custom fingerprint is not provided. +VORTEX_TASK_SSH_FILE="${VORTEX_TASK_SSH_FILE:-${HOME}/.ssh/id_rsa}" + +# Location of the Lagoon CLI binary. +VORTEX_LAGOONCLI_PATH="${VORTEX_LAGOONCLI_PATH:-/tmp}" + +# Flag to force the installation of Lagoon CLI. +VORTEX_LAGOONCLI_FORCE_INSTALL="${VORTEX_LAGOONCLI_FORCE_INSTALL:-}" + +# Lagoon CLI version to use. +VORTEX_LAGOONCLI_VERSION="${VORTEX_LAGOONCLI_VERSION:-latest}" + +# ------------------------------------------------------------------------------ + +# @formatter:off +note() { printf " %s\n" "${1}"; } +info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; } +pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; } +fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } +# @formatter:on + +info "Started Lagoon task ${VORTEX_TASK_LAGOON_NAME}." + +## Check all required values. +[ -z "${VORTEX_TASK_LAGOON_NAME}" ] && echo "Missing required value for VORTEX_TASK_LAGOON_NAME." && exit 1 +[ -z "${VORTEX_TASK_LAGOON_BRANCH}" ] && echo "Missing required value for VORTEX_TASK_LAGOON_BRANCH." && exit 1 +[ -z "${VORTEX_TASK_LAGOON_COMMAND}" ] && echo "Missing required value for VORTEX_TASK_LAGOON_COMMAND." && exit 1 +[ -z "${VORTEX_TASK_LAGOON_PROJECT}" ] && echo "Missing required value for VORTEX_TASK_LAGOON_PROJECT." && exit 1 + +export VORTEX_SSH_PREFIX="TASK" && . ./scripts/vortex/setup-ssh.sh + +if ! command -v lagoon >/dev/null || [ -n "${VORTEX_LAGOONCLI_FORCE_INSTALL}" ]; then + note "Installing Lagoon CLI." + + lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/latest" + if [ "${VORTEX_LAGOONCLI_VERSION}" != "latest" ]; then + lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/tags/${VORTEX_LAGOONCLI_VERSION}" + fi + + curl -sL "${lagooncli_download_url}" | + grep "browser_download_url" | + grep -i "$(uname -s)-amd64\"$" | + cut -d '"' -f 4 | + xargs curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" + chmod +x "${VORTEX_LAGOONCLI_PATH}/lagoon" + export PATH="${PATH}:${VORTEX_LAGOONCLI_PATH}" +fi + +for cmd in curl lagoon; do command -v ${cmd} >/dev/null || { + fail "Command ${cmd} is not available" + exit 1 +}; done + +note "Configuring Lagoon instance." +#shellcheck disable=SC2218 +lagoon config add --force -l "${VORTEX_TASK_LAGOON_INSTANCE}" -g "${VORTEX_TASK_LAGOON_INSTANCE_GRAPHQL}" -H "${VORTEX_TASK_LAGOON_INSTANCE_HOSTNAME}" -P "${VORTEX_TASK_LAGOON_INSTANCE_PORT}" + +lagoon() { command lagoon --force --skip-update-check -i "${VORTEX_TASK_SSH_FILE}" -l "${VORTEX_TASK_LAGOON_INSTANCE}" -p "${VORTEX_TASK_LAGOON_PROJECT}" "$@"; } + +note "Creating ${VORTEX_TASK_LAGOON_NAME} task: project ${VORTEX_TASK_LAGOON_PROJECT}, branch: ${VORTEX_TASK_LAGOON_BRANCH}." +lagoon run custom -e "${VORTEX_TASK_LAGOON_BRANCH}" -N "${VORTEX_TASK_LAGOON_NAME}" -c "${VORTEX_TASK_LAGOON_COMMAND}" + +pass "Finished Lagoon task ${VORTEX_TASK_LAGOON_NAME}." diff --git a/scripts/drevops/task-purge-cache-acquia.sh b/scripts/vortex/task-purge-cache-acquia.sh similarity index 68% rename from scripts/drevops/task-purge-cache-acquia.sh rename to scripts/vortex/task-purge-cache-acquia.sh index a7e528f95..d3ce02687 100755 --- a/scripts/drevops/task-purge-cache-acquia.sh +++ b/scripts/vortex/task-purge-cache-acquia.sh @@ -16,29 +16,29 @@ t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Acquia Cloud API key. -DREVOPS_ACQUIA_KEY="${DREVOPS_ACQUIA_KEY:-${DREVOPS_ACQUIA_KEY}}" +VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:-${VORTEX_ACQUIA_KEY}}" # Acquia Cloud API secret. -DREVOPS_ACQUIA_SECRET="${DREVOPS_ACQUIA_SECRET:-${DREVOPS_ACQUIA_SECRET}}" +VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:-${VORTEX_ACQUIA_SECRET}}" # Application name. Used to discover UUID. -DREVOPS_ACQUIA_APP_NAME="${DREVOPS_ACQUIA_APP_NAME:-}" +VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-}" # An environment name to purge cache for. -DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV:-}" +VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV="${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV:-}" # File with a list of domains that should be purged. -DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE:-domains.txt}" +VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE="${VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE:-domains.txt}" # Number of status retrieval retries. If this limit reached and task has not # yet finished, the task is considered failed. -DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES:-300}" +VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES="${VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES:-300}" # Interval in seconds to check task status. -DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL:-10}" +VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL="${VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL:-10}" #------------------------------------------------------------------------------- @@ -74,32 +74,32 @@ extract_json_value() { } # Check that all required variables are present. -[ -z "${DREVOPS_ACQUIA_KEY}" ] && fail "Missing value for DREVOPS_ACQUIA_KEY." && exit 1 -[ -z "${DREVOPS_ACQUIA_SECRET}" ] && fail "Missing value for DREVOPS_ACQUIA_SECRET." && exit 1 -[ -z "${DREVOPS_ACQUIA_APP_NAME}" ] && fail "Missing value for DREVOPS_ACQUIA_APP_NAME." && exit 1 -[ -z "${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV}" ] && fail "Missing value for DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV." && exit 1 -[ -z "${DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE}" ] && fail "Missing value for DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE." && exit 1 -[ -z "${DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES}" ] && fail "Missing value for DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES." && exit 1 -[ -z "${DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL}" ] && fail "Missing value for DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL." && exit 1 +[ -z "${VORTEX_ACQUIA_KEY}" ] && fail "Missing value for VORTEX_ACQUIA_KEY." && exit 1 +[ -z "${VORTEX_ACQUIA_SECRET}" ] && fail "Missing value for VORTEX_ACQUIA_SECRET." && exit 1 +[ -z "${VORTEX_ACQUIA_APP_NAME}" ] && fail "Missing value for VORTEX_ACQUIA_APP_NAME." && exit 1 +[ -z "${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV}" ] && fail "Missing value for VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV." && exit 1 +[ -z "${VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE}" ] && fail "Missing value for VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE." && exit 1 +[ -z "${VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES}" ] && fail "Missing value for VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES." && exit 1 +[ -z "${VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL}" ] && fail "Missing value for VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL." && exit 1 note "Retrieving authentication token." -token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") +token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 -note "Retrieving ${DREVOPS_ACQUIA_APP_NAME} application UUID." -app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${DREVOPS_ACQUIA_APP_NAME/ /%20}") +note "Retrieving ${VORTEX_ACQUIA_APP_NAME} application UUID." +app_uuid_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications?filter=name%3D${VORTEX_ACQUIA_APP_NAME/ /%20}") app_uuid=$(echo "${app_uuid_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "uuid") [ -z "${app_uuid}" ] && fail "Unable to retrieve an environment UUID." && exit 1 note "Retrieving environment ID." -envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV}") +envs_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "https://cloud.acquia.com/api/applications/${app_uuid}/environments?filter=name%3D${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV}") ENV_ID=$(echo "${envs_json}" | extract_json_value "_embedded" | extract_json_value "items" | extract_json_last_value "id") [ -z "${ENV_ID}" ] && fail "Unable to retrieve environment ID." && exit 1 note "Compiling a list of domains." -target_env="${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV}" +target_env="${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV}" domain_list=() while read -r domain; do # Special variable to remap target env to the sub-domain prefix based on UI name. @@ -127,51 +127,51 @@ while read -r domain; do # Add domain to list. domain_list+=("${domain}") fi -done <"${DREVOPS_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE}" +done <"${VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE}" if [ "${#domain_list[@]}" -gt 0 ]; then # Acquia API stops clearing purging caches if at least 1 domain fails, so # we are clearing caches for every domain separately and not failing if # the domain is not found. for domain in "${domain_list[@]}"; do - note "Purging cache for ${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain}." + note "Purging cache for ${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain}." task_status_json=$(curl -X POST -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d "{\"domains\":[\"${domain}\"]}" "https://cloud.acquia.com/api/environments/${ENV_ID}/domains/actions/clear-varnish") notification_url=$(echo "${task_status_json}" | extract_json_value "_links" | extract_json_value "notification" | extract_json_value "href") || true # If domain does not exist - notification will be empty; we are skipping # non-existing domains without a failure. if [ "${notification_url}" = "" ]; then - note "Warning: Unable to purge cache for ${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain} as it does not exist." + note "Warning: Unable to purge cache for ${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain} as it does not exist." break fi echo -n " > Checking task status: " task_completed=0 # shellcheck disable=SC2034 - for i in $(seq 1 "${DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES}"); do + for i in $(seq 1 "${VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_RETRIES}"); do echo -n "." - sleep "${DREVOPS_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL}" + sleep "${VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL}" task_status_json=$(curl -s -L -H 'Accept: application/json, version=2' -H "Authorization: Bearer ${token}" "${notification_url}") task_state=$(echo "${task_status_json}" | extract_json_value "status") if [ "${task_state}" = "completed" ]; then - note "Purged cache for ${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain}." + note "Purged cache for ${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain}." task_completed=1 break 1 fi note "Retrieving authentication token." - token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${DREVOPS_ACQUIA_KEY}" --data-urlencode "client_secret=${DREVOPS_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") + token_json=$(curl -s -L https://accounts.acquia.com/api/auth/oauth/token --data-urlencode "client_id=${VORTEX_ACQUIA_KEY}" --data-urlencode "client_secret=${VORTEX_ACQUIA_SECRET}" --data-urlencode "grant_type=client_credentials") token=$(echo "${token_json}" | extract_json_value "access_token") [ -z "${token}" ] && fail "Unable to retrieve a token." && exit 1 done echo if [ "${task_completed}" = "0" ]; then - note "Warning: Unable to purge cache for ${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain}." + note "Warning: Unable to purge cache for ${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV} environment domain ${domain}." fi done else - note "Unable to find domains to purge cache for ${DREVOPS_TASK_PURGE_CACHE_ACQUIA_ENV} environment." + note "Unable to find domains to purge cache for ${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV} environment." fi self_elapsed_time=$((SECONDS)) diff --git a/scripts/drevops/update-scaffold.sh b/scripts/vortex/update-vortex.sh similarity index 61% rename from scripts/drevops/update-scaffold.sh rename to scripts/vortex/update-vortex.sh index 0f220de0f..b3a14b8b4 100755 --- a/scripts/drevops/update-scaffold.sh +++ b/scripts/vortex/update-vortex.sh @@ -1,34 +1,34 @@ #!/usr/bin/env bash ## -# Update DrevOps Scaffold. +# Update DrevOps Vortex. # # shellcheck disable=SC1090,SC1091 t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && if [ -f ./.env.local ]; then . ./.env.local; fi && set +a && . "${t}" && rm "${t}" && unset t set -eu -[ "${DREVOPS_DEBUG-}" = "1" ] && set -x +[ "${VORTEX_DEBUG-}" = "1" ] && set -x # Re-export variables only from .env to ignore any local overrides in .env.local. # shellcheck disable=SC1091 set -a && . ./.env && set +a -# Allow providing custom Scaffold commit hash to download the sources from. -DREVOPS_INSTALL_COMMIT="${DREVOPS_INSTALL_COMMIT:-${1:-}}" +# Allow providing custom Vortex commit hash to download the sources from. +VORTEX_INSTALL_COMMIT="${VORTEX_INSTALL_COMMIT:-${1:-}}" # The URL of the installer script. -DREVOPS_INSTALLER_URL="${DREVOPS_INSTALLER_URL:-https://install.drevops.com}" +VORTEX_INSTALLER_URL="${VORTEX_INSTALLER_URL:-https://install.drevops.com}" # ------------------------------------------------------------------------------ -export DREVOPS_INSTALLER_URL -export DREVOPS_INSTALL_COMMIT +export VORTEX_INSTALLER_URL +export VORTEX_INSTALL_COMMIT for cmd in php curl; do command -v ${cmd} >/dev/null || { fail "Command ${cmd} is not available" exit 1 }; done -curl -L "${DREVOPS_INSTALLER_URL}"?"$(date +%s)" >/tmp/install +curl -L "${VORTEX_INSTALLER_URL}"?"$(date +%s)" >/tmp/install php /tmp/install --quiet rm /tmp/install >/dev/null diff --git a/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e8ec6c115..332d1f3ea 100644 --- a/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -111,7 +111,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_GIT_BRANCH' => 'main', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => 'main', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], static::ENVIRONMENT_PROD, @@ -120,7 +120,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_GIT_BRANCH' => 'main', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => 'master', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], static::ENVIRONMENT_TEST, @@ -129,7 +129,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_GIT_BRANCH' => 'master', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], static::ENVIRONMENT_TEST, @@ -138,7 +138,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_GIT_BRANCH' => 'master', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, 'LAGOON_ENVIRONMENT_TYPE' => 'production', ], static::ENVIRONMENT_PROD, @@ -147,7 +147,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_GIT_BRANCH' => 'main', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], static::ENVIRONMENT_TEST, @@ -156,7 +156,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_GIT_BRANCH' => 'main', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, 'LAGOON_ENVIRONMENT_TYPE' => 'production', ], static::ENVIRONMENT_PROD, @@ -207,7 +207,7 @@ public function dataProviderEnvironmentTypeResolution(): array { [ 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ], static::ENVIRONMENT_DEV, ], @@ -216,7 +216,7 @@ public function dataProviderEnvironmentTypeResolution(): array { 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', 'LAGOON_GIT_BRANCH' => FALSE, - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ], static::ENVIRONMENT_DEV, ], @@ -225,7 +225,7 @@ public function dataProviderEnvironmentTypeResolution(): array { 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', 'LAGOON_GIT_BRANCH' => 'somebranch', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ], static::ENVIRONMENT_DEV, ], @@ -234,7 +234,7 @@ public function dataProviderEnvironmentTypeResolution(): array { 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', 'LAGOON_GIT_BRANCH' => FALSE, - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', ], static::ENVIRONMENT_DEV, ], @@ -243,7 +243,7 @@ public function dataProviderEnvironmentTypeResolution(): array { 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', 'LAGOON_GIT_BRANCH' => 'somebranch', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', ], static::ENVIRONMENT_DEV, ], @@ -252,7 +252,7 @@ public function dataProviderEnvironmentTypeResolution(): array { 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', 'LAGOON_GIT_BRANCH' => '', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => '', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', ], static::ENVIRONMENT_DEV, ], @@ -261,7 +261,7 @@ public function dataProviderEnvironmentTypeResolution(): array { 'LAGOON_KUBERNETES' => 1, 'LAGOON_ENVIRONMENT_TYPE' => 'development', 'LAGOON_GIT_BRANCH' => 'mainbranch', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', ], static::ENVIRONMENT_PROD, ], @@ -745,7 +745,7 @@ public function testEnvironmentLagoonProd(): void { 'LAGOON_PROJECT' => 'test_project', 'LAGOON_GIT_BRANCH' => 'production', 'LAGOON_GIT_SAFE_BRANCH' => 'production', - 'DREVOPS_LAGOON_PRODUCTION_BRANCH' => 'production', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'production', ]); $this->requireSettingsFile(); diff --git a/tests/phpunit/Drupal/SettingsTestCase.php b/tests/phpunit/Drupal/SettingsTestCase.php index e9cda0cb6..1d169c098 100644 --- a/tests/phpunit/Drupal/SettingsTestCase.php +++ b/tests/phpunit/Drupal/SettingsTestCase.php @@ -145,7 +145,7 @@ protected function setEnvVars(array $vars): void { 'GITHUB_', 'DOCKER_', // DrevOps and Drupal variables. - 'DREVOPS_', + 'VORTEX_', 'DRUPAL_', ]); diff --git a/tests/phpunit/Drupal/SwitchableSettingsTest.php b/tests/phpunit/Drupal/SwitchableSettingsTest.php index 0170ec44a..7b71d2337 100644 --- a/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -235,7 +235,7 @@ public function testRedis(): void { 'DRUPAL_REDIS_ENABLED' => 1, 'REDIS_HOST' => 'redis_host', 'REDIS_SERVICE_PORT' => 1234, - 'DREVOPS_REDIS_EXTENSION_LOADED' => 1, + 'VORTEX_REDIS_EXTENSION_LOADED' => 1, ]); $this->requireSettingsFile(); @@ -259,7 +259,7 @@ public function testRedisPartial(): void { 'DRUPAL_REDIS_ENABLED' => 1, 'REDIS_HOST' => 'redis_host', 'REDIS_SERVICE_PORT' => 1234, - 'DREVOPS_REDIS_EXTENSION_LOADED' => 0, + 'VORTEX_REDIS_EXTENSION_LOADED' => 0, ]); $this->requireSettingsFile(); diff --git a/web/robots.txt b/web/robots.txt index 3ad8e2e8d..7979e53da 100644 --- a/web/robots.txt +++ b/web/robots.txt @@ -40,7 +40,7 @@ Disallow: /profiles/ Disallow: /README.md Disallow: /composer/Metapackage/README.txt Disallow: /composer/Plugin/ProjectMessage/README.md -Disallow: /composer/Plugin/Scaffold/README.md +Disallow: /composer/Plugin/Vortex/README.md Disallow: /composer/Plugin/VendorHardening/README.txt Disallow: /composer/Template/README.txt Disallow: /modules/README.txt diff --git a/web/sites/default/includes/modules/settings.redis.php b/web/sites/default/includes/modules/settings.redis.php index 52c7968dc..1e748b81e 100644 --- a/web/sites/default/includes/modules/settings.redis.php +++ b/web/sites/default/includes/modules/settings.redis.php @@ -30,8 +30,8 @@ $settings['redis.connection']['port'] = getenv('REDIS_SERVICE_PORT') ?: '6379'; // Do not set the cache during installations of Drupal, but allow - // to override this by setting DREVOPS_REDIS_EXTENSION_LOADED to non-zero. - if ((extension_loaded('redis') && getenv('DREVOPS_REDIS_EXTENSION_LOADED') === FALSE) || !empty(getenv('DREVOPS_REDIS_EXTENSION_LOADED'))) { + // to override this by setting VORTEX_REDIS_EXTENSION_LOADED to non-zero. + if ((extension_loaded('redis') && getenv('VORTEX_REDIS_EXTENSION_LOADED') === FALSE) || !empty(getenv('VORTEX_REDIS_EXTENSION_LOADED'))) { $settings['cache']['default'] = 'cache.backend.redis'; if (!isset($class_loader)) { diff --git a/web/sites/default/includes/providers/settings.lagoon.php b/web/sites/default/includes/providers/settings.lagoon.php index a890f308d..24c3d5b3a 100644 --- a/web/sites/default/includes/providers/settings.lagoon.php +++ b/web/sites/default/includes/providers/settings.lagoon.php @@ -23,7 +23,7 @@ // Try to identify production environment using a branch name for // the cases when the Lagoon environment is not marked as 'production' yet. - if (!empty(getenv('LAGOON_GIT_BRANCH')) && !empty(getenv('DREVOPS_LAGOON_PRODUCTION_BRANCH')) && getenv('LAGOON_GIT_BRANCH') === getenv('DREVOPS_LAGOON_PRODUCTION_BRANCH')) { + if (!empty(getenv('LAGOON_GIT_BRANCH')) && !empty(getenv('VORTEX_LAGOON_PRODUCTION_BRANCH')) && getenv('LAGOON_GIT_BRANCH') === getenv('VORTEX_LAGOON_PRODUCTION_BRANCH')) { $settings['environment'] = ENVIRONMENT_PROD; } // Dedicated test environment based on a branch name. @@ -48,7 +48,7 @@ $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; // Cache prefix. - $settings['cache_prefix']['default'] = (getenv('LAGOON_PROJECT') ?: getenv('DREVOPS_PROJECT')) . '_' . (getenv('LAGOON_GIT_SAFE_BRANCH') ?: getenv('DREVOPS_LAGOON_PRODUCTION_BRANCH')); + $settings['cache_prefix']['default'] = (getenv('LAGOON_PROJECT') ?: getenv('VORTEX_PROJECT')) . '_' . (getenv('LAGOON_GIT_SAFE_BRANCH') ?: getenv('VORTEX_LAGOON_PRODUCTION_BRANCH')); // Trusted host patterns for Lagoon internal routes. // Do not modify this section. Instead, add your custom patterns to the diff --git a/web/themes/custom/your_site_theme/logo.png b/web/themes/custom/your_site_theme/logo.png index a94820bf8..4591bcb9a 100644 Binary files a/web/themes/custom/your_site_theme/logo.png and b/web/themes/custom/your_site_theme/logo.png differ diff --git a/web/themes/custom/your_site_theme/logo.svg b/web/themes/custom/your_site_theme/logo.svg index 3bf55ca81..8f1a47f9e 100644 --- a/web/themes/custom/your_site_theme/logo.svg +++ b/web/themes/custom/your_site_theme/logo.svg @@ -1,11 +1,9 @@ - - - - Shape 2 - Created with Sketch. - - - - - - \ No newline at end of file + + + + + + + + +