-
Notifications
You must be signed in to change notification settings - Fork 9
/
delivery.yaml
34 lines (26 loc) · 1.26 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
build_steps:
- desc: Prepare Environment
cmd: |
apt-get update
apt-get install -y jq
- desc: Build and push docker images
cmd: |
# Please bump PATCH_VERSION if you change etcd.py or Dockerfile
PATCH_VERSION=p24
STOP_VERSION=2.3
ETCD_VERSIONS=$(curl -sL "https://api.github.com/repos/etcd-io/etcd/releases?per_page=100" | jq -r .[].name | sed -n 's/^v\([^-]*\)$/\1/p' | sort -urV)
ETCD_MAJOR_VERSIONS=$(sed 's/\.[0-9]*$//g' <<< "$ETCD_VERSIONS" | sort -urV)
for major_version in $ETCD_MAJOR_VERSIONS; do
version=$(egrep -m 1 "^${major_version/\./\\.}\." <<< "$ETCD_VERSIONS")
if [[ ! -z $prev ]]; then
IMAGE="registry-write.opensource.zalan.do/acid/etcd-cluster:$prev-$PATCH_VERSION"
docker build --build-arg ETCDVERSION_PREV=$version --build-arg ETCDVERSION=$prev -t $IMAGE .
# push docker images only for commits to the master branch
if [[ "x${CDP_SOURCE_BRANCH}" == "x" && "x${CDP_TARGET_BRANCH}" == "xmaster" ]]; then
docker push $IMAGE
fi
fi
[[ $major_version == $STOP_VERSION ]] && break
prev=$version
done
docker images