-
Notifications
You must be signed in to change notification settings - Fork 45
/
.travis.yml
232 lines (232 loc) · 11.2 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
226
227
228
229
230
231
232
notifications:
email: false
git:
quiet: true
depth: false
jdk: openjdk11
node_js: lts/*
language: python
python: 3.8
os: linux
arch: amd64
addons:
apt:
packages:
- curl
- sudo
- lsof
- wget
- unzip
- httpie
- docker-ce
- libxml2-utils
- docker-compose
env:
global:
- TERM=dumb
- secure: Eh+HT5YScrFz1JoZLHtbxPqFT6E/7+qHFDoN2fqYXX2lpahCJmTX6dW/8lyk32sMUvTpljJPpKQb/Xavxk8lHE0tDcdr/1l5N4WHnZPGJqKLB36VQpuFkMwmsbQH7dfJskDpFjJZSKa0oXTa8AEU8U2nstdFdyKZt2wChWOMMNCmEiL7YVu0bqjn08Qlfkye3pg9q6tMRGMLIL3Y0pvqWrhb2zfbjojcq+pQLrZGmuh0XUqshPQqc9M959KDSq3aq1INjSFYI3siIHN8b/He1qBSECWURvsgA9uKBNo2LuvLfvzFzHmzpHBNRbRcjrCzF8gzxuVxkfxjW5zOtJbe/7KOxM5NHKtWfCeTunrzJoEl9v9h/AYRlS0UBBFyie3XWraxed9aFuT7QbR0mTmx7s33vNGRMkujG+nPhkPzuM0ABpU/t5quvvo9zMmnd1LOe3XV+kAo3HOqkAD/FC5JZI5aaMJXrSS+O9XzPXS+E2CjGPAgBY0VIX0LwVVc80t00xkppfINtj/0HYyKE3xXE6cnM34204u+9Mksxb/TZQY+GMpAOCIUn+RrO0vxM7hvv8anm59rMOAZ/FgvLs+i3d1CuJJDCn9fuFxa0Etnn/krusLdwzjvI+9AgMknVCo1mnxbNuIAo2BnkOdzz35PxX8iDxc7fThYt9u5mx8M79E=
- secure: D04FeSPymLevdF11Ej1dUAxxHV9rKHHj/0sld/KPNh/mr876dm1l9AMo6VcBC5Kr1a6AwDJiOG9d8XgUEFRNvhBb3nMjIJa/99psykPL1N4WWZojULkeUtfhbVC+4d5qoLjNM2svT8IFJ9hO1kfgBGKk1Cd5KA+PtjceEIAJ29gaBvnbYo3MspXZsd3RA87kgY/poxQX2j7JeyKqQQKTLN8FTLqu7vgmdZWRYrUrSXiZvoJc9yJ+7PW6u4N4nVlReYb6+GGOM6BAtyB0dDxxG50sL8VcrYnzRlWyEXMaqNlqu2FBI+sBEuzkVkGulZMIsHDfKQhMPH/g2bN79FiPJVEiS7aOBiSMjS2f7vAq9JS3xOnNmMPjHOkAfzpktXbYHydeQIW6vcUue58qUkaj+zn7kyocg83hDlR/j3ATfXJvOGF4vqhkRwPtz7WeZ+Lra7nMrlhaLkFpALco7+ZOB9BwDa3lV1oic6Xv4pRNHgdIx+KcBOI6n4BND22ckzwa0p2+kfDHakIyojX2nNiWg7jzl1oDokI/3nnx/L2piUjKHspjvq7wiJjZefbYRgfLqML+TJ/osZ4P4rin8RLb6my/J3ApMlDH9PyiLNkafnhYKGsTP43XCYMBwVGxv++f/+6JeXsS35Hs4YXbCc1ANt7sTck6FzKgrELgTTOViGk=
service: docker
install: true
before_install:
- |
if [ ! -f ${HOME}/.local/daggerok/bash-functions/master/main.bash ] ; then
mkdir -p ${HOME}/.local/daggerok/bash-functions/master ;
curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash > ${HOME}/.local/daggerok/bash-functions/master/main.bash ;
fi
source ${HOME}/.local/daggerok/bash-functions/master/main.bash ;
- stop_any 80 8001 8002 8080 5432
#
- export DISPLAY=:99.0
before_script:
- export PATH=/tmp:$PATH
- export APP_UPLOAD_PATH="/tmp/file-storage"
- mkdir -p ${APP_UPLOAD_PATH}
jobs:
include:
# - stage: test
# jdk: openjdk8
# name: disabled
# script:
# # install as linux service: travis is not supports spring-boot installations, so we will be using docker instead
# - ./gradlew clean assemble postgresUp >/dev/null
# - cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
# - mv -f ./modules/apps/file-items-service/build/libs/*.jar /tmp/file-items-service.jar
# - echo 'JAVA_OPTS="-Dspring.profiles.active=h2-db"' > /tmp/file-items-service.conf
# - sudo ln -s /tmp/file-items-service.jar /etc/init.d/file-items-service
# - ls -lah /etc/init.d/ /tmp/ | grep file
# - sudo service file-items-service start
# - sudo tail -f /var/log/file-items-service.log &
# - wait_for 8001
# - sleep 3s
# - mv -f ./modules/apps/file-server/build/libs/*.jar /tmp/file-server.jar
# - echo 'JAVA_OPTS="-Dspring.profiles.active=h2-db"' > /tmp/file-server.conf
# - sudo ln -s /tmp/file-server.jar /etc/init.d/file-server
# - ls -lah /etc/init.d/ /tmp/ | grep file
# - sudo service file-server start
# - sudo tail -f /var/log/file-server.log &
# - wait_for 8002
# - sleep 3s
# - http --auth user:password :8001/actuator/health
# - http --auth user:password :8002/actuator/health
# - http --auth user:password -f post :8002/upload filename="$(date)-README.md" [email protected]
# - http --auth user:password :8002/api/v1/files
# - http --auth user:password :8002/
# - sudo service file-server stop
# - sudo service file-items-service stop
# - ./gradlew postgresDown >/dev/null
# - unset SPRING_PROFILES_ACTIVE
# - stop_any 80 8002 8001 8080 5432
- stage: test
jdk: openjdk11
name: docker tests
script:
- ./gradlew assemble
- ./gradlew allUp
- http -a user:password :80
- ./gradlew allDown
- stage: test
jdk: openjdk11
name: Postgres (openjdk11)
script:
- ./gradlew clean assemble
- ./gradlew clean assemble postgresUp
- bash ./modules/apps/file-items-service/build/libs/*.jar --spring.profiles.active=db-pg &
- wait_for 8001
- cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
- bash ./modules/apps/file-server/build/libs/*.jar &
- wait_for 8002
- http --auth user:password :8001/actuator/health
- http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" [email protected]
- http --auth user:password :8002/api/v1/files
- http --auth user:password :8002/
- stop_any 80 8002 8001 8080 5432
- ./gradlew postgresDown
- stage: test
jdk: openjdk8
name: Postgres (openjdk8)
script:
- ./gradlew clean assemble
- ./gradlew clean assemble postgresUp
- bash ./modules/apps/file-items-service/build/libs/*.jar --spring.profiles.active=db-pg &
- wait_for 8001
- cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
- bash ./modules/apps/file-server/build/libs/*.jar &
- wait_for 8002
- http --auth user:password :8001/actuator/health
- http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" [email protected]
- http --auth user:password :8002/api/v1/files
- http --auth user:password :8002/
- stop_any 80 8002 8001 8080 5432
- ./gradlew postgresDown
- stage: test
jdk: openjdk11
name: H2 (openjdk11)
script:
- ./gradlew clean assemble
- bash ./modules/apps/file-items-service/build/libs/*jar &
- wait_for 8001
- cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
- bash ./modules/apps/file-server/build/libs/*jar --app.upload.path=${APP_UPLOAD_PATH} &
- wait_for 8002
- http --auth user:password :8001/actuator/health
- http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" [email protected]
- http --auth user:password :8002/api/v1/files
- http --auth user:password :8002/
- stop_any 80 8002 8001 8080 5432
- stage: test
jdk: openjdk8
name: H2 (openjdk8)
script:
- ./gradlew clean assemble
- bash ./modules/apps/file-items-service/build/libs/*jar &
- wait_for 8001
- cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
- bash ./modules/apps/file-server/build/libs/*jar --app.upload.path=${APP_UPLOAD_PATH} &
- wait_for 8002
- http --auth user:password :8001/actuator/health
- http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" [email protected]
- http --auth user:password :8002/api/v1/files
- http --auth user:password :8002/
- stop_any 80 8002 8001 8080 5432
- stage: deploy
jdk: openjdk11
name: GitHub release and GitHub pages deployment (openjdk11)
script: skip
if: branch = "master" AND type NOT IN (pull_request)
before_deploy:
- set -e
- if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ ".$TRAVIS_BRANCH" != ".master" ] ; then exit 0 ; fi
- env
# publish tag release
- mkdir -p ~/.m2
- |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd\">
<servers>
<server>
<id>github</id>
<username>daggerok</username>
<password>${GITHUB_PASSWORD}</password>
</server>
</servers>
</settings>
" > ${HOME}/.m2/settings.xml
- ./mvnw
# test published release by using scripts/application.bash
- bash ./scripts/application.bash start build
- bash ./scripts/application.bash stop build
- bash ./scripts/application.bash start build
- http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-README.md" [email protected]
- http --auth user:password :8001/api/v1/file-items
- http --auth user:password :8002/api/v1/files
- yes | bash ./scripts/application.bash clean build
# test published release by using scripts/application-h2.bash
- bash ./scripts/application-h2.bash start build
- bash ./scripts/application-h2.bash stop build
- bash ./scripts/application-h2.bash start build
- http --auth user:password :8001/actuator/health
- http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" [email protected]
- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" [email protected]
- http --auth user:password :8002/api/v1/files
- http --auth user:password :8002/
- yes | bash ./scripts/application-h2.bash clean build
#
- ./gradlew dependencyUpdates -Drevision=release --parallel
- ./mvnw versions:display-property-updates
- ./mvnw versions:display-dependency-updates
- ./mvnw versions:display-plugin-updates
# documentation
- ./mvnw -Pdocs
- mkdir -p target/generated-docs
- cp -Rf target/generated-docs/index.html target/generated-docs/404.html
deploy: &pages
provider: pages
skip-cleanup: true
keep-history: true
target_branch: gh-pages
github-token: "$GITHUB_TOKEN"
local-dir: target/generated-docs
on:
branch: master
condition: "$TRAVIS_PULL_REQUEST = false"
before_cache:
- find ~/.gradle -name "fileHashes.bin" -print0 | xargs -0 rm -rfv '{}'
- for item in $(find ~/.gradle -name "*.lock") ; do rm -rfv $item ; done
cache:
pip: true
packages: true
directories:
- ~/.m2
- ~/.gradle
- ~/.docker
- ~/.local/daggerok