forked from zalando-stups/docker-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelivery.yaml
34 lines (34 loc) · 1.27 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
version: "2017-09-20"
dependencies:
- id: base
type: docker
ref: registry.opensource.zalan.do/stups/ubuntu
pipeline:
- id: build
type: script
commands:
- desc: 'Install Docker'
cmd: 'curl -sSL https://delivery.cloud.zalando.com/utils/ensure-docker | sh'
- desc: 'Build'
cmd: |
# use the resolved Ubuntu base image version
echo "Ubuntu base image version: ${DEP_BASE_VERSION}"
sed -i "s,:latest,:${DEP_BASE_VERSION}," Dockerfile
image=python-temp:${CDP_BUILD_VERSION}
docker build -t $image --squash .
sed -i "s,UNTESTED,$image,g" Dockerfile.test
docker build -t $image-test -f Dockerfile.test .
# get current Python version
out=$(docker run $image-test)
echo "$out"
# e.g. "Python Version: CPython 3.6.1"
version=$(echo "$out" | grep 'Python Version:' | awk '{ print $4}')
release=registry-write.opensource.zalan.do/stups/python:$version-${CDP_TARGET_BRANCH_COUNTER}
docker tag $image $release
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
docker push $release
else
echo "Image not pushed because the build is not a push to master"
fi