-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.travis.yml
299 lines (277 loc) · 12.8 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# paste config here
# Initial Travic-CI control file. 6.11.15 jhrg
# Added sonar scan 3.12.19 jhrg
dist: xenial
language: python
services:
- docker
branches:
only:
- master
notifications:
email:
addons:
apt:
packages:
- gnupg
- jq
env:
global:
# AWS_ACCESS_KEY_ID for the user 'travis-hyrax-docker'
- secure: "rcgtvltN9UEQHYmuTgkspQaveTjYLQW64u7w2NWYJL7QryqiuItxTtCAOCPael+DYWXloUOK++rfBwzsmJDnCrLGK9io3aBGZgdY5qmmYOgFJ35l3SM1APHXAjQyT6XHWotsIdHQd0FZYSlBrsIAM3qXnHPx1GLmSg6L6V6bQujkfIqq9WwR9cleinj50EQ6gHgJ2ObPjLxGALERhQiV5Ebe4jbaq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0cyKmkU90/42Hx5kmBJPcFAIIrxy46cF4iNyQ8cS5TAmY/vQ+ZcoiO5yCA6ACqKWqFH2i7qUZhVsBWI6VWgQTbuRKOJ4RdOv2QtHb3QGO+PdxxitpQvw2aYam4nI7WapqNk84hu+oXoavDSR0kN21vlpfvcyfIi9JuEGGmVb7irbCCVo27kLHrRrntByKJ7GpR5Wf9s8frWd53iri9k0DSwxvKGZBIaFPodnYsJKF1Ck16IrJrr6AgPZvTKN4vBesFiRvI6sIJrZL6gD62cW2s196zKaSzcT0DccUKCaG6/javNazMo+sk74tOgqaeX0r/whXv8Rc/oobdUFI0AkGGOTzp4+QHVKX1swPEVEjP00ewOyurQinG1yhkqOgQU7s6f5dXabepmnFtH5j5W8AjDL6kISk1w/UIfMwGkUDXyxSGZWLaLag2oDxb+0Xe4CC+9m6SxtnRSzUjXDzOL4QBB8ri0VBSMA2E="
- RELEASE_DATE=`date +%s`
- VERSION_FILE=snapshot.time
- LIBDAP_VERSION=$(grep "libdap4-" ${VERSION_FILE} | awk '{print $1;}' - | sed "s/libdap4-//g")
- BES_VERSION=$(grep "bes-" ${VERSION_FILE} | awk '{print $1;}' - | sed "s/bes-//g")
- HYRAX_VERSION=$(grep "hyrax-" ${VERSION_FILE} | awk '{print $1;}' - | sed "s/hyrax-//g")
- OLFS_VERSION=$(grep "olfs-" ${VERSION_FILE} | awk '{print $1;}' - | sed "s/olfs-//g")
- OLFS_DISTRO="olfs-${OLFS_VERSION}-webapp.tgz"
- OLFS_DISTRO_URL="s3://opendap.travis.build/${OLFS_DISTRO}"
- NGAP_DISTRO="ngap-${OLFS_VERSION}-webapp.tgz"
- NGAP_DISTRO_URL="s3://opendap.travis.build/${NGAP_DISTRO}"
- ROBOTS_DISTRO="robots-olfs-${OLFS_VERSION}-webapp.tgz"
- ROBOTS_DISTRO_URL="s3://opendap.travis.build/${ROBOTS_DISTRO}"
- LIBDAP_RH8_RPM="libdap-${LIBDAP_VERSION}.el8.x86_64.rpm"
- LIBDAP_RH8_RPM_URL="s3://opendap.travis.build/${LIBDAP_RH8_RPM}"
- BES_RH8_RPM="bes-${BES_VERSION}.static.el8.x86_64.rpm"
- BES_RH8_RPM_URL="s3://opendap.travis.build/${BES_RH8_RPM}"
- TOMCAT_MAJOR_VERSION=9
- S3_BUILD_BUCKET="opendap.travis.build"
- ADD_DEBUG_RPMS=""
before_install:
- pip3 install awscli
- if test "${TRAVIS_PULL_REQUEST}" = "false"; then export DEPLOY_ME="true"; else export DEPLOY_ME="false"; fi
install:
- echo "print env:"
- printenv
- echo $DOCKER_HUB_PSWD | docker login -u $DOCKER_HUB_UID --password-stdin
# - echo "Retrieving libdap C7 RPM ${LIBDAP_C7_RPM}"
# - aws --region=us-east-1 s3 cp ${LIBDAP_C7_RPM_URL} ./builds/${LIBDAP_C7_RPM}
# - echo "Retrieving BES C7 RPM ${BES_C7_RPM}"
# - aws --region=us-east-1 s3 cp ${BES_C7_RPM_URL} ./builds/${BES_C7_RPM}
- echo "Retrieving libdap RH8 RPM ${LIBDAP_RH8_RPM}"
- aws --region=us-east-1 s3 cp ${LIBDAP_RH8_RPM_URL} ./builds/${LIBDAP_RH8_RPM}
- echo "Retrieving BES RH8 RPM ${BES_RH8_RPM}"
- aws --region=us-east-1 s3 cp ${BES_RH8_RPM_URL} ./builds/${BES_RH8_RPM}
- echo "Retrieving OLFS Distribution file ${OLFS_DISTRO}"
- aws --region=us-east-1 s3 cp ${OLFS_DISTRO_URL} ./builds/${OLFS_DISTRO}
- echo "Retrieving ROBOTS Distribution file ${ROBOTS_DISTRO}"
- aws --region=us-east-1 s3 cp ${ROBOTS_DISTRO_URL} ./builds/${ROBOTS_DISTRO}
- echo "Retrieving NGAP Distribution file ${NGAP_DISTRO}"
- aws --region=us-east-1 s3 cp ${NGAP_DISTRO_URL} ./builds/${NGAP_DISTRO}
- ls -l ./builds
stages:
- name: OLFS
if: branch = master
- name: BUILD_AND_TEST
if: branch = master
- name: BUILD
if: branch = master
- name: TEST_DEPLOYED_IMAGE
if: branch = master
- name: disabled
if: branch = disabled
jobs:
include:
############################################################################
#
# RH8 Builds
#
- stage: BUILD_AND_TEST
name: "Build and Test opendap/hyrax:snapshot (RH8)"
script:
- cd builds
- export DOCKER_NAME="hyrax"
- source ./build-rh8
- export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot"
- export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${HYRAX_VERSION}"
- export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}")
- show_version
- get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}"
- s3_get_besd_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"el8"
"${LIBDAP_VERSION}"
"${BES_VERSION}" $ADD_DEBUG 2>&1
- s3_get_olfs_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"${OLFS_VERSION}" 2>&1
- docker build
--build-arg TOMCAT_VERSION
--build-arg RELEASE_DATE
--build-arg HYRAX_VERSION
--build-arg LIBDAP_VERSION
--build-arg BES_VERSION
--build-arg OLFS_VERSION
--tag "${SNAPSHOT_IMAGE_TAG}"
--tag "${BUILD_VERSION_TAG}"
"${DOCKER_NAME}"
- docker image ls -a
- cd ..
- echo "Running Test Script"
- ./regression_test_script -i ${SNAPSHOT_IMAGE_TAG}
- stage: BUILD
name: "Build the opendap/build_dmrpp:snapshot (RH8)"
script:
- cd builds
- export DOCKER_NAME="build_dmrpp"
- source ./build-rh8
- export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot"
- export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${BUILD_DMRPP_VERSION}"
- export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}")
- show_version
- get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}"
- s3_get_besd_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"el8"
"${LIBDAP_VERSION}"
"${BES_VERSION}" $ADD_DEBUG 2>&1
- s3_get_build_dmrpp_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"${BUILD_DMRPP_VERSION}" 2>&1
- build_dmrpp_service_docker "${DOCKER_NAME}" ROOT
- docker image ls -a
# - cd ..
# - echo "Running Test Script"
# - ./regression_test_script -i ${SNAPSHOT_IMAGE_TAG}
- stage: BUILD
name: "Build opendap/besd:snapshot (RH8)"
script:
- cd builds
- export DOCKER_NAME="besd"
- source ./build-rh8
- export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot"
- export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${BES_VERSION}"
- show_version
- s3_get_besd_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"el8"
"${LIBDAP_VERSION}"
"${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1
- docker build
--build-arg RELEASE_DATE
--build-arg HYRAX_VERSION
--build-arg LIBDAP_VERSION
--build-arg BES_VERSION
--tag "${SNAPSHOT_IMAGE_TAG}"
--tag "${BUILD_VERSION_TAG}"
"${DOCKER_NAME}"
- docker image ls -a
- stage: BUILD
name: "Build opendap/hyrax_ncwms:snapshot (RH8)"
script:
- cd builds
- export DOCKER_NAME="hyrax"
- source ./build-rh8
- export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}_ncwms:snapshot"
- export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}_ncwms:${HYRAX_VERSION}"
- export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}")
- show_version
- get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}"
- s3_get_besd_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"el8"
"${LIBDAP_VERSION}"
"${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1
- s3_get_olfs_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"${OLFS_VERSION}" 2>&1
- docker build
--build-arg TOMCAT_VERSION
--build-arg RELEASE_DATE
--build-arg HYRAX_VERSION
--build-arg LIBDAP_VERSION
--build-arg BES_VERSION
--build-arg OLFS_VERSION
--build-arg USE_NCWMS=true
--tag "${SNAPSHOT_IMAGE_TAG}"
--tag "${BUILD_VERSION_TAG}"
"${DOCKER_NAME}"
- docker image ls -a
- stage: BUILD
name: "Build opendap/hyrax:ngap-snapshot (RH8)"
script:
- cd builds
- export DOCKER_NAME="ngap"
- source ./build-rh8
- export SNAPSHOT_IMAGE_TAG="opendap/hyrax:${DOCKER_NAME}-snapshot"
- export BUILD_VERSION_TAG=opendap/hyrax:${DOCKER_NAME}-${HYRAX_VERSION}
- export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}")
- show_version
- get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}"
- s3_get_besd_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"el8"
"${LIBDAP_VERSION}"
"${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1
- get_ngap_olfs_distro
"${S3_BUILD_BUCKET}"
"${DOCKER_NAME}"
"${OLFS_VERSION}" 2>&1
- docker build
--build-arg TOMCAT_VERSION
--build-arg RELEASE_DATE
--build-arg HYRAX_VERSION
--build-arg LIBDAP_VERSION
--build-arg BES_VERSION
--build-arg OLFS_VERSION
--tag "${SNAPSHOT_IMAGE_TAG}"
--tag "${BUILD_VERSION_TAG}"
"${DOCKER_NAME}"
- docker image ls -a
- stage: BUILD
name: "Build opendap/olfs:snapshot"
script:
- cd builds
- export DOCKER_NAME="olfs"
- source ./build-rh8
- export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot"
- export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${OLFS_VERSION}"
- export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}")
- show_version
- get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}"
- s3_get_olfs_distro
"${S3_BUILD_BUCKET}"
"olfs"
"${OLFS_VERSION}" 2>&1
- docker build
--build-arg TOMCAT_VERSION
--build-arg RELEASE_DATE
--build-arg HYRAX_VERSION
--build-arg OLFS_VERSION
--tag "${SNAPSHOT_IMAGE_TAG}"
--tag "${BUILD_VERSION_TAG}" olfs
- docker image ls -a
- stage: TEST_DEPLOYED_IMAGE
name: "Test Deployed Image (RH8)"
script:
- export TEST_IMAGE=opendap/hyrax:${HYRAX_VERSION}
- echo "Running Hyrax Regression Test Script on ${TEST_IMAGE}"
- ./regression_test_script -i "${TEST_IMAGE}"
- export DEPLOY_ME="false"
before_deploy:
- export DOCKER_LOGIN=`aws ecr get-login --region us-east-1 | sed "s/-e none //g"`;
- $DOCKER_LOGIN;
- echo "DEPLOY_ME is ${DEPLOY_ME}"
deploy:
- provider: script
script: bash ${TRAVIS_BUILD_DIR}/deploy_to_docker_hub.sh
on:
branch: master
condition: ${DEPLOY_ME} = "true"