forked from cesarams/prestashop-ee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
225 lines (207 loc) · 8.42 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
sudo: false
dist: trusty
language: php
env:
global:
- COMPOSER_ARGS="--no-interaction"
- PRESTASHOP_RELEASES_FILE=${TRAVIS_BUILD_DIR}/.bin/compatible-shop-releases.txt
- SHOP_SYSTEM_UPDATE_COMMIT="Update latest shop releases"
- MANUAL_UITEST_TRIGGER_COMMIT="Test my build"
- PATCH_RELEASE="patch"
- MINOR_RELEASE="minor"
- MAJOR_RELEASE="major"
- PRESTASHOP_COMPATIBILITY_FILE=${TRAVIS_BUILD_DIR}/.bin/new-shop-releases.txt
matrix:
allow_failures:
- stage: phraseapp-check-if-in-sync
- stage: acceptance-test
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=1
- ALLOW_FAIL=1
- stage: acceptance-test
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=1
- LATEST_EXTENSION_RELEASE=1
- ALLOW_FAIL=1
include:
- php: 5.6
if: env(PHRASEAPP_PULL) != '1' AND type != cron AND commit_message !~ env(SHOP_SYSTEM_UPDATE_COMMIT) AND commit_message !~ env(MANUAL_UITEST_TRIGGER_COMMIT)
- php: 7.0
if: env(PHRASEAPP_PULL) != '1' AND type != cron AND commit_message !~ env(SHOP_SYSTEM_UPDATE_COMMIT) AND commit_message !~ env(MANUAL_UITEST_TRIGGER_COMMIT)
- php: 7.1
if: env(PHRASEAPP_PULL) != '1' AND type != cron AND commit_message !~ env(SHOP_SYSTEM_UPDATE_COMMIT) AND commit_message !~ env(MANUAL_UITEST_TRIGGER_COMMIT)
- stage: validator-test
if: env(VALIDATOR_TEST) = '1'
php: 7.1
before_script:
- pip install --user bs4
- bash .bin/generate-release-package.sh
- travis_retry composer require --dev $COMPOSER_ARGS codeception/codeception:^2.5
script:
- bash .bin/run-validator-test.sh
after_script: skip
- stage: phraseapp-pull
if: env(PHRASEAPP_PULL) = '1'
language: ruby
ruby: 2.5.3
before_install: skip
install:
- travis_retry gem install bundler -v 2.0.1
- travis_retry bundle install
script:
- .bin/rake phraseapp:ci_update
after_script: skip
- stage: phraseapp-check-if-in-sync
if: type != cron AND type = pull_request
language: ruby
ruby: 2.5.3
before_install: skip
install:
- travis_retry gem install bundler -v 2.0.1
- travis_retry bundle install
script:
- .bin/rake phraseapp:ci_check_if_in_sync
after_script: skip
- stage: get-latest-shop-release-versions
if: type = cron
php: 7.1
install: skip
before_script: skip
script: bash .bin/get-latest-shop-release-versions.sh
after_script: skip
after_failure: skip
- &acceptance-test
stage: acceptance-test
# run this stage on pull request if head branch name contains one of these words (patch, major, minor)
# or when build triggered ad-hoc with special commit message
# tests will use extension version = branch which originated pull request
# or branch which was defined in ad-hoc trigger in Travis UI
if: (type = pull_request AND (head_branch =~ env(PATCH_RELEASE) OR head_branch =~ env(MINOR_RELEASE) OR head_branch =~ env(MAJOR_RELEASE))) OR (commit_message =~ env(MANUAL_UITEST_TRIGGER_COMMIT))
php: 7.1
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=1
before_install: skip
install:
# check if files are same or not
- cmp --silent ${PRESTASHOP_RELEASES_FILE} ${PRESTASHOP_COMPATIBILITY_FILE} && export COMPATIBILITY_CHECK=0 || export COMPATIBILITY_CHECK=1
# check from which file to take versions
- if [[ ${COMPATIBILITY_CHECK} == "0" ]]; then export PRESTASHOP_VERSION=$(awk "NR==${PRESTASHOP_RELEASE_VERSION} {print; exit}" ${PRESTASHOP_RELEASES_FILE}); else export PRESTASHOP_VERSION=$(awk "NR==${PRESTASHOP_RELEASE_VERSION} {print; exit}" ${PRESTASHOP_COMPATIBILITY_FILE}); fi
- export LATEST_RELEASED_SHOP_EXTENSION_VERSION=`jq .[0].release ${TRAVIS_BUILD_DIR}/SHOPVERSIONS | tr -d '"'`
- echo "Testing with Prestashop version ${PRESTASHOP_VERSION}"
script: bash .bin/run-ui-tests.sh
after_script: skip
after_success:
- bash .bin/upload-logs-and-notify.sh
- bash .bin/update-shop-release-versions.sh
after_failure:
- bash .bin/upload-logs-and-notify.sh fail
# run this stage on pull request if head branch name contains major (on major release)
# tests will use branch which originated pull request
- <<: *acceptance-test
if: type = pull_request AND head_branch =~ env(MAJOR_RELEASE)
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=2
# run this stage on pull request if head branch name contains major (on major release)
# tests will use branch which originated pull request
- <<: *acceptance-test
if: type = pull_request AND head_branch =~ env(MAJOR_RELEASE)
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=3
# run this stage when shop system updated with latest shop extension release version
# tests will use tip of master branch
- <<: *acceptance-test
if: commit_message =~ env(SHOP_SYSTEM_UPDATE_COMMIT)
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=1
# if this stage fails, it will not fail the whole build
- ALLOW_FAIL=1
# run this stage when shop system updated with latest shop extension release version
# tests will use latest released extension version
- <<: *acceptance-test
if: commit_message =~ env(SHOP_SYSTEM_UPDATE_COMMIT)
env:
- GATEWAY=API-TEST
- PRESTASHOP_RELEASE_VERSION=1
- LATEST_EXTENSION_RELEASE=1
# if this stage fails, it will not fail the whole build
- ALLOW_FAIL=1
- <<: *acceptance-test
if: type = pull_request AND head_branch =~ env(MAJOR_RELEASE)
env:
- GATEWAY=API-WDCEE-TEST
- PRESTASHOP_RELEASE_VERSION=1
- <<: *acceptance-test
if: type = pull_request AND head_branch =~ env(MAJOR_RELEASE)
env:
- GATEWAY=API-WDCEE-TEST
- PRESTASHOP_RELEASE_VERSION=2
- <<: *acceptance-test
if: type = pull_request AND head_branch =~ env(MAJOR_RELEASE)
env:
- GATEWAY=API-WDCEE-TEST
- PRESTASHOP_RELEASE_VERSION=3
- stage: deploy
if: tag IS present AND type = push
language: php
php: 7.1
before_install: skip
install:
- travis_retry composer require --dev $COMPOSER_ARGS
- travis_retry composer install $COMPOSER_ARGS
- rvm install 2.5.3
- travis_retry gem install bundler -v 2.0.1
after_install: skip
before_script: skip
script: skip
after_script: skip
before_deploy:
- export REPO_NAME=`echo $TRAVIS_REPO_SLUG | awk -F'/' '{print $2}'`
- export RELEASE_NOTES=$(composer make-release-notes)
- bash .bin/generate-wiki-notes.sh
- bash .bin/generate-readme-badge.sh
- bash .bin/generate-release-package.sh $TRAVIS_TAG
deploy:
provider: releases
github_token: ${GITHUB_TOKEN}
api_key: ${GITHUB_TOKEN}
file: wirecardpaymentgateway.zip
name: "${REPO_NAME} ${TRAVIS_TAG}"
body: "${RELEASE_NOTES}"
skip_cleanup: true
on:
repo: ${TRAVIS_REPO_SLUG}
tags: true
after_deploy:
- export TMPDIR=/tmp/wirecard
- git clone -b master --depth 1 https://[email protected]/$DEPLOYMENT_PROJECT $TMPDIR
- cd $TMPDIR && travis_retry bundle install
- bin/rake trigger_build
before_install:
- travis_retry composer global require hirak/prestissimo
install:
- travis_retry composer require --dev $COMPOSER_ARGS
- travis_retry composer install $COMPOSER_ARGS
- composer show
script:
- composer test-coverage
- composer cs-check
after_script:
- travis_retry composer upload-coverage
- bash .bin/generate-tag.sh
notifications:
email: false
slack:
rooms:
secure: YI7sUrfMyKyJD60kElGkO7yBDkGEh+069yS8bFAIDUST7s48J+dDP/r2G9dN9oQwhs9hvNjpNytpZDPys838T+Z0mNtFZ9Wu022hV3MpbKUuMl7L9P0MQQmxjg4bKyKK3Hl9tPrZ3UsKRlwIUmRGGYQ7cjs4zumorqs19YsB3X+WnnxAmmYB3kHQYfNKgVnmcG2QHJyx5KaLZ0EsWynSHXkYb8bVCtdlbQFNnpChvGHPprZrHAszLCYnlU7AEZGdbuk17oIfXO9Wjuu1GV8iJ2VgKkTCzW4FBC5eHJyZezojPFUm1I5tvdihRZuyBekVGOF23J6pvHLqPx77clT+/Vn6T+UMDuh1INZ0LKt4UOU42oEDKGblWZx2VYWcHwfEK+ckJWZkT9EBfg/CMenJly2tbtBj6++XNvxgGEDn6XqKIEatcb7X/aiy4f8BPXa3/pzgZAlvzZbGGqHFNZPAlgcXBBXgbaC7VvMhvi6Z5AG5ylKzPS5GCD95ozPC+cGv0234TBJus5oZck4qNiT53IUQ7Ta+OGVB0Mea105VAoQI0I7YcgaqW6c4h2YTmnuuQsIzAwPOrJ5TAinj8Z8mZ9C11tEcNF3Pgy1tOoG/YLurhOJm7v1ebotRb/DIeSHU8RfNatnDSSky4YS6Y8k2pQthdC9m7m2f2mJYuGdLjlM=
template:
- "%{repository}#%{build_number} (%{branch} : %{author}): %{message}"
- "Change view : %{compare_url}"
- "Build details : %{build_url}"
on_success: change
on_failure: change