File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ FROM alpine:3.11.3
1515RUN apk --no-cache add ca-certificates \
1616 && addgroup exporter \
1717 && adduser -S -G exporter exporter
18+ ADD VERSION .
1819USER exporter
1920COPY --from=build /bin/main /bin/main
2021ENV LISTEN_PORT=9171
Original file line number Diff line number Diff line change 1+ 1.0.0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ensure git is in the correct branch and has latest from remote.
4+ git checkout master
5+ git pull origin master
6+
7+ version=$( cat VERSION.txt)
8+ echo " version: $version "
9+
10+ # exist if tag alredy exists.
11+ if [ $( git tag -l " $version " ) ]; then
12+ echo " tag already exists. Ensure verion number has been update in VERSION."
13+ exit 1
14+ fi
15+
16+ # check version is in the correct format.
17+ if ! [[ " $version " =~ ^[0-9.]+$ ]]; then
18+ echo " version: " $version " is in the wrong format."
19+ exit 1
20+ fi
21+
22+ # tag current latest commit.
23+ echo " tagging..."
24+ git tag $version
25+
26+ # push tag to trigger build.
27+ echo " pushing tag to trigger build..."
28+ git push origin $version
You can’t perform that action at this time.
0 commit comments