forked from cfengine/masterfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
123 lines (112 loc) · 3.95 KB
/
Copy path.travis.yml
File metadata and controls
123 lines (112 loc) · 3.95 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
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: JOB_TYPE=valgrind_health_check
before_install:
- chmod ug+x ./travis-scripts/*
- ./travis-scripts/before_install.sh
script:
- sudo ./travis-scripts/valgrind.sh
# JOB 2
- env: CF_VERSION=master
install:
- BRANCH=$CF_VERSION
- DATE=`wget -qO- https://builds.cfengine.com/pub/nightly/$BRANCH/FOOTER.html --no-check-certificate | grep -o 'latest.>[^<]*'`
- DATE="${DATE#*>}"
- DIR_URL="https://builds.cfengine.com/pub/nightly/master/$DATE/output/PACKAGES_x86_64_linux_debian_7"
- FILE=`wget --no-check-certificate -qO- "$DIR_URL" | grep -o '[^>]*\.deb<'`
- FILE="${FILE%%<*}"
- wget --no-check-certificate $DIR_URL/$FILE
- sudo dpkg -i $FILE
# JOB 3
- env: CF_VERSION=3.15.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.15.*
# JOB 4
- env: CF_VERSION=3.12.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.12.*
# JOB 5
- 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.*
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.sh 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/..
- export RELEASE_TAG=$(/var/cfengine/bin/cf-agent --version | awk '{print $3}')
- export BRANCH="$RELEASE_TAG"
- if [ "$CF_VERSION" = "master" ]; then
export BRANCH="master";
fi
- git clone --depth=1 --branch $BRANCH 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"