This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
194 lines (178 loc) · 5.94 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
os: linux
language: groovy
jdk: openjdk8
php: 5.6
env:
global:
- TERM=dumb
- PGCONFIG_PARAMS="PG_CONFIG=/usr/lib/postgresql/9.6/bin/pg_config"
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
addons:
postgresql: '9.6'
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches
- $HOME/.gradle/wrapper
- $HOME/.m2
- $HOME/pg
before_install:
- GRADLE_VERSION=5.0
- curl -f -L "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -o "gradle-${GRADLE_VERSION}-bin.zip"
- unzip "gradle-${GRADLE_VERSION}-bin.zip"
- GRADLE_HOME="$(pwd)/gradle-${GRADLE_VERSION}"
- GRADLE_SCRIPT="${GRADLE_HOME}/bin/gradle"
- $GRADLE_SCRIPT --version
- groovy --version
- sudo chmod a+rX $HOME
- sudo apt-get -qq update
- sudo apt-get install -y tk-dev html2text gnupg2
- gpg2 --version
- php --version
- PWD=`pwd`
- echo $PWD
install: true
jobs:
include:
- stage: test
name: transmart-core-api
env: DIR=transmart-core-api
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-core-db-tests
env: DIR=transmart-core-db-tests
before_script:
- pushd "$DIR"
- $GRADLE_SCRIPT assemble
- popd
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-rest-api
env: DIR=transmart-rest-api
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-core-db on PostgreSQL 9.6
env: DIR=transmart-core-db
install:
- pushd "$DIR"
- $GRADLE_SCRIPT :transmart-data:createVars :transmart-data:setupPostgresTest
- popd
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-core-db on PostgreSQL 11
env:
- DIR=transmart-core-db
- PGCONFIG_PARAMS="PG_CONFIG=/usr/lib/postgresql/11/bin/pg_config"
- PGVERSION=11
- PGPORT=5433
addons:
postgresql: "11"
install:
- sudo apt-get --yes remove postgresql-9.2
- sudo apt-get --yes install postgresql-server-dev-11 postgresql-11 postgresql-client-11
- sudo -u postgres psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;'
- pushd "$DIR"
- $GRADLE_SCRIPT :transmart-data:createVars :transmart-data:setupPostgresTest
- popd
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-schemas
env: DIR=transmart-schemas
before_script:
- pushd "$DIR"
- $GRADLE_SCRIPT assemble
- popd
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-api-server
env: DIR=transmart-api-server
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-copy on PostgreSQL 9.6
env: DIR=transmart-copy
install:
- pushd "$DIR"
- $GRADLE_SCRIPT :prepareTestDatabase
- popd
before_script:
- pushd "$DIR"
- $GRADLE_SCRIPT shadowJar
- popd
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: transmart-copy on PostgreSQL 11
env:
- DIR=transmart-copy
- PGPORT=5433
addons:
postgresql: "11"
install:
- sudo apt-get --yes remove postgresql-9.2
- sudo apt-get --yes install postgresql-11 postgresql-client-11
- pushd "$DIR"
- $GRADLE_SCRIPT :prepareTestDatabase
- popd
before_script:
- pushd "$DIR"
- $GRADLE_SCRIPT shadowJar
- popd
script:
- pushd "$DIR"
- $GRADLE_SCRIPT check
- popd
- name: Test publish task
script: $GRADLE_SCRIPT publishToMavenLocal
- stage: deploy
if: branch in (dev, master) and type != pull_request
name: Publish to Nexus and Docker Hub
script: skip
# For deployment to Nexus, configure the `NEXUS_USERNAME` and `NEXUS_PASSWORD` variables:
# - `travis env set NEXUS_USERNAME ...`
# - `travis env set NEXUS_PASSWORD ...`
deploy:
- provider: script
skip_cleanup: true
script: "cp .travis/settings.xml $HOME/.m2/settings.xml && $GRADLE_SCRIPT publish"
on:
all_branches: true
# For deployment to Docker Hub, configure the `DOCKER_USERNAME` and `DOCKER_PASSWORD` variables:
# - `travis env set DOCKER_USERNAME ...`
# - `travis env set DOCKER_PASSWORD ...` (create a new access token for this purpose)
# For the notification, configure `SLACK_WEBHOOK`
# - `travis env set SLACK_WEBHOOK "https://hooks.slack.com/services/..."`
after_deploy:
- export GRADLE_SCRIPT=$GRADLE_SCRIPT
- travis_retry ./.travis/docker_release.sh
- ./.travis/notify.sh
after_success:
- echo "Writing summary..."
- ([ -d "$DIR/build/reports/tests" ]) && html2text $DIR/build/reports/tests/index.html
after_failure:
- echo "Writing error logs..."
- for f in "$DIR"/hs_err_*.log; do echo "$f"; cat "$f"; done
- echo "Writing reports..."
- html2text "$DIR/build/reports/tests/index.html"
- for f in "$DIR"/build/reports/tests/classes/*.html; do echo "$f"; html2text "$f"; done
- ([ -d "$DIR/build/reports/tests/functionalTest" ]) && (html2text "$DIR/build/reports/tests/functionalTest/index.html")
- ([ -d "$DIR/build/reports/tests/functionalTest" ]) && (for f in "$DIR"/build/reports/tests/functionalTest/classes/*.html; do echo "$f"; html2text "$f"; done)
- ([ -d "$DIR/build/reports/tests/integrationTest" ]) && (html2text "$DIR/build/reports/tests/integrationTest/index.html")
- ([ -d "$DIR/build/reports/tests/integrationTest" ]) && (for f in "$DIR"/build/reports/tests/integrationTest/classes/*.html; do echo "$f"; html2text "$f"; done)