-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
60 lines (58 loc) · 2.55 KB
/
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
# https://circleci.com/docs/configuration#machine
machine:
timezone:
America/Chicago
php:
# https://circleci.com/docs/build-image-trusty/#php
version: 7.0.11
environment:
TEST_SITE_NAME: Example D8 Composer Test Site
ADMIN_EMAIL: [email protected]
TERMINUS_SITE: ci-example-d8-composer
BRANCH: $(echo $CIRCLE_BRANCH | grep -v '^\(master\|[0-9]\+.x\)$')
PR_LABEL: ${BRANCH:+pr-$BRANCH}
CI_LABEL: ci-$CIRCLE_BUILD_NUM
TERMINUS_ENV: $(echo ${PR_LABEL:-$CI_LABEL} | cut -c -11 | sed 's/-$//')
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:
# Avoid ssh prompting when connecting to new ssh hosts
- echo "Begin build for $CI_LABEL${PR_LABEL:+ for }$PR_LABEL. Pantheon test environment is $TERMINUS_SITE.$TERMINUS_ENV"
- echo "StrictHostKeyChecking no" >> "$HOME/.ssh/config"
- |
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 -n "hirak/prestissimo:^0.3"
- composer global require -n "consolidation/cgr"
- cgr "pantheon-systems/terminus:~1" --stability beta
- terminus --version
- cgr "drush/drush:~8"
- 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 -n --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:
- run-behat
post:
- terminus secrets:set -n "$TERMINUS_SITE.$TERMINUS_ENV" token "$GITHUB_TOKEN" --file='github-secrets.json' --clear --skip-if-empty
- terminus drush -n "$TERMINUS_SITE.$TERMINUS_ENV" -- pm-enable config_direct_save --yes
deployment:
build-assets:
branch: master
commands:
- terminus build-env:merge -n "$TERMINUS_SITE.$TERMINUS_ENV" --yes
- terminus drush -n $TERMINUS_SITE.dev -- updatedb --yes
- terminus build-env:delete:pr -n "$TERMINUS_SITE" --yes