-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# exit if any step fails | ||
set -e | ||
|
||
# change current dir to the script dir | ||
cd "$(dirname "$0")" | ||
|
||
GIT_VERSION="$(git describe)" | ||
GIT_COMMIT="$(git rev-parse HEAD)" | ||
GIT_COMMIT_SHORT="$(git rev-parse --short HEAD)" | ||
|
||
# build service with version information | ||
go get -ldflags "-X main.GitVersion=${GIT_VERSION} -X main.GitCommit=${GIT_COMMIT} -X main.GitCommitShort=${GIT_COMMIT_SHORT}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package main | ||
|
||
var ( | ||
// GitVersion is a placeholder to inject git version, result of `git describe` | ||
GitVersion = "n/a" | ||
// GitCommit is a placeholder to inject git commit, result of `git rev-parse HEAD` | ||
GitCommit = "n/a" | ||
// GitCommitShort is a placeholder to inject git commit, result of `git rev-parse --short HEAD` | ||
GitCommitShort = "n/a" | ||
) | ||
|
||
// Version describes application version | ||
type Version struct { | ||
Version string | ||
Commit string | ||
CommitShort string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters