forked from rundeck/rundeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
226 lines (199 loc) · 8.96 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
language: java
env: MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=192m" GRADLE_OPTS="-Xmx1024m -XX:MaxPermSize=192m"
TERM="dumb"
NODE_OPTIONS="--max-old-space-size=2048"
jdk:
- openjdk8
sudo: required
services:
- docker
stages:
- name: build
if: fork = false
- name: test
# Run tests on non-forked PR and main builds
if: fork = false AND (branch = main OR branch =~ ^release OR branch =~ ^maint-3 OR tag IS present)
- name: snapshot release
if: fork = false AND type = push AND (branch = main OR branch =~ ^maint-3 OR env(RUNDECK_RELEASE) IS present) AND tag IS blank
- name: tag release
if: fork = false AND type = push AND tag =~ ^v
- name: fork
if: fork = true
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y jq xmlstarlet
- sudo chsh --shell $(which bash)
- pip install awscli --upgrade --user
install: true
before_script:
- source scripts/travis-helpers.sh
- export -f travis_nanoseconds
- export -f travis_fold
- export -f travis_time_start
- export -f travis_time_finish
jobs:
include:
# Stage: build
- stage: build
script:
# Build artifacts: jars, wars, and docker images
- script_block 'build' 'bash scripts/travis-build.sh build'
- script_block 'build.docker.rdtest' build_rdtest
# Copy artifacts and upload to s3
- mkdir -p artifacts/packaging
- mkdir -p artifacts/rundeckapp/build
# Publish official docker snapshot
- script_block 'docker.official' 'bash scripts/travis-build.sh buildDocker'
# Sync artifacts and trigger downstream snapshot builds if appropriate
- script_block 'sync-artifacts' 'copy_artifacts && sync_to_s3'
- script_block 'trigger.downstream' trigger_downstream_snapshots
# Trigger rundeck/testdeck build
- script_block 'travis-trigger.testdeck' 'trigger_travis_build "${TRAVIS_OSS_TOKEN}" org rundeck testdeck ${RUNDECK_BRANCH} || true'
# Stage: test
- stage: test
env: JOB='Test Grails'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'grails-test' './gradlew -g gradle-cache --build-cache check'
- env: JOB='Docker API tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'api-test' 'DOCKER_COMPOSE_SPEC=docker-compose-api-mysql.yaml bash test/run-docker-api-tests.sh'
- env: JOB='Docker Tomcat 8 API tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'api-test' 'bash test/run-docker-tomcat-tests.sh'
- env: JOB='Docker Tomcat 9 API tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'api-test' 'bash test/run-docker-tomcat-tests.sh 9'
# - stage: test
# env: JOB='Test deb install'
# script:
# - script_block 'sync-artifacts' fetch_common_artifacts
# - script_block 'deb-test' 'bash test/test-docker-install-deb.sh'
# - env: JOB='Test rpm install'
# script:
# - script_block 'sync-artifacts' fetch_common_artifacts
# - script_block 'rpm-test' 'bash test/test-docker-install-rpm.sh'
- env: JOB='Docker tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'docker-test' 'bash test/run-docker-tests.sh'
- env: JOB='Docker SSL tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'docker-ssl-test' 'bash test/run-docker-ssl-tests.sh'
- env: JOB='Docker Ansible tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'docker-ansible-test' 'bash test/run-docker-ansible-tests.sh'
- env: JOB='Docker LDAP tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'docker-ldap-test' 'bash test/run-docker-ldap-tests.sh'
- env: JOB='Docker LDAP Bind tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'docker-ldap-bind-test' 'DOCKER_COMPOSE_SPEC=docker-compose-ldap-binding-test.yaml bash test/run-docker-ldap-tests.sh'
- env: JOB='Docker PAM tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'docker.pull' pull_rdtest
- script_block 'docker-pam-test' 'bash test/run-docker-pam-tests.sh'
- env: JOB='Docker Selenium tests'
script:
- script_block 'docker.pull' pull_rundeck
- script_block 'selenium' 'bash test/ci-test-docker-selenium.sh'
# # Stage: snapshot release publishes snapshot artifacts to external repositories
- stage: snapshot release
script:
# Sync artifacts under commit so we can use them for tag releases
- script_block 'sync.artifacts' fetch_common_artifacts
- script_block 'sync.ci-resources' fetch_common_resources
- script_block 'sync.commit' sync_commit_to_s3
- export VCS_URL=https://github.com/rundeck/rundeck.git
# Delete existing packages
# - script_block 'delete.deb' 'bash scripts/delete-bintray-package.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck dev-deb rundeck'
# - script_block 'delete.rpm-rundeck' 'bash scripts/delete-bintray-package.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck dev-rpm rundeck'
- script_block 'delete.mavan-rpm-config' 'bash scripts/delete-bintray-package.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck dev-rpm rundeck-config'
# Deploy new snapshot packages
# - script_block 'publish.deb' 'bash scripts/deploy-deb-snapshots.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck dev-deb'
# - script_block 'publish.rpm' 'bash scripts/deploy-rpm-snapshots.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck dev-rpm'
- script_block 'publish.maven' 'bash scripts/deploy-maven-snapshots.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck dev-maven "${RUNDECK_BUILD_NUMBER}"'
# Seal artifacts
- script_block 'seal-artifacts' seal_artifacts
# Upload to sonatype
- script_block 'oss.publish' './gradlew uploadExisting -PsonatypeUsername="${SONATYPE_USERNAME}" -PsonatypePassword="${SONATYPE_PASSWORD}" --info'
# Stage: tag release publishes artifacts to the appropriate external repsositories
- stage: tag release
env: JOB='Publish Maven'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'sync.ci-resources' fetch_common_resources
- export VCS_URL=https://github.com/rundeck/rundeck.git
# Deploy new snapshot packages
# - bash scripts/deploy-deb-snapshots.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck "${BINTRAY_DEB_REPO}"
# - bash scripts/deploy-rpm-snapshots.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck "${BINTRAY_RPM_REPO}"
# - bash scripts/deploy-maven-snapshots.sh "${BINTRAY_USER}" "${BINTRAY_API_KEY}" rundeck "${BINTRAY_MAVEN_REPO}" "${RUNDECK_BUILD_NUMBER}"
# Upload to sonatype
- script_block 'publish.maven' 'DRY_RUN=false bash scripts/travis-build.sh publish'
# Trigger downstream release builds(packaging-core)
- script_block 'trigger.downstream' trigger_downstream_releases
- env: JOB='Publish Docker'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'sync.ci-resources' fetch_common_resources
- script_block 'publish.docker' 'DRY_RUN=false bash scripts/travis-build.sh publish_docker'
# Stage: fork consolidates all tests into one job.
# Forks do not have access to encrypted envars so we can't pass artifacts between jobs/stages.
- stage: fork
script:
- script_block 'build' 'bash scripts/travis-build.sh buildFork'
# - script_block 'deb-test' 'bash test/test-docker-install-deb.sh'
# - script_block 'rpm-test' 'bash test/test-docker-install-rpm.sh'
- script_block 'api-test' 'DOCKER_COMPOSE_SPEC=docker-compose-api-mysql.yaml bash test/run-docker-api-tests.sh'
- script_block 'docker-test' 'bash test/run-docker-tests.sh'
- script_block 'docker-ssl-test' 'bash test/run-docker-ssl-tests.sh'
- script_block 'docker-ansible-test' 'bash test/run-docker-ansible-tests.sh'
- script_block 'docker-ldap-test' 'bash test/run-docker-ldap-tests.sh'
- script_block 'docker-ldap-bind-test' 'DOCKER_COMPOSE_SPEC=docker-compose-ldap-binding-test.yaml bash test/run-docker-ldap-tests.sh'
addons:
hostname: rdbuild
chrome: stable
apt:
packages:
- groovy
- rpm
- make
- zip
- unzip
- fakeroot
branches:
only:
- main
- release-2.11
- prerelease-2.12.0
- /^v.*/
- /^feature\/.*/
- /^issue\/.*/
- /^release\/.*/
- /^maint-.*/
notifications:
irc:
- irc.freenode.org#rundeck
slack:
secure: n02+acmU1U7J+k6cQuB+nMMcZl8aRpCYgieOPHEjRM+eY1gg2MOsD1DePWu+02GiLb53HKGQETEbAhkEv7NpxAyL5kudmM6lRJTIYu/xsBMUXnRVvwbUmJq08m2mSXZJ88Hejx2m5U4uVBKBdPaC9pzgYxx9+bttPtcsLBW99Qw=