forked from pantheon-systems/terminus-build-tools-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.circle.yml
68 lines (64 loc) · 2.77 KB
/
example.circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Generic circle.yml for using the Terminus Build Tools Plugin to
# test a Pantheon site. See the README for customization instructions.
machine:
timezone:
America/Chicago
php:
version: 7.0.11
environment:
# In addition to the environment variables defined in this file, also
# add the following variables in the Circle CI UI.
#
# See: https://circleci.com/docs/1.0/environment-variables/
#
# TERMINUS_SITE: Name of the Pantheon site to run tests on, e.g. my_site
# TERMINUS_TOKEN: The Pantheon machine token
# GITHUB_TOKEN: The GitHub personal access token
# GIT_EMAIL: The email address to use when making commits
#
# TEST_SITE_NAME: The name of the test site to provide when installing.
# ADMIN_PASSWORD: The admin password to use when installing.
# ADMIN_EMAIL: The email address to give the admin when installing.
#
# The variables below usually do not need to be modified.
BRANCH: $(echo $CIRCLE_BRANCH | grep -v '^\(master\|[0-9]\+.x\)$')
PR_ENV: ${BRANCH:+pr-$BRANCH}
CIRCLE_ENV: ci-$CIRCLE_BUILD_NUM
DEFAULT_ENV: $(echo ${PR_ENV:-$CIRCLE_ENV} | cut -c -11 | sed 's/-$//')
TERMINUS_ENV: ${TERMINUS_ENV:-$DEFAULT_ENV}
NOTIFY: 'scripts/github/add-commit-comment {project} {sha} "Created multidev environment [{site}#{env}]({dashboard-url})." {site-url}'
PATH: $PATH:~/.composer/vendor/bin:~/.config/composer/vendor/bin:tests/scripts
dependencies:
cache_directories:
- ~/.composer/cache
pre:
- echo "Begin build for $CIRCLE_ENV${PR_ENV:+ for }$PR_ENV. Pantheon test environment is $TERMINUS_SITE.$TERMINUS_ENV"
- |
if [ -n "$GITHUB_TOKEN" ] ; then
composer config --global github-oauth.github.com $GITHUB_TOKEN
fi
- git config --global user.email "$GIT_EMAIL"
- git config --global user.name "Circle CI"
override:
- composer global require "hirak/prestissimo:^0.3"
- composer global require "consolidation/cgr"
- cgr "pantheon-systems/terminus:^1"
- terminus --version
- mkdir -p ~/.terminus/plugins
- composer create-project -n -d ~/.terminus/plugins pantheon-systems/terminus-build-tools-plugin:^1
- composer create-project -n -d ~/.terminus/plugins pantheon-systems/terminus-secrets-plugin:^1
post:
- terminus auth:login --machine-token="$TERMINUS_TOKEN"
- terminus build-env:delete:ci -n "$TERMINUS_SITE" --keep=2 --yes
- composer -n build-assets
- terminus env:wake -n "$TERMINUS_SITE.dev"
- terminus build-env:create -n "$TERMINUS_SITE.dev" "$TERMINUS_ENV" --yes --notify="$NOTIFY"
test:
override:
- behat
deployment:
build-assets:
branch: master
commands:
- terminus build-env:merge -n "$TERMINUS_SITE.$TERMINUS_ENV" --yes
- terminus build-env:delete:pr -n "$TERMINUS_SITE" --yes