-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
274 lines (249 loc) · 12.4 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
#
# 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
# virt: lxd # use an lxd container
# arch: amd64 # optional, this is default, routes to a full VM
# os: linux # optional, this is default
dist: focal # or bionic | xenial | trusty | precise | focal with xenial as default
# Added vm size upgrade. This costs extra $s
vm:
size: x-large
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: true
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
git:
depth: false
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
- TESTSUITEFLAGS=-j7
# Change this when libdap version numbers change
- LIBDAP_RPM_VERSION=3.21.0-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="
# DOCKER_HUB_UID for travis
# - secure: "b0/W8+DA35StZB5BKRDn0yLxGE6n/Hc4vXRUBX2bylsSyw1IVplrl4PgKbafE0CT5PfFssOUH1cMlYcSOXgV3EWOeNWquIhwq1cASUJClTf55Y4kr1XPr6bNtdbPJ7UAKw1EG2TyZx0vy7A6TrKwgb9Al24ABm0ev4aFWUk+Sks="
# DOCKER_HUB_PSWD for travis
# - secure: "Z+M0JHT3szHclksjh8ettN9OoDjX0+lgOaORnSH8H/xvaQp1YCYzmEajnknGGCop6arM+PaiArZEZl7e8X1kBqReitSISLCwbS6XU/juRi1OBqfkk1YzSOgU03jLXe3MG2CmfQRLdExjdHCsphHEXthU2Z0tY++Tq31IfFPy1JQ="
- 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_BUCKET="cloudydap"
before_install:
- pip install --user awscli
# fix for Java 17 install for Sonar from Travis CI support. jhrg 1/23/24
- 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.tar.gz $TRAVIS_BUILD_DIR
- tar -C $HOME -xzvf $TRAVIS_BUILD_DIR/hyrax-dependencies-build.tar.gz
- 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
# - echo $DOCKER_HUB_PSWD | docker login -u $DOCKER_HUB_UID --password-stdin
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 branch or for a *-test-deploy branch. So, the conditionals for the
# stages can be simplified. jhrg 3/2/22
stages:
- name: build-and-package
- 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: off
if: branch = off
jobs:
include:
- stage: build-and-package
name: "check"
script:
- export BES_BUILD=main
# - export RUNTESTFLAGS="-v"
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- make -j16 && make install && besctl start && make check -j16 && besctl stop
- stage: build-and-package
name: "distcheck"
script:
- export BES_BUILD=distcheck
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- make distcheck -j16 GZIP_ENV=--fast
- stage: build-and-package
name: "Enterprise Linux 8 RPMs (via Rocky8)"
script:
- export BES_BUILD=centos-stream8
- mkdir -p $prefix/rpmbuild
- echo "branch name ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
- docker run --env prefix=/root/install --volume $prefix/rpmbuild:/root/rpmbuild
--volume $TRAVIS_BUILD_DIR:/root/travis
--env OS=centos-stream8
--env DIST=el8
--env LIBDAP_RPM_VERSION=$LIBDAP_RPM_VERSION
--env BES_BUILD_NUMBER=$BES_BUILD_NUMBER
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
--env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
opendap/rocky8_hyrax_builder:latest /root/travis/travis/build-rpm.sh
- stage: build-and-package
name: "dist"
script:
- export BES_BUILD=srcdist
- autoreconf --force --install --verbose
- ./configure --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: scan
name: "scan bes"
script:
- export BES_BUILD=sonar-bes-framework
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j16
# only compute coverage for merges to master; PRs and branch builds often are
# done over an over with little change.
# - |
# if test "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false"; then
# make check -j16
# make coverage
# fi
- 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 --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j16
#- |
# if test "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false"; then
# # Removed ++ 2>&1 | grep -e "Making check in" -e "FAILED" ++ from the following. jhrg 4/20/23
# make check -j16
# make coverage
# fi
- 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 --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j16
# - |
# if test "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false"; then
# make check -j16
# make coverage
# fi
- 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 --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
# CentOS-Stream8 distribution prep
- if test "$BES_BUILD" = "centos-stream8"; then ./travis/rpm-to-package-dir.sh "el8"; 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 all build results to our 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 =~ ^centos-stream8|srcdist$