forked from nilsmeyer/docker-openjdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery.yaml
36 lines (36 loc) · 1.42 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
version: "2017-09-20"
dependencies:
- id: base
type: docker
ref: registry.opensource.zalan.do/stups/ubuntu
pipeline:
- id: build
type: script
commands:
- desc: 'Install required build software'
cmd: 'apt-get install -y make git apt-transport-https ca-certificates curl'
- 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=openjdk-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 Java version
out=$(docker run $image-test 2>&1)
echo "$out"
# e.g. 'openjdk version "1.8.0_131"'
version=$(echo "$out" | grep 'openjdk version' | tr -d '"' | tr '_' '-' | awk '{ print $3 }')
release=registry-write.opensource.zalan.do/stups/openjdk:$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