forked from OPENDAP/bes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
256 lines (225 loc) · 11.1 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
#
# The bes build
#
# Initial Travic-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: trusty
dist: xenial
language: cpp
compiler: gcc
branches:
only:
- master
- travis
addons:
sonarcloud: true
apt:
packages:
- uuid-dev
- libxml2-dev
- libcurl4-openssl-dev
- libcppunit-dev
- libicu-dev
- gcovr
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.20.7-1
# 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
# 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: "jdEmVdM35qoAmIXTqTCL11IbjEMh6I+jrov/nqQ4wdoJf79O7H7tuuDVkIJ+5RSIjUXsIYgfQAG8Cn+DIJRMnv7mj7TrWGS9LT22bBGErzCcCkrHGKMDH4okbd8cCNQcnb/9woYSYZ38U8QCBsYH1Ma2r4bFU4jAY2KiMOyaY6w="
# WOO_UID for travis
# - secure: "YKSsiV7fjngZ+Xha9oyHUT2Xirz8Iy7bghAzlGk2TyXZwWGbZyFDMeTfE0ZGaAEykhNF9fsqsD6XMzFlwBcYIB5ocP6LfnQ1qMualHVTVbVldo/T2e8uv/9jVIAnfwwT2IbgWpVUXZ1I24kIqHCxnZWYZpbfclSEDnQnkYG9tMg="
# travis encrypt --org -r OPENDAP/bes WOO_PSWD=... Use with sshpass -p $WOO_PSWD scp ...
# - secure: "Bw3Jad8QbpJl+o3BnfTlHddaTaerIG/sgnOJsMzVeSJQoMnh9tccTZ7QaNKo1Vs8riNzTHLMZkJja3UgXV9f90HU9xujZhEcnEdR/t1RRiLUsxHZtl20IcL6AQni+LCW0y/K5V0fCqx0cE90aGzBUeP1to/q7fkoRudxHqpXTtc="
- 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
# 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
before_script:
- autoreconf --force --install --verbose
# Build all the stages for 'master'. For a PR, run the 'build' and 'package' stages,
# but do not run the scan.
stages:
- name: build
if: branch = master
- name: scan
if: branch = master
- name: package
if: branch = master
jobs:
include:
- stage: scan
name: "scan bes"
script:
- export BES_BUILD=sonar-bes-framework
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j7
- make check -j7
- make coverage
- 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"
script:
- export BES_BUILD=sonar-bes-modules
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j7
- make check -j7
- make coverage
- sonar-scanner -Dproject.settings=sonar-bes-modules.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-submodules"
script:
- export BES_BUILD=sonar-bes-submodules
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j7
- make check -j7
- make coverage
- sonar-scanner -Dproject.settings=sonar-bes-submodules.properties -Dsonar.login=$SONAR_SUBMODULES_LOGIN
- curl -s https://sonarcloud.io/api/project_badges/quality_gate?project=opendap-bes-submodules | grep "QUALITY GATE PASS"
- stage: build
name: "check"
script:
- export BES_BUILD=main
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- make -j7 && make install && besctl start && make check -j7 && besctl stop
- stage: build
name: "distcheck"
script:
- export BES_BUILD=distcheck
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- make distcheck -j7
# NB: ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} supplies the name of the PR branch for a PR,
# or the name of the branch for a regular push. The reason for this is not that we want special
# packages for branches, but we want to be able to test builds without making pushes to master
# and that means having the build-rpm.sh use the spec files on a branch.
# Removed CentOS 6 build. jhrg 10/23/20
# - stage: package
# script:
# - export BES_BUILD=centos6
# - mkdir -p $prefix/rpmbuild
# - docker run --volume $prefix/rpmbuild:/root/rpmbuild --volume $TRAVIS_BUILD_DIR:/root/travis
# --env OS=centos6 --env DIST=el6 --env LIBDAP_RPM_VERSION=$LIBDAP_RPM_VERSION
# --env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
# opendap/centos6_hyrax_builder:1.3 /root/travis/build-rpm.sh ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- stage: package
name: "CentOS-7 RPMs"
script:
- export BES_BUILD=centos7
- mkdir -p $prefix/rpmbuild
- echo "branch name ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
- docker run --volume $prefix/rpmbuild:/root/rpmbuild --volume $TRAVIS_BUILD_DIR:/root/travis
--env OS=centos7 --env DIST=el7 --env LIBDAP_RPM_VERSION=$LIBDAP_RPM_VERSION
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
opendap/centos7_hyrax_builder:1.2 /root/travis/build-rpm.sh ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- stage: package
name: "dist"
script:
- export BES_BUILD=srcdist
- ./configure --disable-dependency-tracking --prefix=$prefix --with-dependencies=$prefix/deps --enable-developer
- make dist -j7
- cp bes-*.tar.gz bes-snapshot.tar.gz;
after_script:
- ./travis/upload-test-results.sh
before_deploy:
# Get creds for pushing snapshots to w.o.o.
# - if test "$BES_BUILD" = "srcdist" || test "$BES_BUILD" = "centos6" || test "$BES_BUILD" = "centos7" ;
# then
# openssl aes-256-cbc -K $encrypted_f3adba893add_key -iv $encrypted_f3adba893add_iv -in ./travis/woo_deploy_rsa_enc -out /tmp/woo_deploy_rsa -d;
# eval "$(ssh-agent -s)";
# chmod 600 /tmp/woo_deploy_rsa;
# ssh-add /tmp/woo_deploy_rsa;
# fi
- 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-6 distribution prep. Removed, jhrg 10/23/20
# - if test "$BES_BUILD" = "centos6"; then ./travis/rpm-to-package-dir.sh "el6"; fi
# CentOS-7 distribution prep
- if test "$BES_BUILD" = "centos7"; then ./travis/rpm-to-package-dir.sh "el7"; 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:
branch: master
condition: $BES_BUILD =~ ^deb|centos7|srcdist$
# Removed condition 'centos6|'. jhrg 10/23/20
# See https://opendap.atlassian.net/browse/HK-519
#
# Push CentOS-7 snapshot rpms to w.o.o
# - provider: script
# skip_cleanup: true
# env: DEPLOY="NOT_S3"
# script: sshpass -p $WOO_PSWD scp -v $TRAVIS_BUILD_DIR/package/*snapshot*el7* [email protected]:/httpdocs/webdav/pub/binary/hyrax-snapshot/centos-7.x
# on:
# branch: master
# condition: $BES_BUILD =~ ^centos7$
# # Push CentOS-6 snapshot rpms to w.o.o
# - provider: script
# skip_cleanup: true
# env: DEPLOY="NOT_S3"
# script: sshpass -p $WOO_PSWD scp -v $TRAVIS_BUILD_DIR/package/*snapshot*el6* [email protected]:/httpdocs/webdav/pub/binary/hyrax-snapshot/centos-6.x
# on:
# branch: master
# condition: $BES_BUILD =~ ^centos6$
# # Push source snapshot rpms to w.o.o
# - provider: script
# skip_cleanup: true
# env: DEPLOY="NOT_S3"
# script: sshpass -p $WOO_PSWD scp -v $TRAVIS_BUILD_DIR/package/*snapshot.tar.gz [email protected]:/httpdocs/webdav/pub/binary/hyrax-snapshot/src
# on:
# branch: master
# condition: $BES_BUILD =~ ^srcdist$
# The after_deploy section grabs the hyrax-docker project, sets the current snapshot time
# and pushes the result to GitHub. This push triggers TravisCI to build the Docker containers
# for all of the Hyrax snapshot products. jhrg 10/28/19
#
# CAVEAT: In after_deploy failures will not affect the build outcome, they will be ignored.
#
after_deploy:
- if test x"$BES_BUILD" = x"centos7" -a x"$DEPLOY" = x"S3"; then ./travis/trigger-olfs-build.sh; fi