-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path.travis.yml
More file actions
302 lines (277 loc) · 13.6 KB
/
.travis.yml
File metadata and controls
302 lines (277 loc) · 13.6 KB
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
300
301
302
#
# The bes build
#
# Initial Travis-CI control file. 6.5.15 jhrg
# Hacked quite a bit; added support for parallel autotest tests
# and removed unused parts. jhrg 8.23.17
#
# Now uses hyrax-dependencies and libdap binaries stored in an AWS S3 bucket
# that were built using other builds. jhrg 2.24.18
#
# Try using Ubuntu Focal
dist: focal # focal is the default, jammy and noble are supported now. jhrg 10/16/25
# Added vm size upgrade. This costs extra $s
vm:
size: 2x-large # Sync with the thread count in the sonar-*.properties files. jhrg 10/17/25
language: cpp
compiler: gcc
branches:
only:
- master
- main
- /^(.*-test-deploy)$/
# This cache is used to speed up sonar scan runs. See https://docs.travis-ci.com/user/caching.
# Each branch gets its own cache. The three different sonar scan runs each use their own cache
# directory set in the three sonar-bes-*.properties files. jhrg 1/13/22
cache:
directories:
- ./.cache/sonar/
addons:
sonarcloud:
organization: "opendap"
apt:
packages:
- uuid-dev
- libxml2-dev
- libcurl4-openssl-dev
- libcppunit-dev
- libicu-dev
- gcovr
- grep
- libfl-dev # needed for focal, but not xenial. jhrg 1/18/24
- openjdk-17-jdk-headless
git:
depth: 1
env:
global:
# NB: This value of $prefix must be shared between the hyrax-deps, libdap and bes builds.
- prefix=$HOME/install
- PATH=$prefix/bin:$prefix/deps/bin:$PATH
# Should the BES build with the NCML handler? This is here to round up build errors. Set this
# to the 'configure' script option (--disable-ncml) to disable it.
# jhrg 12/2/25
- CONFIGURE_OPTIONS=--disable-ncml
- TESTSUITEFLAGS=-j7
# Change this when libdap version numbers change
- LIBDAP_RPM_VERSION=3.21.1-0
# SONAR_LOGIN, made using "travis encrypt --org -r OPENDAP/bes SONAR_LOGIN=335df..."
- secure: "TmoFcgeIyAEjFyrlqB6rhdUhDqPJfxVZmT5fewgVHj0xm767VZ6DU21mM6ZHgNGyk99TzX0Gx/dwSqbsUj18hSSAvEa7fJQSKJ5IBJvTeMKhXn1DPPG9VpuZ4ti5afRDiNr6EJKbVxwBTkz+3798S8LajPuXGupYupir8IJQCt8="
# SONAR_MODULES_LOGIN, using "travis encrypt --org -r OPENDAP/bes SONAR_MODULES_LOGIN=42ba..."
- secure: "V3fMZgzMRRB0xFQMTvXf2fFPHIdwvg2y6bNFKqSGI5HP2sZEtc7XqSC4hjboR9RjnyZY/H1L/EuYQCS45gmJMsmtzo4g1Cn0oTfuPRJzDSi00jRlB1wUl5p1pU0Fdv2ffrGF4m6/SRfYFT0KkR/Tp8hdIoYx5/8R4MajysABMT4="
# SONAR_SUBMODULES_LOGIN, using "travis encrypt --org -r OPENDAP/bes SONAR_SUBMODULES_LOGIN=Q4aWrvS..."
- secure: "Q4aWrvSlKUY7413FNI6tHlWJdhVtjJxrtSBApJRe5fGTn/HEmod5n3O4o0elFhuYh0O57aYsYclD7t0lriKMPvPdY/s8CFAaIPSANhNRkD44MWYWCPyivl83BBUlhWgkqgWFcCEaTqCpF/8A0HlOF1TsE1KKyQSns7snqgWTfSA=" # AWS_ACCESS_KEY_ID
# AWS_ACCESS_KEY_ID
# user == travis-bes
- secure: "ZfL1IPX5zab1HWkJTlNPHroyUOp2lhAlcCH6UXDEL/yXpKoRCNkSo/CILM20DsjBckGys/7chom6uIoOilLu9Tp/6nPwkYlOe5DjgDt/qqKutclk9QBfrwU7WHRUOiEOESZl3Knd6B+GzuBZe8nrJzJhZWT54VFiOlEAGeIiFwo="
# AWS_SECRET_ACCESS_KEY
# user == travis-bes
- secure: "UpZB8cf3sOq11Yet8Cktnw4LiWZf24NJ0ugh8drVhShctLhZDiXKb/kMY3VA+pg7Q08ktmKsVYm1WM/+IpQJfOv/gYcGPwSlGuUUW87awtn7WdNPOZBIpG6dZ8dwcWh5XXKHVDyuRpxqc4vmjrIuB5ZUqdT5yVItnp3UhtJjaig="
# GIT_UID travis-ci-opendap
- secure: "eUL/RY4kJD9sb3q98Xbfbcdhs6eyFWkfWNb0tvRzksBi/+tYiuojsek0qoBFZnRnO0wwyDAaDrZgu2yoLQTBxGSTqCsYaoDiFtw2m8aW3r+FdjpfmyVR52U9vMoZtpiPGYYM9utlyQ6YRNhzq+XzDJ4juygoIlzbp7qXTALqIL8="
# GIT_PSWD for travis-ci-opendap
- secure: "dlULHE4qbXKEgqJZ0hiL7PcUqEcFaHzHE5GQbZ1v6wCyFujEvq34ayChOHuxZvrfNo64lCKjpHYs1Znq0m69dpkdSP3m0fv2rgLaqqTxD+ewgsYzmlKRA8jWuDx0WvV5IltS9KNdBj2Aj6wSsw5cqPkuRbYQlQCYj7GdqhAPlP8="
- CMAC_ID="${AWS_ACCESS_KEY_ID}"
- CMAC_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}"
- CMAC_URL="https://s3.amazonaws.com/cloudydap/"
- CMAC_REGION="us-east-1"
- CMAC_ON="yes"
before_install:
- gem install bundler
- pip install --user awscli
# fix for Java 17 install for Sonar from Travis CI support. jhrg 1/23/24
# see the apt-get package install above. jhrg 10/17/25
- export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
- export PATH="$JAVA_HOME/bin:$PATH"
# curl -s "https://get.sdkman.io" | bash
# source "$HOME/.sdkman/bin/sdkman-init.sh"
# sdk install java 17.0.2-open
# sdk use java 17.0.2-open
- java -version
# hyrax-dependencies-build.tar.gz includes/makes the build directory
install:
- aws s3 cp s3://opendap.travis.build/hyrax-dependencies-build.tgz $TRAVIS_BUILD_DIR
- tar -C $HOME -xzvf $TRAVIS_BUILD_DIR/hyrax-dependencies-build.tgz
- aws s3 cp s3://opendap.travis.build/libdap-build.tar.gz $TRAVIS_BUILD_DIR
- tar -C $HOME -xzvf $TRAVIS_BUILD_DIR/libdap-build.tar.gz
before_script:
- source travis/travis_bes_build_offset.sh
- export BES_BUILD_NUMBER=$(expr $TRAVIS_BUILD_NUMBER - $BES_TRAVIS_BUILD_OFFSET)
- echo "BES_BUILD_NUMBER is ${BES_BUILD_NUMBER} = ${TRAVIS_BUILD_NUMBER} - ${BES_TRAVIS_BUILD_OFFSET}"
- export LIBDAP_RPM_VERSION=$(grep "libdap4-" libdap4-snapshot | awk '{print $1;}' - | sed "s/libdap4-//g")
- echo "Travis default env:"
- printenv
# We have varied our approach to scanning over time. As of 7/23/21, we do not
# use Travis to run our sonarcloud scans. These are very time-consuming and
# can be done on the SonarScan.com website in a way that links those results
# to the GitHub PR page. That linkage provides the required behavior that a
# failed scan can block merging a PR onto the main branch.
#
# I have left the sonarscan stages in this file because we might decide they
# are needed after all, and it'll be a pain to redo them, even with the miracle
# of git. jhrg 7/23/21
#
# Update: it's back in. There may be a way to skip the scan for a DRAFT pull request,
# but I won't know until I hear back from Travis-CI support. jhrg 7/23/21
#
# Change: We filter branches (see line 25 above) so this script is only run for
# the master/main branch or for a *-test-deploy branch. So, the conditions for the
# stages can be simplified. jhrg 3/2/22
stages:
- name: build-and-test
- name: build-docker
- name: scan
if: branch = master
- name: hyrax-olfs-trigger
if: type != pull_request OR branch =~ ^(.*-test-deploy)$
# A way to skip a stage. jhrg 1/26/23
- name: never
if: branch = never
jobs:
include:
- stage: build-and-test
name: "check"
script:
- export BES_BUILD=main
# - export RUNTESTFLAGS="-v"
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- export LD_LIBRARY_PATH="/home/travis/install/deps/lib:$LD_LIBRARY_PATH"
- echo "LD_LIBRARY_PATH - $LD_LIBRARY_PATH" >&2
- make -j16 && make install && besctl start && make check -j16 && besctl stop
- stage: build-and-test
name: "distcheck"
script:
- export BES_BUILD=distcheck
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- make distcheck -j16 GZIP_ENV=--fast
- stage: build-and-test
name: "dist"
script:
- export BES_BUILD=srcdist
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --with-build=$BES_BUILD_NUMBER
- make dist -j7
# Make both a bes-<version>-<build num> and bes-snapshot tar.gz. This will simplify
# other operations that use the bes source code. Note that the VERSION file holds a
# string that is the version number that is set by the configure script and the build
# number passed into configure when it is run. jhrg 3/23/21
- SOURCE_VERSION=$(cat bes_VERSION)
- mv bes-*.tar.gz bes-$SOURCE_VERSION.tar.gz
- cp bes-$SOURCE_VERSION.tar.gz bes-snapshot.tar.gz
- stage: build-docker
name: "Build docker image bes_core:-el8"
script:
- set -e
- |
export BES_BUILD=docker-el8
echo "branch name ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
export DOCKER_NAME="bes_core"
export BUILDER_BASE_IMAGE="opendap/rocky8_hyrax_builder:latest"
export FINAL_BASE_IMAGE="rockylinux:8"
export DIST=el8
export OS=rocky8
export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot-${DIST}"
export BES_REPO_DIR=${TRAVIS_BUILD_DIR}
- ./travis/build-rhel-docker.sh
# Note: We need downstream access to the environment variable
# `BUILD_VERSION_TAG` that can only be determined AFTER the image
# is built:
- |
export BES_VERSION="$(docker run --rm ${SNAPSHOT_IMAGE_TAG} -c 'cat bes_VERSION')"
export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${BES_VERSION}-${DIST}"
echo "Tagging image with BES version: ${BUILD_VERSION_TAG}"
docker tag ${SNAPSHOT_IMAGE_TAG} ${BUILD_VERSION_TAG}
# Uncomment the following to push a test image for a non-test-deploy pull request
# - |
# export DEBUGGING_TAG="opendap/${DOCKER_NAME}:${BES_VERSION}-${DIST}-pull-request-test-image"
# docker tag ${SNAPSHOT_IMAGE_TAG} ${DEBUGGING_TAG}
# echo $DOCKER_HUB_PWSD | docker login -u $DOCKER_HUB_UID --password-stdin
# docker push ${DEBUGGING_TAG}
- stage: build-docker
name: "Build docker image bes_core:-el9"
script:
- set -e
- |
export BES_BUILD=docker-el9
echo "branch name ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
export DOCKER_NAME="bes_core"
export BUILDER_BASE_IMAGE="opendap/rocky9_hyrax_builder:latest"
export FINAL_BASE_IMAGE="rockylinux:9"
export DIST=el9
export OS=rocky9
export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot-${DIST}"
export BES_REPO_DIR=${TRAVIS_BUILD_DIR}
- ./travis/build-rhel-docker.sh
# Note: We need downstream access to the environment variable
# `BUILD_VERSION_TAG` that can only be determined AFTER the image
# is built:
- |
export BES_VERSION="$(docker run --rm ${SNAPSHOT_IMAGE_TAG} -c 'cat bes_VERSION')"
export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${BES_VERSION}-${DIST}"
echo "Tagging image with BES version: ${BUILD_VERSION_TAG}"
docker tag ${SNAPSHOT_IMAGE_TAG} ${BUILD_VERSION_TAG}
- stage: scan
name: "scan bes"
script:
- export BES_BUILD=sonar-bes-framework
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j16
- sonar-scanner -Dproject.settings=sonar-bes-framework.properties -Dsonar.login=$SONAR_LOGIN
- curl -s https://sonarcloud.io/api/project_badges/quality_gate?project=opendap-bes | grep "QUALITY GATE PASS"
- stage: scan
name: "scan bes-modules-1"
script:
- export BES_BUILD=sonar-bes-modules
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j16
- sonar-scanner -Dproject.settings=sonar-bes-modules-1.properties -Dsonar.login=$SONAR_MODULES_LOGIN
- curl -s https://sonarcloud.io/api/project_badges/quality_gate?project=opendap-bes-modules | grep "QUALITY GATE PASS"
- stage: scan
name: "scan bes-hdf-handlers"
script:
- export BES_BUILD=sonar-bes-hdf-handlers
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j16
- sonar-scanner -Dproject.settings=sonar-bes-hdf-handlers.properties -Dsonar.login=$SONAR_SUBMODULES_LOGIN
# We call the hdf4/5 handlers scan opendap-bes-submodules for historical reasons. jhrg 1/13/22
- curl -s https://sonarcloud.io/api/project_badges/quality_gate?project=opendap-bes-submodules | grep "QUALITY GATE PASS"
- stage: hyrax-olfs-trigger
name: "Hyrax OLFS Trigger"
script:
- export STAGE=hyrax-olfs
- echo $STAGE
- autoreconf --force --install --verbose
- ./configure $CONFIGURE_OPTIONS --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --with-build=$BES_BUILD_NUMBER
- ./travis/trigger-olfs-build.sh
after_script:
- ./travis/upload-test-results.sh
before_deploy:
- export DEPLOY="S3"
# Make sure that we have the target dir...
- mkdir -p $TRAVIS_BUILD_DIR/package;
# Source distribution prep (copies both the 'version' and 'snapshot')
- if test "$BES_BUILD" = "srcdist"; then cp bes-*.tar.gz $TRAVIS_BUILD_DIR/package; fi
# Check for the stuff...
- ls -l $TRAVIS_BUILD_DIR/package
# The deploy section copies the snapshot build product our S3 bucket and to www.opendap.org
deploy:
# Push build results to S3 bucket
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: opendap.travis.build
skip_cleanup: true
local_dir: $TRAVIS_BUILD_DIR/package
on:
all_branches: true
condition: $BES_BUILD =~ ^rocky8|rocky9|srcdist$
# Push docker images to Docker Hub
- provider: script
script: bash ${TRAVIS_BUILD_DIR}/travis/deploy-to-docker-hub.sh
on:
all_branches: true
condition: $BES_BUILD =~ ^docker