This repository has been archived by the owner on Oct 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
delivery.yaml
99 lines (99 loc) · 3.59 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: "2017-09-20"
pipeline:
- id: build
type: script
commands:
- desc: 'Build LTS'
cmd: |
# build
image=node-lts-temp:${CDP_BUILD_VERSION}
docker build -t $image --squash -f lts/Dockerfile --no-cache .
# test
sed -i "s,UNTESTED,$image,g" Dockerfile.test
docker build -t $image-test -f Dockerfile.test .
# get current Node version
out=$(docker run $image-test)
echo "$out"
# e.g. "node: 7.10.0"
version=$(echo "$out" | grep 'node:' | awk '{ print $2}')
release=registry-write.opensource.zalan.do/stups/node:$version-${CDP_TARGET_BRANCH_COUNTER}
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
docker tag $image $release
docker push $release
else
echo "Image $release not pushed because the build is not a push to master"
fi
- desc: 'Build LTS alpine'
cmd: |
# reset workpace from lts build
git reset --hard
# build
image=node-lts-alpine-temp:${CDP_BUILD_VERSION}
docker build -t $image --squash -f lts/Dockerfile.alpine --no-cache .
# test
sed -i "s,UNTESTED,$image,g" Dockerfile.test
docker build -t $image-test -f Dockerfile.test .
# get current Node version
out=$(docker run $image-test)
echo "$out"
# e.g. "node: 7.10.0-alpine"
version=$(echo "$out" | grep 'node:' | awk '{ print $2}')
release=registry-write.opensource.zalan.do/stups/node:$version-alpine-${CDP_TARGET_BRANCH_COUNTER}
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
docker tag $image $release
docker push $release
else
echo "Image $release not pushed because the build is not a push to master"
fi
- desc: 'Build Current'
cmd: |
# reset workpace from lts build
git reset --hard
# build
image=node-current-temp:${CDP_BUILD_VERSION}
docker build -t $image --squash -f current/Dockerfile --no-cache .
# test
sed -i "s,UNTESTED,$image,g" Dockerfile.test
docker build -t $image-test -f Dockerfile.test .
# get current Node version
out=$(docker run $image-test)
echo "$out"
# e.g. "node: 7.10.0"
version=$(echo "$out" | grep 'node:' | awk '{ print $2}')
release=registry-write.opensource.zalan.do/stups/node:$version-${CDP_TARGET_BRANCH_COUNTER}
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
docker tag $image $release
docker push $release
else
echo "Image $release not pushed because the build is not a push to master"
fi
- desc: 'Build Current alpine'
cmd: |
# reset workpace from lts build
git reset --hard
# build
image=node-current-alpine-temp:${CDP_BUILD_VERSION}
docker build -t $image --squash -f current/Dockerfile --no-cache .
# test
sed -i "s,UNTESTED,$image,g" Dockerfile.test
docker build -t $image-test -f Dockerfile.test .
# get current Node version
out=$(docker run $image-test)
echo "$out"
# e.g. "node: 7.10.0-alpine"
version=$(echo "$out" | grep 'node:' | awk '{ print $2}')
release=registry-write.opensource.zalan.do/stups/node:$version-alpine-${CDP_TARGET_BRANCH_COUNTER}
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${IS_PR_BUILD} != "true" ]]
then
docker tag $image $release
docker push $release
else
echo "Image $release not pushed because the build is not a push to master"
fi