This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
delivery.yaml
69 lines (60 loc) · 3.13 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
version: "2017-09-20"
pipeline:
- id: build
type: script
overlay: ci/python
commands:
- desc: "Update"
cmd: apt-get update
- desc: "Install build dependencies"
cmd: |
apt-get install -q -y --no-install-recommends \
virtualenv \
python3-virtualenv \
python3-setuptools \
python3-wheel \
gcc \
libffi-dev \
libssl-dev \
libpq-dev \
tox \
gnuplot
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