Skip to content

Commit

Permalink
Fix daemon client build ldflags values (#1504)
Browse files Browse the repository at this point in the history
* build walg-daemon-client: fix version

* print walg-daemon-client version in test
  • Loading branch information
sergey-arefev committed Jun 27, 2023
1 parent 61e2466 commit 9aaba50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ unlink_libsodium:

build_client:
cd cmd/daemonclient && \
go build -o ../../bin/walg-daemon-client -ldflags "-s -w -X github.com/wal-g/wal-g/cmd/walg-daemon-client.buildDate=`date -u +%Y.%m.%d_%H:%M:%S` -X github.com/wal-g/wal-g/cmd/walg-daemon-client.gitRevision=`git rev-parse --short HEAD` -X github.com/wal-g/wal-g/cmd/walg-daemon-client.version=`git tag -l --points-at HEAD`"
go build -o ../../bin/walg-daemon-client -ldflags "-s -w -X main.buildDate=`date -u +%Y.%m.%d_%H:%M:%S` -X main.gitRevision=`git rev-parse --short HEAD` -X main.version=`git tag -l --points-at HEAD`"
2 changes: 1 addition & 1 deletion cmd/daemonclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func main() {
}

if len(os.Args) > 1 && strings.ToLower(os.Args[1]) == "--version" {
fmt.Println(strings.Join([]string{version, gitRevision, buildDate}, "\t"))
fmt.Println(strings.Join([]string{"walg-daemon-client", version, gitRevision, buildDate}, "\t"))
return
}

Expand Down
3 changes: 3 additions & 0 deletions docker/pg_tests/scripts/tests/daemon_client_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export SKIP_TEST_WAL_OVERWRITES="1"
. /tmp/tests/test_functions/daemon_patch.sh
. /tmp/tests/test_functions/daemon_client_patch.sh

# show client version
walg-daemon-client --version

prepare_config "/tmp/configs/full_backup_test_config.json"
start_daemon
test_full_backup "${TMP_CONFIG}"

0 comments on commit 9aaba50

Please sign in to comment.