Skip to content

Commit

Permalink
fix: taskfile version cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-hermann-sva committed Jan 1, 2025
1 parent 5386980 commit 3650284
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ vars:
PARAMETERS: ""
DAGGER_GO_MODULE: github.com/stuttgart-things/dagger/go
DAGGER_GO_MODULE_VERSION: v0.0.1
# VERSION:
# sh: git describe --tags --abbrev=0 2>/dev/null; [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ] && echo "$(git rev-parse --abbrev-ref HEAD)"
VERSION:
sh: |
[ "$(git branch --show-current)" != "main" ] && echo "previewPost-$(git describe --tags --abbrev=0)" || echo $(git describe --tags --abbrev=0)
dotenv: ['.env', '{{.HOME}}/.env']

Expand Down Expand Up @@ -100,14 +101,14 @@ tasks:
desc: Install
deps: [lint, test]
cmds:
- go install -ldflags="-X {{ .MODULE }}/cmd.version={{ .UPDATED_TAG_VERSION }} -X {{ .MODULE }}/cmd.date={{ .DATE }} -X {{ .MODULE }}/cmd.commit={{ .GIT_COMMIT }}"
- go install -ldflags="-X {{ .MODULE }}/cmd.version={{ .VERSION }} -X {{ .MODULE }}/cmd.date={{ .DATE }} -X {{ .MODULE }}/cmd.commit={{ .GIT_COMMIT }}"

build-image:
desc: Build container image
deps: [install]
cmds:
- sudo nerdctl build -t {{ .REGISTRY }}/{{ .REPOSITORY_NAME }}/{{ lower (.PROJECT_NAME) }}:{{ .UPDATED_TAG_VERSION }} --build-arg VERSION={{ .UPDATED_TAG_VERSION }} --build-arg BUILD_DATE={{ .DATE }} --build-arg COMMIT={{ .GIT_COMMIT }} .
- sudo nerdctl push {{ .REGISTRY }}/{{ .REPOSITORY_NAME }}/{{ lower (.PROJECT_NAME) }}:{{ .UPDATED_TAG_VERSION }}
- sudo nerdctl build -t {{ .REGISTRY }}/{{ .REPOSITORY_NAME }}/{{ lower (.PROJECT_NAME) }}:{{ .VERSION }} --build-arg VERSION={{ .VERSION }} --build-arg BUILD_DATE={{ .DATE }} --build-arg COMMIT={{ .GIT_COMMIT }} .
- sudo nerdctl push {{ .REGISTRY }}/{{ .REPOSITORY_NAME }}/{{ lower (.PROJECT_NAME) }}:{{ .VERSION }}

add-cmd:
deps: [install-cobra]
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/go-git/go-billy/v5 v5.6.1
github.com/go-git/go-git/v5 v5.13.0
github.com/google/go-github/v62 v62.0.0
github.com/google/go-github/v68 v68.0.0
github.com/pterm/pterm v0.12.80
github.com/spf13/cobra v1.8.1
github.com/stuttgart-things/clusterbook v0.0.0-20241120123325-b25e952ea9a6
Expand All @@ -17,7 +16,6 @@ require (
go.hein.dev/go-version v0.1.0
google.golang.org/grpc v1.69.2
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand Down Expand Up @@ -232,5 +230,6 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4=
github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4=
github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
Expand Down

0 comments on commit 3650284

Please sign in to comment.