forked from Alfresco/alfresco-ng2-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
125 lines (118 loc) · 6.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
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'
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
jobs:
include:
- stage: Warm Up Cache
script: if ([ "$TRAVIS_BRANCH" = "master" ]); then
(./scripts/npm-build-all.sh || exit 1;);
else
(./scripts/npm-build-all.sh -vjsapi alpha -sb --skip-lint || exit 1;);
fi
- stage: Lint
script: (./scripts/lint.sh)
- stage: Unit test
env: STAGE=core
script: (./scripts/npm-build-all.sh -si -sb -t "core" --skip-lint || exit 1;);
- stage: Unit test
env: STAGE=extensions
script: (./scripts/npm-build-all.sh -si -sb -t "extensions" --skip-lint || exit 1;);
- stage: Unit test
env: STAGE=process-services
script: (./scripts/npm-build-all.sh -si -sb -t "process-services" --skip-lint|| exit 1;);
- stage: Unit test
env: STAGE=insights
script: (./scripts/npm-build-all.sh -si -sb -t "insights" --skip-lint || exit 1;);
- stage: Unit test
env: STAGE=content-services
script: (./scripts/npm-build-all.sh -si -sb -t "content-services" --skip-lint|| exit 1;);
- stage: Unit test
env: STAGE=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: Packaging test
script: (npm run build-lib || exit 1;) && node ./scripts/upload-build-lib-in-cs.js -u $E2E_USERNAME -p $E2E_PASSWORD --host $E2E_HOST -f $TRAVIS_BUILD_NUMBER
- 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: Create Shell dist
script: rm -rf ./node_modules/@alfresco; node ./scripts/download-build-lib-in-cs.js -u $E2E_USERNAME -p $E2E_PASSWORD --host $E2E_HOST -f $TRAVIS_BUILD_NUMBER || exit 1; npm run build:dist || exit 1; node ./scripts/upload-build-in-cs.js -u $E2E_USERNAME -p $E2E_PASSWORD --host $E2E_HOST -f $TRAVIS_BUILD_NUMBER || exit 1
- stage: e2e Test # Test core
env: STAGE=core
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --host $E2E_HOST --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy $E2E_HOST -u $E2E_USERNAME -p $E2E_PASSWORD -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist
- stage: e2e Test # Test process-services
env: STAGE=process-services
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --host $E2E_HOST --folder $TRAVIS_BUILD_NUMBER; ./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
- stage: e2e Test # Test content-services
env: STAGE=content-services
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --host $E2E_HOST --folder $TRAVIS_BUILD_NUMBER; ./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
- stage: e2e Test # Test insights
env: STAGE=insights
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --host $E2E_HOST --folder $TRAVIS_BUILD_NUMBER; ./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
- stage: Test Update version 2.0.0
if: branch = development
env: STAGE=test-BC
script: ./scripts/test-e2e-bc.sh -b $TRAVIS_BUILD_NUMBER
- stage: Test Update version 2.0.0
env: STAGE=test-export
script: npm run test-export
- stage: Create Docker PR
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --host $E2E_HOST --folder $TRAVIS_BUILD_NUMBER --base-href $TRAVIS_BUILD_NUMBER; -n $TRAVIS_BUILD_NUMBER && (./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 ./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
# jobs:
# include:
# - stage: Publish alpha to NPM
# before_install: skip
# install: skip
# script: skip
# deploy:
# provider: script
# script: (./scripts/update-version.sh -v $(./scripts/next_version.sh)-$(git rev-parse HEAD) -vj $(npm view alfresco-js-api@alpha version) -gnu) && (./scripts/npm-publish.sh -r $NPM_REGISTRY_ADDRESS -token $NPM_REGISTRY_TOKEN -t alpha --sleep 20 || exit 1;);
# on:
# branch: development
# skip_cleanup: true
# - stage: Publish beta to NPM
# before_install: skip
# install: skip
# script: skip
# deploy:
# provider: script
# script: (./scripts/update-version.sh -v $TRAVIS_TAG -gnu) && (./scripts/npm-publish.sh -r $NPM_REGISTRY_ADDRESS -token $NPM_REGISTRY_TOKEN -t beta --sleep 20 || exit 1;);
# on:
# tags: true
# skip_cleanup: true
# Send coverage data to codecov
after_success:
bash <(curl -s https://codecov.io/bash) -X gcov
cache:
directories:
- node_modules