Skip to content

Commit

Permalink
Image build and push scripts now look at annotated git tags to
Browse files Browse the repository at this point in the history
determine the version
  • Loading branch information
dividedmind committed Dec 4, 2017
1 parent 1e54975 commit f12d452
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.1.1] - 2017-12-04
### Changed
- Build scripts now look at git tags to determine version and tags to use.

## 0.1.0 - 2017-12-04

The first tagged version.

[Unreleased]: https://github.com/cyberark/conjur/compare/v0.1.0...HEAD
[Unreleased]: https://github.com/cyberark/conjur/compare/v0.1.1...HEAD
[0.1.1]: https://github.com/cyberark/conjur/compare/v0.1.0...v0.1.1
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pipeline {
stage('Checkout SCM') {
steps {
checkout scm
sh 'git fetch' // to pull the tags
}
}
stage('Build Docker image') {
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash -ex

TAG="$(< VERSION)-$(git rev-parse --short HEAD)"
. git_tag.sh

TAG="$(git_tag)"
RUN_DEV=true

while [[ $# -gt 0 ]]
Expand Down
7 changes: 7 additions & 0 deletions git_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Gets the version string of the current HEAD without the `v` prefix.
git_tag() {
local GIT_TAG="$(git describe --abbrev $1)"
echo "${GIT_TAG#v}"
}
4 changes: 3 additions & 1 deletion push-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# Release images can be created by passing the desired tag to this script
# Ex: ./push-image 4.9.5.1

TAG="${1:-$(< VERSION)-$(git rev-parse --short HEAD)}"
. git_tag.sh

TAG="${1:-$(git_tag)}"

SOURCE_IMAGE='conjur'
INTERNAL_IMAGE='registry.tld/conjur'
Expand Down

0 comments on commit f12d452

Please sign in to comment.