forked from Yoast/wordpress-seo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
110 lines (102 loc) · 3.98 KB
/
.travis.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
os: linux
dist: xenial
language: php
branches:
only:
- master
- trunk
- /^release\/*/
- /^hotfix\/\d+\.\d+(\.\d+)?(-\S*)?$/
- /^feature\/*/
# Also build tags like 1.1.1 or 1.1 for deployment.
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
jobs:
fast_finish: true
include:
- stage: 🚀 deployment
name: "Deploy to S3"
if: branch = deploy # Only build when on the `deploy` branch, this functionality is not used yet and is taking a long time to complete.
env: SC_ATTR=wordpress-seo
script: grunt artifact
install:
- yarn global add grunt-cli
- yarn install
deploy:
skip_cleanup: true
provider: s3
access_key_id: AKIAJRNLQAPRL5UKDJKQ
secret_access_key:
secure: TE13B5MDyw16DxEIRpbXPtxb1LZAzi8jdCU4FZuTzNsdVaowlAXUEFFB+g8uapoQhJKqvZrwvrpqifRPhH0tcRlJ5Z0A+qWp8WhiFGmipp3gJBblacviAIvswGzKFN8+DgQVwHSKpzk3ZjEkDkH/KYq6OTYPL/g5oRwsjI0Ug9w=
bucket: yoast-seo-builds
region: us-east-1
local-dir: artifact
upload-dir: $TRAVIS_BRANCH
on:
repo: Yoast/wordpress-seo
all_branches: true
- stage: 🚀 deployment
name: "Deploy to Yoast-dist"
php: 7.2
env: TRAVIS_NODE_VERSION=14
install:
- yarn global add grunt-cli
- yarn install
script:
- |
if [[ ! -z "$TRAVIS_TAG" ]]; then
grunt set-version -new-version=$TRAVIS_TAG
grunt update-version
fi
- grunt artifact
if: ( tag IS present OR branch =~ /^feature\// OR branch =~ /^release\// OR branch =~ /^hotfix\// OR branch = trunk ) AND type != pull_request
before_install:
- nvm install $TRAVIS_NODE_VERSION
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- openssl aes-256-cbc -K $encrypted_e268719177eb_key -iv $encrypted_e268719177eb_iv -in config/travis/deploy_keys/id_rsa_yoast_dist.enc -out config/travis/deploy_keys/id_rsa_yoast_dist -d
- chmod 600 config/travis/deploy_keys/id_rsa_yoast_dist
- eval $(ssh-agent -s)
- ssh-add config/travis/deploy_keys/id_rsa_yoast_dist
# If the commit was tagged, create an artifact and push it to the distribution github
deploy:
skip_cleanup: true
provider: script
script: bash config/travis/deploy_to_dist.sh ${TRAVIS_TAG:-$TRAVIS_BRANCH} wordpress-seo
on:
repo: $TRAVIS_REPO_SLUG
all_branches: true
cache:
yarn: true
directories:
- $HOME/.composer/cache
- node_modules
before_install:
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
install:
- |
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "🚀 deployment" ]]; then
# The prefix-dependencies task only works on PHP 7.1 and we need to prefix our dependencies to accurately test them.
# So we temporarily switch PHP versions, do a full install and then remove the package.
# Then switch back to the PHP version we want to test and delete the vendor directory.
phpenv local 7.1
travis_retry composer install --no-interaction --ignore-platform-reqs
travis_retry composer remove humbug/php-scoper --dev --ignore-platform-reqs --no-interaction
travis_retry composer remove atanamo/php-codeshift --dev --ignore-platform-reqs --no-interaction
# Dependency injection compilation only works on PHP 7+.
# It makes use of reflection-based PHP code that only works on PHP 7+.
travis_retry composer du
phpenv local --unset
rm -rf vendor/*
fi
- |
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "🚀 deployment" ]]; then
travis_retry composer update --no-interaction
travis_retry composer install --no-dev --no-interaction
composer du
fi
script:
- git status
notifications:
slack:
secure: W3StABr+AdcdQawTObK4nbsnn5nLrTTtZfVpD/GEN6gvSOQcykbGEC5+ceYg0jn5b4StDyCiTo5blEsrpVICFpYKc44+ogah+qaGRUfVRS/rpOvn4AueXTWn4JxhZzuxqKMiTmyW+MQG0uYM7sk7Q5S+15jj6ilkj4QATaBVNbY=
email: false