-
Notifications
You must be signed in to change notification settings - Fork 30
/
delivery.yaml
142 lines (136 loc) · 5.04 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
version: "2017-09-20"
dependencies:
- id: base-image
type: docker
ref: registry.opensource.zalan.do/library/eclipse-temurin-17-jdk
pipeline:
- id: compile-test
type: script
when:
event: push
branch: master
vm_config:
type: linux
image: cdp-runtime/jdk17-sbt
size: large
commands:
- desc: Compile and test application
cmd: |
sbt compile test
- id: release-patch-version
type: script
when:
event: push
branch: master
triggered_by_dependency: null
requires_human_approval: true
vm_config:
type: linux
image: cdp-runtime/jdk17-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
buildVersion="$(cut -d '.' -f3 <<< $version)"
minorVersion="$(cut -d '.' -f2 <<< $version)"
majorVersion="$(cut -d '.' -f1 <<< $version)"
version="$majorVersion.$minorVersion.$(($buildVersion + 1))"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/buffalo
echo "Published a new release version: $version"
echo "Tagging new version: $version"
git gh-tag $version
- id: release-minor-version
type: script
when:
event: push
branch: master
triggered_by_dependency: null
requires_human_approval: true
vm_config:
type: linux
image: cdp-runtime/jdk17-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
minorVersion="$(cut -d '.' -f2 <<< $version)"
majorVersion="$(cut -d '.' -f1 <<< $version)"
version="$majorVersion.$(($minorVersion + 1)).0"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/buffalo
echo "Published a new release version: $version"
echo "Tagging new version: $version"
git gh-tag $version
- id: release-major-version
type: script
when:
event: push
branch: master
triggered_by_dependency: null
requires_human_approval: true
vm_config:
type: linux
image: cdp-runtime/jdk17-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
buildVersion="$(cut -d '.' -f3 <<< $version)"
minorVersion="$(cut -d '.' -f2 <<< $version)"
majorVersion="$(cut -d '.' -f1 <<< ${version//v})"
version="v$((majorVersion + 1)).0.0"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/buffalo
echo "Published a new release version: $version"
echo "Tagging new version: $version"
git gh-tag $version
- id: release-updated-base-image
type: script
when:
event: push
branch: master
triggered_by_dependency: base-image
vm_config:
type: linux
image: cdp-runtime/jdk17-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
version="$version-$(date +'%Y%m%d')"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/buffalo
echo "Published an updated release version: $version"