From 2157f32538ea8f5a327b772a89259be4ba8d0187 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 12 Jan 2025 16:47:37 +1100 Subject: [PATCH] fix: multiple fixes - fix basename command, missing $ - change BRANCH to GIT_BRANCH when pushing keys to consul - run `make all` instead of `make build-all` --- Makefile | 4 ++-- ci/build.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 639c691..cda82e9 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ SYMLINK_PREFIX := library_ REGISTRY := git.query.consul OWNER := unkin DATE_TAG := $(shell date +%Y%m%d) -SUFFIX=$(shell basename $(mktemp -u) | cut -d . -f 2) +SUFFIX=$(shell basename $$(mktemp -u) | cut -d . -f 2) GIT_BRANCH=$(shell git branch --show-current) GIT_COMMIT := $(shell git rev-parse --short HEAD) @@ -82,7 +82,7 @@ $(DIRS): packer build . ) # Update build timestamp and date in Consul if on master branch - @if [ "$(BRANCH)" = "master" ]; then \ + @if [ "$(GIT_BRANCH)" = "master" ]; then \ echo "Current branch is $(GIT_BRANCH), updating consul."; \ CURRENT_TIMESTAMP=$$(date +%s); \ READABLE_DATE=$$(date '+%Y-%m-%d %H:%M:%S %Z'); \ diff --git a/ci/build.sh b/ci/build.sh index 55681ed..8e34e4d 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -9,7 +9,7 @@ images_changes=$(git diff --name-only master | grep -E '^images/') # Run `make all` if there are changes in builds/ if [ -n "$builds_changes" ]; then echo "Changes detected in builds/. Running 'make build-all'..." - make build-all + make all fi # Run specific `make` commands for each changed file in images/