forked from cfengine/masterfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (89 loc) · 3.01 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
git:
depth: 9999
language: c
sudo: required
matrix:
include:
# JOB 0 -- first because it's the fastest
- env: STYLE_CHECK_JOB=1
# JOB 1
- env: CF_VERSION=master
addons:
apt:
sources:
- sourceline: "deb https://cfengine-package-repos.s3.amazonaws.com/pub/apt/packages stable main"
- key_url: https://cfengine-package-repos.s3.amazonaws.com/pub/gpg.key
packages:
- cfengine-community
# JOB 2
- env: CF_VERSION=3.10.x
addons:
apt:
sources:
- sourceline: "deb https://cfengine-package-repos.s3.amazonaws.com/pub/apt/packages stable main"
- key_url: https://cfengine-package-repos.s3.amazonaws.com/pub/gpg.key
packages:
- cfengine-community=3.10.2-1
# JOB 3
- env: CF_VERSION=3.7.x
addons:
apt:
sources:
- sourceline: "deb https://cfengine-package-repos.s3.amazonaws.com/pub/apt/packages stable main"
- key_url: https://cfengine-package-repos.s3.amazonaws.com/pub/gpg.key
packages:
- cfengine-community=3.7.6-1
script:
- sudo apt-get install -y fakeroot
- INSTDIR=$HOME/cf_install
- cd $TRAVIS_BUILD_DIR
- if [ x$STYLE_CHECK_JOB = x1 ];
then
sh tests/style_check.sh;
exit;
fi
# Fetch the tags from upstream, even if we are running on a foreign clone;
# Needed for determine-version.py to work
- git remote add upstream https://github.com/cfengine/masterfiles.git;
git fetch upstream 'refs/tags/*:refs/tags/*';
- ./autogen.sh --without-core --prefix=$INSTDIR
- make install
- /var/cfengine/bin/cf-promises --version
- /var/cfengine/bin/cf-promises -c -I -f $INSTDIR/masterfiles/update.cf
- /var/cfengine/bin/cf-promises -c -I -f $INSTDIR/masterfiles/promises.cf
- make dist
- export DIST_TARBALL=`echo cfengine-masterfiles-*.tar.gz`
- make tar-package
- export PKG_TARBALL=`echo cfengine-masterfiles-*.pkg.tar.gz`
- if echo $DIST_TARBALL | grep -E -q '[0-9]{1,2}\.[0-9]{1,2}\.tar\.gz';
then
IS_PRERELEASE=false;
else
IS_PRERELEASE=true;
fi;
export IS_PRERELEASE
- cd $TRAVIS_BUILD_DIR/..
- git clone --depth=1 --branch $CF_VERSION https://github.com/cfengine/core
- chmod -R go-w .
- cp core/tests/acceptance/*.cf.sub masterfiles/tests/acceptance/
- umask 077
- cd masterfiles/tests/acceptance
- echo "CORE=$TRAVIS_BUILD_DIR/../core" > ./testall.env
- DEFRPMVERCMP=/bin/true ./testall --printlog --bindir=/var/cfengine/bin
# We deploy when setting tags only, which basically never happens
# on master branch. Cherry-pick this part and alter it properly into
# the release branches.
deploy:
skip_cleanup: true
provider: releases
# Remember to set it as private variable in Travis-CI settings
api_key: $GITHUB_RELEASE_TOKEN
# Does not work, I get the error that "true" is not a boolean
# prerelease: $IS_PRERELEASE
file:
- "$DIST_TARBALL"
- "$PKG_TARBALL"
on:
tags: true
# Avoid upload from all the multiple parallel matrix jobs
condition: "$CF_VERSION = master"