ci(build): add version number on build
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
ca5f84d1be
commit
534c4f83ad
|
@ -2,6 +2,8 @@ pipeline:
|
||||||
tests:
|
tests:
|
||||||
image: golang:1.18
|
image: golang:1.18
|
||||||
commands:
|
commands:
|
||||||
|
- test -n "$CI_COMMIT_TAG" && sed "s/{app_version}/$CI_COMMIT_TAG/g" -i main.go || true
|
||||||
|
- test -n "$CI_COMMIT_SHA" && sed "s/{app_version}/${CI_COMMIT_TAG:0:7}/g" -i main.go || true
|
||||||
- make test
|
- make test
|
||||||
|
|
||||||
build_push_latest_gitnet:
|
build_push_latest_gitnet:
|
||||||
|
@ -16,7 +18,6 @@ pipeline:
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
when:
|
when:
|
||||||
branch: [master, develop, feature/*]
|
|
||||||
event: [push]
|
event: [push]
|
||||||
|
|
||||||
build_push_tag_gitnet:
|
build_push_tag_gitnet:
|
||||||
|
@ -44,7 +45,6 @@ pipeline:
|
||||||
password:
|
password:
|
||||||
from_secret: registry_docker_password
|
from_secret: registry_docker_password
|
||||||
when:
|
when:
|
||||||
branch: [master]
|
|
||||||
event: [push]
|
event: [push]
|
||||||
|
|
||||||
build_push_tag_dhub:
|
build_push_tag_dhub:
|
||||||
|
|
2
main.go
2
main.go
|
@ -22,7 +22,7 @@ func main() {
|
||||||
app.Name = "email plugin"
|
app.Name = "email plugin"
|
||||||
app.Usage = "email plugin"
|
app.Usage = "email plugin"
|
||||||
app.Action = run
|
app.Action = run
|
||||||
app.Version = "2.0.2"
|
app.Version = "{app_version}"
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
// Plugin environment
|
// Plugin environment
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
|
|
Loading…
Reference in a new issue