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 ae9df69
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,18 @@ parts:
source-type: git
source-tag: v1.3.3
override-build: |
go build -o ${CRAFT_PART_INSTALL}/bin/openfga ./cmd/openfga
src_config_path="github.com/openfga/openfga/internal"
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 ae9df69

Please sign in to comment.