Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

(WIP) Use Pantheon orb #245

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 23 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,8 @@ defaults: &defaults
# BUILD_TOOLS_VERSION: ^2.0.0-alpha4
TERM: dumb

version: 2
version: 2.1
jobs:
configure_env_vars:
<<: *defaults

docker:
- image: quay.io/pantheon-public/build-tools-ci:5.x

steps:
- checkout

- run:
# Set TERMINUS_ENV and related environment variables.
# https://github.com/pantheon-systems/docker-build-tools-ci/blob/5.x/scripts/set-environment
name: setup-environment-vars
command: /build-tools-ci/scripts/set-environment

- run:
name: clone-bash-env
command: cp $BASH_ENV bash_env.txt

# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
- persist_to_workspace:
root: .
paths:
- bash_env.txt

# @todo: common initialization: 'composer install' for the site-under-test
unit:
<<: *defaults
Expand Down Expand Up @@ -104,35 +79,23 @@ jobs:
steps:
- checkout

- attach_workspace:
at: /tmp/workspace

- run: cp /tmp/workspace/bash_env.txt $BASH_ENV
- run: source $BASH_ENV

- restore_cache:
keys:
- composer-cache

- run:
name: setup-environment-vars
command: /build-tools-ci/scripts/set-environment
name: run composer install again to get dev dependencies
command: composer install

- run:
name: log in
command: terminus -n auth:login --machine-token="$TERMINUS_TOKEN"

- run:
name: install dev dependencies, build assets, etc.
command: ./.ci/scripts/01-prepare

- run:
name: build assets
command: composer -n build-assets

- run:
name: prepare database for site-under test
command: ./.ci/scripts/02-init-site-under-test-clone-existing
# command: ./.ci/scripts/02-init-site-under-test-reinstall-new

- run:
name: run composer install again to get dev dependencies
command: composer install

- run:
name: run functional tests with Behat
command: ./.ci/scripts/03-test
Expand Down Expand Up @@ -187,20 +150,31 @@ jobs:
path: /tmp/artifacts
destination: artifacts

orbs:
pantheon: pantheon-systems/[email protected]

workflows:
version: 2
build_and_test:
jobs:
# Set up environment variables
- configure_env_vars
- pantheon/push:
checkout: false
pre-steps:
- checkout
- run: composer -n install --optimize-autoloader --ignore-platform-reqs --no-dev
- run: composer prepare-for-pantheon
- run: cat .gitignore
- run: git status
# Install dev dependencies and do simple tests (sniff, unit tests, etc.)
- unit
# Build deploy and test on target platform
- functional
- functional:
requires:
- pantheon/push
# Deploy before running visual test
- visual_regression_test:
requires:
- configure_env_vars
- functional
scheduled_update_check:
triggers:
Expand Down