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
21
cmd/version.go
Normal file
21
cmd/version.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.agecem.com/agecem/agecem-org/version"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// versionCmd represents the version command
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print version registered at build time",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("agecem-org", version.Version())
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue