forked from dcos/dcos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_teamcity
executable file
·55 lines (43 loc) · 1.39 KB
/
build_teamcity
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
#!/bin/bash
set -x
set -o errexit -o pipefail
# Fail quickly if docker daemon is not up
systemctl status docker
# cleanup from previous builds
# *active.json and *.bootstrap.tar.xz must be cleaned up, otherwise
# Teamcity starts picking up artifacts from previous builds.
#
# We manually clean rather than having TeamCity always clean so that
# builds are quicker.
rm -rf dcos-release.config.yaml
rm -rf artifacts/
rm -f packages/*.active.json
rm -f packages/bootstrap.latest
rm -f packages/*.bootstrap.tar.xz
rm -f CHANNEL_NAME
rm -rf build/env
rm -f dcos_generate_config*.sh
rm -rf wheelhouse/
# Force Python stdout/err to be unbuffered.
export PYTHONUNBUFFERED="notemtpy"
# enable pkgpanda virtualenv *ALWAYS COPY* otherwise the TC cleanup will traverse and corrupt system python
virtualenv --always-copy build/env
. build/env/bin/activate
if [[ "$TEAMCITY_BRANCH" == "<default>" ]]
then
echo "ERROR: Building with a branch name of <default> is not supported"
exit 1
fi
TAG="$TEAMCITY_BRANCH"
CHANNEL_NAME=testing/$TAG
echo tag: "$TAG"
echo channel: "$CHANNEL_NAME"
echo "##teamcity[setParameter name='env.CHANNEL_NAME' value='$CHANNEL_NAME']"
echo "##teamcity[setParameter name='env.TAG' value='$TAG']"
cp config/dcos-release.config.yaml dcos-release.config.yaml
./prep_teamcity
release create $TAG $TAG
if [ -d wheelhouse ]; then
cp -r wheelhouse artifacts/
fi
rm -rf artifacts/dcos_generate_config.*