Ajouter version subcommand
Affiche la version de l'exécutable tel que défini at build time. Autres changements: - [DOCKERFILE] Ajouter `ARG agecem_org_version` - [FEATURE] Ajouter package version/ - [DOCKERFILE] `ADD version/` - [DOCKERFILE] Retirer installsuffix de build step - [DOCKERFILE] Utiliser `agecem_org_version` pour remplir version.version dans l'exécutabe - [DOCKERFILE] Nommer deuxième stage `run` - [DOCKER-COMPOSE] Standardiser valeurs
This commit is contained in:
parent
1c558687b4
commit
6c97a670c6
4 changed files with 52 additions and 10 deletions
19
version/version.go
Normal file
19
version/version.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package version
|
||||
|
||||
// Filled by build flag
|
||||
var version string
|
||||
|
||||
/*
|
||||
Version returns the application version
|
||||
|
||||
Example command to use the output of `git describe` for version number at build time:
|
||||
|
||||
$ go build -ldflags="-X 'git.agecem.com/agecem/agecem-org/version.version=`git describe`'" .
|
||||
*/
|
||||
func Version() string {
|
||||
if version == "" {
|
||||
return "version unknown"
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue