-
Notifications
You must be signed in to change notification settings - Fork 25
/
.travis.yml
104 lines (98 loc) · 3.56 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
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
- directories:
- node_modules
- frontend/node_modules
- build/npm
- $HOME/.npm
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- npm
language: groovy
jdk:
- openjdk8
services:
- docker
# Don't email me the results of the test runs.
notifications:
email:
on_success: never
on_failure: always
# Install ChromeDriver and Chrome (latest)
install:
- sudo apt-get install -y dpkg
- wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P ~/
- sudo dpkg -i ~/google-chrome*.deb
- rm ~/google-chrome*.deb
- curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE | xargs -I % wget -N https://chromedriver.storage.googleapis.com/%/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
jobs:
include:
- stage: Tests
name: "unitTests"
script:
- ./gradlew -x jasmineRun -x angularTests test
- name: "integrationTests"
script:
- ./gradlew integrationTest --tests "de.iteratec.osm.**" --stacktrace
- name: "gebTests"
script:
- whereis google-chrome-stable
- google-chrome-stable --version
- whereis chromedriver
- chromedriver --version
- ./gradlew integrationTest --tests "geb.**.*" --stacktrace
- name: "jasmineTests"
script:
- ./gradlew jasmineRun
- name: "angularTests"
script:
- ./gradlew angularTests
- stage: Build and Push Docker Image for Develop
if: branch = develop
script: skip # You do not want to run the tests again
deploy:
skip_cleanup: true
provider: script
script:
groovy scripts/ci/building/set_new_versionnumber_travis_dev &&
./gradlew assemble &&
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin &&
docker build -t iteratec/openspeedmonitor:develop . &&
docker push iteratec/openspeedmonitor:develop &&
curl --user $BAMBOO_TU_USERNAME:$BAMBOO_TU_PASSWORD -X POST -d "$STAGE_NAME&ExecuteAllStages" $BAMBOO_BUILD_ADDRESS &&
git stash -u # in order to prevent double checking of cached resources
on:
branch: develop
- stage: Build and Push Docker Image for Release
if: branch = release
script: skip
deploy:
provider: script
script:
./gradlew assemble &&
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin &&
docker build -t iteratec/openspeedmonitor . &&
groovy scripts/ci/building/set_new_versionnumber &&
bash scripts/ci/building/push_and_tag_dockerimage_travis.sh &&
curl --user $BAMBOO_TU_USERNAME:$BAMBOO_TU_PASSWORD -X POST -d "$STAGE_NAME&ExecuteAllStages" $BAMBOO_RELEASE_BUILD_ADDRESS &&
git stash -u;
on:
branch: release
after_deploy: # set deployment key
- >-
openssl aes-256-cbc
-K $encrypted_0e6b9eee7eaa_key
-iv $encrypted_0e6b9eee7eaa_iv
-in scripts/ci/github_deploy_key.enc
-out github_deploy_key -d
- chmod 600 github_deploy_key
- eval $(ssh-agent -s)
- ssh-add github_deploy_key
- test $TRAVIS_BRANCH = "release" && bash scripts/ci/building/merge_release_into_dev_and_master.sh;