forked from Alfresco/alfresco-ng2-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
183 lines (174 loc) · 7.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
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
language: node_js
dist: trusty
sudo: required
node_js:
# Use the explicit NodeJS LTS version 8.9.4 to avoid any automatic upgrade of the version.
- '8.9.4'
branches:
only:
- master
- development
stages:
- name: Warm Up Cache
if: branch = master
- name: Warm Up Cache & Lint & Build Dist
if: branch != master
- name: Unit test
- name: e2e Test
- name: Create Docker PR
- name: Deploy Docker PR
addons:
chrome: stable
before_script:
- "sudo chown root /opt/google/chrome/chrome-sandbox"
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
branches:
only:
- master
- development
jobs:
include:
- stage: Warm Up Cache
script:
- ./scripts/npm-build-all.sh || exit 1
- stage: Warm Up Cache & Lint & Build Dist
script:
- ./scripts/update-version.sh -gnu -alpha || exit 1
- npm install
- ./scripts/lint.sh || exit 1
- npm run spellcheck || exit 1
- npm run stylelint || exit 1
- rm -rf tmp && (./scripts/smart-build.sh -b $TRAVIS_BRANCH || exit 1;);
- npm run build:dist || exit 1
- stage: Unit test
name: core
script:
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "core$" ]];
then
ng test core --watch=false || exit 1;
fi
- stage: Unit test
name: extensions
script:
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "extensions$" ]];
then
ng test extensions --watch=false || exit 1;
fi
- stage: Unit test
name: process-services
script:
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "process-services$" ]];
then
ng test process-services --watch=false || exit 1;
fi
- stage: Unit test
name: insights
script:
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "insights$" ]];
then
ng test insights --watch=false || exit 1;
fi
- stage: Unit test
name: content-services
script:
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "content-services$" ]];
then
ng test content-services --watch=false || exit 1;
fi
- stage: Unit test
name: process-services-cloud
script:
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" ]];
then
ng test process-services-cloud --watch=false || exit 1;
fi
- stage: Unit test
name: demo-shell
script: if ([ "$TRAVIS_BRANCH" = "master" ]); then
(./scripts/start.sh -t -ss || exit 1;);
else
(./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;);
fi
- stage: Update children projects dependency #Update generator-ng2-alfresco-app
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n generator-ng2-alfresco-app
- stage: Update children projects dependency # Test Update alfresco-content-app
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-content-app
- stage: Update children projects dependency # Test Update adf-app-manager-ui
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n adf-app-manager-ui
- stage: Update children projects dependency # Test Update aalfresco-ng2-components
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-ng2-components
- stage: Update children projects dependency # Test Update alfresco-modeler-app
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-modeler-app
- stage: e2e Test # Test core
name: core
script:
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" ]];
then
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist --timeout 7000 || exit 1;);
fi
- stage: e2e Test # Test process-services
name: process-services
script:
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" ]];
then
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist --timeout 7000 || exit 1;);
fi
- stage: e2e Test # Test content-services
name: content-services
script:
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" ]];
then
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist --timeout 7000 || exit 1;);
fi
- stage: e2e Test # Test process-services-cloud
name: process-services-cloud
script:
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
then
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services-cloud --skip-lint --use-dist --timeout 7000 || exit 1;);
fi
- stage: e2e Test # Test insights
name: insights
script:
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
then
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist --timeout 7000 || exit 1;);
fi
- stage: Create Docker PR
script: (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
- stage: Deploy Docker PR
script: node --no-deprecation ./scripts/pr-deploy.js -n $TRAVIS_BUILD_NUMBER -u $RANCHER_TOKEN -p $RANCHER_SECRET -s $REPO_RANCHER --image "docker:$REPO_DOCKER/adf/demo-shell:$TRAVIS_BUILD_NUMBER" --env $ENVIRONMENT_NAME -r $ENVIRONMENT_URL || exit 1
# Send coverage data to codecov
after_success:
bash <(curl -s https://codecov.io/bash) -X gcov
cache:
directories:
- node_modules
- demo-shell/dist
- tmp