forked from zalando/skipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery.yaml
80 lines (79 loc) · 3.56 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
version: "2017-09-20"
pipeline:
- id: build
overlay: ci/golang
type: script
commands:
- desc: build-push
cmd: |
apt-get update -o Acquire::http::AllowRedirect=false
apt-get install -o Acquire::http::AllowRedirect=false -y bzr redis-server
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
LATEST_VERSION=$(git describe --tags --always | awk -F \- '{print $1}')
CUR_PART=$(echo $LATEST_VERSION | awk -F . '{print $1"."$2}')
VERSION_PART=$(cat VERSION)
OLD_PATCH=$(echo $LATEST_VERSION | awk -F . '{print $3}')
NEW_PATCH=$((OLD_PATCH + 1))
if [ "$CUR_PART" != "$VERSION_PART" ]; then NEW_PATCH=0; fi
RELEASE_VERSION=${VERSION_PART}.${NEW_PATCH}
export VERSION="${RELEASE_VERSION}"
IMAGE="registry-write.opensource.zalan.do/pathfinder/skipper:${RELEASE_VERSION}"
else
IMAGE="registry-write.opensource.zalan.do/pathfinder/skipper-test:${CDP_BUILD_VERSION}"
fi
export IMAGE
make deps cicheck staticcheck gosec
git status
git diff
cd packaging && make docker-build && git status && git diff && make docker-push
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
echo "Created docker image registry.opensource.zalan.do/pathfinder/skipper:${RELEASE_VERSION}"
echo "Creating docker image registry.opensource.zalan.do/pathfinder/skipper-armv8:${RELEASE_VERSION}"
export IMAGE="registry-write.opensource.zalan.do/pathfinder/skipper-armv8:${RELEASE_VERSION}"
GOARCH=arm64 make docker-build && git status && git diff && make docker-push
echo "Creating docker image registry.opensource.zalan.do/pathfinder/skipper-armv7:${RELEASE_VERSION}"
export IMAGE="registry-write.opensource.zalan.do/pathfinder/skipper-armv7:${RELEASE_VERSION}"
GOARCH=arm GOARM=GOARM=7 make docker-build && git status && git diff && make docker-push
echo "Creating git tag: ${RELEASE_VERSION}"
git gh-tag "${RELEASE_VERSION}"
echo "Creating release for tag: ${RELEASE_VERSION}"
make build.package
files=(-u sha256sum.txt); for f in *.tar.gz; do files+=(-u "$f"); done
echo "create release page"
tf=$(mktemp)
echo -e "### Changes\n" >$tf
git log -1 --pretty=%B | grep -v 'Signed-off-by:' | grep -v -E '^\s*$' | grep -vE '^\*' >>$tf
echo -e "\n### Docker image\n" >>$tf
echo -e "Docker image is available in Zalando's Open Source registry:\n" >>$tf
echo -e '```' >>$tf
echo -e "docker run -it registry.opensource.zalan.do/pathfinder/skipper:${RELEASE_VERSION} skipper --help" >>$tf
echo -e '```' >>$tf
echo "################################"
cat $tf
echo "################################"
git gh-release --message-from-file "${tf}" "${files[@]}" "$RELEASE_VERSION"
else
echo "Not creating a release. No release version defined."
fi
- id: docs
type: script
overlay: ci/python
commands:
- desc: install deps
cmd: |
pip3 install mkdocs mkdocs-material markdown-include
- desc: build docs
cmd: |
mkdocs build --strict
shopt -s extglob # needed to use !(pr)
if [ "$CDP_PULL_REQUEST_NUMBER" ]; then
mkdir -p site/pr/#{CDP_PULL_REQUEST_NUMBER}
mv site/!(pr) site/pr/#{CDP_PULL_REQUEST_NUMBER}
fi
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
echo "Please update the docs with: mkdocs gh-deploy"
fi
artifacts:
- type: docs
name: skipper
path: site