Skip to content

Commit

Permalink
fix: add necessary ldflags
Browse files Browse the repository at this point in the history
  • Loading branch information
nsklikas committed Oct 20, 2023
1 parent 65d854b commit 9d63059
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ parts:
source-type: git
source-tag: v1.3.3
override-build: |
go build -o ${CRAFT_PART_INSTALL}/bin/openfga ./cmd/openfga
build_ver="${src_config_path}/config.Version"
build_hash="${src_config_path}/config.Commit"
build_date="${src_config_path}/config.Date"
go_linker_flags="-s \
-w \
-X ${build_ver}=$(git -C "${CRAFT_PART_SRC}" describe --tags) \
-X ${build_hash}=$(git -C "${CRAFT_PART_SRC}" rev-parse HEAD) \
-X ${build_date}=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
go mod download
go build -ldflags="${go_linker_flags}" -o ${CRAFT_PART_INSTALL}/bin/openfga ./cmd/openfga
grpc_health_probe:
plugin: go
Expand Down

0 comments on commit 9d63059

Please sign in to comment.