forked from zalando-zmon/service-level-reporting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery.yaml
70 lines (62 loc) · 3.12 KB
/
delivery.yaml
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
build_steps:
- desc: "Update"
cmd: apt-get update
- desc: "Install Docker"
cmd: |
curl -sSL https://delivery.cloud.zalando.com/utils/ensure-docker | sh
- desc: "Install build dependencies"
cmd: |
apt-get install -y --no-install-recommends software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
apt-get install -q -y --no-install-recommends \
python3.6 \
python3.6-dev \
virtualenv \
python3-virtualenv \
python3-setuptools \
python3-wheel \
gcc \
libffi-dev \
libssl-dev \
libpq-dev \
tox
update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
- desc: "Install Python dependencies"
cmd: |
virtualenv -p python3 --no-site-packages venv
source venv/bin/activate
pip3 install --upgrade pip
pip3 install -r requirements.txt
pip3 install -U flake8
- desc: "Tox"
cmd: |
tox
# BUILD TEST IMAGES FROM PR - uncomment if test deployment is needed.
- desc: "Build and Push Docker Image (unstable)"
cmd: |
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} == "true" ]]
then
docker build -f dockerfiles/Dockerfile -t registry-write.opensource.zalan.do/zmon/service-level-reports-unstable:#{CDP_BUILD_VERSION} .
docker build -f dockerfiles/Dockerfile.frontend -t registry-write.opensource.zalan.do/zmon/service-level-reports-frontend-unstable:#{CDP_BUILD_VERSION} .
docker build -f dockerfiles/Dockerfile.generator -t registry-write.opensource.zalan.do/zmon/service-level-reports-generator-unstable:#{CDP_BUILD_VERSION} .
docker push registry-write.opensource.zalan.do/zmon/service-level-reports-unstable:#{CDP_BUILD_VERSION}
docker push registry-write.opensource.zalan.do/zmon/service-level-reports-frontend-unstable:#{CDP_BUILD_VERSION}
docker push registry-write.opensource.zalan.do/zmon/service-level-reports-generator-unstable:#{CDP_BUILD_VERSION}
fi
- desc: "Push Docker Image (if on master)"
cmd: |
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
docker build -f dockerfiles/Dockerfile -t registry-write.opensource.zalan.do/zmon/service-level-reports:#{CDP_BUILD_VERSION} .
docker build -f dockerfiles/Dockerfile.frontend -t registry-write.opensource.zalan.do/zmon/service-level-reports-frontend:#{CDP_BUILD_VERSION} .
docker build -f dockerfiles/Dockerfile.generator -t registry-write.opensource.zalan.do/zmon/service-level-reports-generator:#{CDP_BUILD_VERSION} .
docker push registry-write.opensource.zalan.do/zmon/service-level-reports:#{CDP_BUILD_VERSION}
docker push registry-write.opensource.zalan.do/zmon/service-level-reports-frontend:#{CDP_BUILD_VERSION}
docker push registry-write.opensource.zalan.do/zmon/service-level-reports-generator:#{CDP_BUILD_VERSION}
else
echo "Image not pushed because the build is not a push to master"
fi