Skip to content

Commit 25f7e0c

Browse files
authored
Merge pull request #49 from infinityworks/release-version
Release version
2 parents 0552b53 + e063277 commit 25f7e0c

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ FROM alpine:3.11.3
1515
RUN apk --no-cache add ca-certificates \
1616
&& addgroup exporter \
1717
&& adduser -S -G exporter exporter
18+
ADD VERSION .
1819
USER exporter
1920
COPY --from=build /bin/main /bin/main
2021
ENV LISTEN_PORT=9171

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,14 @@ Run as follows
6969
make test
7070
```
7171

72+
## Version Release Procedure
73+
Once a new pull request has been merged into `master` the following script should be executed locally. The script will trigger a new image build in docker hub with the new image having the tag `release-<version>`. The version is taken from the `VERSION` file and must follow semantic versioning. For more information see [semver.org](https://semver.org/).
74+
75+
Prior to running the following command ensure the number has been increased to desired version in `VERSION`:
76+
77+
```bash
78+
./release-version.sh
79+
```
80+
7281
## Metadata
7382
[![](https://images.microbadger.com/badges/image/infinityworks/github-exporter.svg)](http://microbadger.com/images/infinityworks/github-exporter "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/version/infinityworks/github-exporter.svg)](http://microbadger.com/images/infinityworks/github-exporter "Get your own version badge on microbadger.com")

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

release-version.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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)
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

0 commit comments

Comments
 (0)