forked from OPENDAP/libdap4
/
.travis.yml
172 lines (152 loc) · 6.68 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
#
# The libdap build
#
# Initial Travis-CI control file. 6.5.15 jhrg
# Updated many times... finally using docker (containers). 7.14.15 jhrg
#
# Modified to push the result of a successful build up to an AWS S3
# bucket. jhrg 2.24.18
virt: lxd # use an lxd container
arch: amd64 # optional, this is default, routes to a full VM
os: linux # optional, this is default
dist: xenial # or bionic | xenial | trusty | precise with xenial as default
language: cpp
compiler: gcc # Could add clang
branches:
only:
- master
- travis
addons:
sonarcloud: true
apt:
packages:
- libxml2-dev
- uuid-dev
- libcurl4-openssl-dev
- libcppunit-dev
- gcovr
- build-essential
- lintian
- fakeroot
env:
global:
# NB: This value of $prefix must be shared between the hyrax-deps, libdap and bes builds.
- prefix=$HOME/install
- PATH=$prefix/bin:$PATH
- TESTSUITEFLAGS=-j7
# COVERITY_SCAN_TOKEN, created via the "travis encrypt" command using the project repo's public key
- secure: "OYEzGP6BuDHctPj90EP0y0wjfSyaJs6tN89niLhq82jJfJVGvU2UmXGWACNFakM7xpobVfdwCIYomxgIz43CpNKt4TbuGW8PVIz2EI9Ir/Ne4A3W8pVHBkP8YvzRkiu0pWNeShcsJ4ZmzWEGy9YlPF36/HWai3ZCMEtJsTY8cCo="
# SONAR_LOGIN, created using travis encrypt --org -r OPENDAP/libdap4 SONAR_LOGIN=<sonar login key>
- secure: "LTrO/VZTxJ+Qo1FO106zCPILBMb09zezLeGcixd4BcXDICiVtVAtgw7LzCkBWn5Vxvhzd+Hs+uDHfqT8cKI8lewjJd79uHQ1I2CSqZdBs6ERQzndKpoRNm+t63qWQc7A+wDyj2m4odtO9zrhxDR3Poo38G7UtJmQLFrBf5QmLAw="
# AWS_ACCESS_KEY_ID for the user 'travis-libdap'
- secure: "uWXN90b3+L74+TZzGonRmhxfOVyi4/MJ8jlGDTdKRepUpvVLM3D8jwj/A4fOaudrAGg64DSJUUnHp8FmzMPO2hz2kcgDwFJ+VkGdBgxPU81srIN3NOur6EcwQ0rjYEsL6AkOe3lAiQixrhg2aOWRFBtv6fOSApbSh0WqUlNfR/g="
# AWS_SECRET_ACCESS_KEY
- secure: "M46pBw0ILYUg+BG9XE5exCmITD/gCAmAkYYu0UsnuQQUsSdJmHNiQ9e7/K6uodlk0doSlyekI0dQj5e+dzCgZSLoKckEwwufslM8C+0Q4ZWCwiyi8sBTOLpcgqfhtyu6gYrRiG3bHGyfDO0LHlpw34UKhtpP9z8YvN8r2isqRX0="
before_install:
- pip install --user awscli
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
before_script:
- autoreconf --force --install --verbose
stages:
- name: build
if: branch = master
- name: scan
if: branch = master
- name: package
if: branch = master
- name: travis
if: branch = travis
jobs:
include:
- stage: travis
script:
- mkdir -p $TRAVIS_BUILD_DIR/package
- cp README.md $TRAVIS_BUILD_DIR/package/README.libdap4
- export LIBDAP_BUILD=travis
- stage: build
script:
- export LIBDAP_BUILD=main
- ./configure --disable-dependency-tracking --prefix=$prefix
- make -j7 && make check -j7 && make install
- stage: build
script:
- export LIBDAP_BUILD=asan
- ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer --enable-asan
- make -j7 && make check -j7
- stage: build
script:
- export LIBDAP_BUILD=distcheck
- ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer
- make distcheck -j7
- stage: scan
script:
- export LIBDAP_BUILD=sonar
- ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j7
# Run these commands in bw-output?
- make check -j7
- make coverage
- find . -wholename \*/.libs/*.gcov -a ! -name \*\#\* -a ! -name \*.hh.gcov > gcov-files.txt
- mkdir -p gcov-reports
# gcov-reports must be configured in sonar-project.properties. jhrg 11/24/20
- mv $(cat gcov-files.txt) gcov-reports/
- sonar-scanner -Dsonar.login=$SONAR_LOGIN
# Test the result of the scan and fail a PR/build if the quality gate fails
- curl -s https://sonarcloud.io/api/project_badges/quality_gate?project=OPENDAP-libdap4 | grep "QUALITY GATE PASS"
- stage: package
script:
- export LIBDAP_BUILD=deb
- mkdir -p $prefix/debbuild
# $TRAVIS_DUILD_DIR:/root/travis used to make the build-deb.sh script available
- docker run --volume $prefix/debbuild:/root --volume $TRAVIS_BUILD_DIR:/root/travis
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
--env os=ubuntu14 opendap/ubuntu14_hyrax_build:1.5 /root/travis/build-deb.sh
- stage: package
script:
- export LIBDAP_BUILD=centos7
- mkdir -p $prefix/rpmbuild
- docker run --volume $prefix/rpmbuild:/root/rpmbuild --volume $TRAVIS_BUILD_DIR:/root/travis
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
--env os=centos7 opendap/centos7_hyrax_builder:1.2 /root/travis/build-rpm.sh
- stage: package
script:
- export LIBDAP_BUILD=srcdist
- mkdir -p $TRAVIS_BUILD_DIR/package
- ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer
- make dist -j7
# Make both a libdap-<version> and libdap-snapshot tar.gz. This will simplify
# other operations that use the libdap source code like the bes build.
- cp libdap-*.tar.gz $TRAVIS_BUILD_DIR/package
- cp libdap-*.tar.gz $TRAVIS_BUILD_DIR/package/libdap-snapshot.tar.gz;
before_deploy:
- echo "LIBDAP_BUILD ${LIBDAP_BUILD}"
- mkdir -p $TRAVIS_BUILD_DIR/package
# This part of the before_deploy action copies the built distributions named with version numbers
# into $TRAVIS_BUILD_DIR/package and then places a second copy of those files with the version
# number replaced with the word 'snapshot.' These files are used for the our snapshot delivery
# and deployment process. jhrg 10/28/19
- if test "$LIBDAP_BUILD" = "main"; then tar -C $HOME -czvf $TRAVIS_BUILD_DIR/package/libdap-build.tar.gz
--exclude 'install/deps*' --exclude 'install/rpmbuild*' install; fi
# Debian distribution prep
- if test "$LIBDAP_BUILD" = "deb"; then ./travis/deb-to-package-dir.sh; fi
# Removed jhrg 10/23/20
# CentOS-6 distribution prep
# - if test "$LIBDAP_BUILD" = "centos6"; then ./travis/rpm-to-package-dir.sh "el6"; fi
# CentOS-7 distribution prep
- if test "$LIBDAP_BUILD" = "centos7"; then ./travis/rpm-to-package-dir.sh "el7"; fi
# Check for the stuff...
- ls -lR $TRAVIS_BUILD_DIR/package
deploy:
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:
# Change 'master' to 'travis' to test deployment
branch: master
condition: $LIBDAP_BUILD =~ ^main|srddist|deb|centos7|travis$
# Removed 'centos6|' jhrg 10/23/20