forked from zalando-zmon/service-level-reporting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery.yaml
76 lines (65 loc) · 2.92 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
71
72
73
74
75
76
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:fkrull/deadsnakes
apt-get update
apt-get install -q -y --no-install-recommends \
python3.6 \
python3.6-dev \
python3-pip \
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
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
- desc: "Install Python dependencies"
cmd: |
pip3 install --upgrade pip
pip3 install -r requirements.txt
pip3 install -U flake8
- desc: "Tox"
cmd: |
tox
- desc: "Build SLR backend"
cmd: |
docker build -f dockerfiles/Dockerfile -t registry-write.opensource.zalan.do/zmon/service-level-reports:#{CDP_BUILD_VERSION} .
docker build -f dockerfiles/Dockerfile -t registry-write.opensource.zalan.do/zmon/slr-production:#{CDP_BUILD_VERSION} .
- desc: "Build SLR frontend"
cmd: |
docker build -f dockerfiles/Dockerfile.frontend -t registry-write.opensource.zalan.do/zmon/service-level-reports-frontend:#{CDP_BUILD_VERSION} .
- desc: "Build SLR generator"
cmd: |
docker build -f dockerfiles/Dockerfile.generator -t registry-write.opensource.zalan.do/zmon/service-level-reports-generator:#{CDP_BUILD_VERSION} .
# BUILD TEST IMAGES FROM PR - uncomment if test deployment is needed.
- desc: "Push Docker Image (test)"
cmd: |
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} == "true" ]]
then
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}
fi
- desc: "Push Docker Image (if on master)"
cmd: |
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
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}
docker push registry-write.opensource.zalan.do/zmon/slr-production:#{CDP_BUILD_VERSION}
else
echo "Image not pushed because the build is not a push to master"
fi