forked from NetRadiator/backup-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcibuild
More file actions
executable file
·67 lines (57 loc) · 1.76 KB
/
cibuild
File metadata and controls
executable file
·67 lines (57 loc) · 1.76 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
#!/usr/bin/env bash
# Usage: script/cibuild [--no-package]
set -e
# GHE appliance versions to run tests against. Remote metadata files are put in
# place with this version at the beginning of each test and many commands have
# conditional logic based on the remote version. Running the suite against
# different major versions ensures we're covering these conditional paths.
REMOTE_VERSIONS="
11.10.344
2.0.0
2.2.0
2.5.0
"
# Enable verbose logging of ssh commands
export GHE_VERBOSE_SSH=true
# Run over all remote versions and run entire test suite against each
res=true
for version in $REMOTE_VERSIONS
do
echo "==> Running testsuite with GHE_TEST_REMOTE_VERSION=$version"
export GHE_TEST_REMOTE_VERSION="$version"
if ! ls -1 test/test-*.sh | xargs -P 4 -n 1 /bin/bash; then
res=false
fi
echo
done
# If any of the version tests failed, exit non-zero
$res
# Bail out when --no-package given
[ "$1" = "--no-package" ] && exit 0
# files we'll md5sum at the end
pkg_files=
# Build the tarball
echo "Building tar.gz package ..."
if script/package-tarball 1>package-tarball.txt 2>&1; then
pkg_files=$(grep '^Package ' < package-tarball.txt | cut -f 2 -d ' ')
else
echo "Packaging tar.gz failed:"
cat package-tarball.txt | sed 's/^/ /' 1>&2
exit 1
fi
# Skip deb packaging if debuild not installed
if ! type debuild 1>/dev/null 2>&1; then
echo "debuild not installed, skipping deb packaging ..."
exit 0
fi
# Build the deb related packages
echo "Building deb package ..."
if script/package-deb 1>package-deb-out.txt 2>package-deb-err.txt; then
pkg_files="$pkg_files $(cat package-deb-out.txt)"
else
echo "Package build failed:"
cat package-tarball.txt | sed 's/^/ /' 1>&2
exit 1
fi
# Generate md5sums
md5sum $pkg_files