-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep_teamcity
executable file
·45 lines (33 loc) · 1.34 KB
/
prep_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
#!/bin/bash
#
# Simple helper script to build wheels and install pkgpanda, dcos-image inside
# of CI
#
# Expects that it is being run inside of a virtual environment.
set -o errexit -o nounset -o pipefail
: ${VIRTUAL_ENV?"Must be run in a python virtual environment"}
# NOTE: If the directory already exists that is indeed a hard error. Should be
# cleaned up between builds to guarantee we get the artifacts we expect.
mkdir wheelhouse || (echo wheelhouse folder must be deleted before prep_teamcity is rerun && exit 1)
# Make a clean copy of pkgpanda so the python artifacts build fast
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd $DIR
if [ -d ext/dcos-image ]
then
rm -rf ext/dcos-image
fi
git clone "file://$DIR" ext/dcos-image
git -C ext/dcos-image checkout -qf `git rev-parse --verify HEAD^{commit}`
popd
# Install the latest version of pip
pip install -U pip
# We have wheel as a dependency since we use it to build the wheels
pip install wheel
# Download distro independent artifacts
pip install --download wheelhouse $DIR/ext/dcos-image
# Make the wheels, they will be output into the folder `wheelhouse` by default.
pip wheel --wheel-dir=wheelhouse --no-index --find-links=wheelhouse $DIR/ext/dcos-image
# Install the wheels
pip install --no-index --find-links=wheelhouse dcos-image
# Cleanup the checkout
rm -rf $DIR/ext/dcos-image