test: debug
All checks were successful
Build / build (pull_request) Successful in 5s

This commit is contained in:
Ben Vincent 2025-01-25 17:21:30 +11:00
parent 7a1d25f3b6
commit 4a5a24e402

View File

@ -46,7 +46,7 @@ $(DIRS):
@echo "Environment retrieved for $@" @echo "Environment retrieved for $@"
# Check if on master branch # Check if on master branch
@if [ "$(GIT_BRANCH)" = "master" ]; then \ if [ "$(GIT_BRANCH)" = "master" ]; then \
echo "Current branch is $(GIT_BRANCH), checking latest timestamp in consul."; \ echo "Current branch is $(GIT_BRANCH), checking latest timestamp in consul."; \
LAST_BUILD_TIMESTAMP=$$(consul kv get infra/packer/$@/timestamp || echo "0"); \ LAST_BUILD_TIMESTAMP=$$(consul kv get infra/packer/$@/timestamp || echo "0"); \
CURRENT_TIME=$$(date +%s); \ CURRENT_TIME=$$(date +%s); \
@ -60,15 +60,15 @@ $(DIRS):
fi fi
# Link .hcl files # Link .hcl files
@find $(LIBRARY_PATH) -name '*.hcl' -exec sh -c 'ln -sf $$PWD/{} $(IMAGES_PATH)/$@/$(SYMLINK_PREFIX)$$(basename {})' \; find $(LIBRARY_PATH) -name '*.hcl' -exec sh -c 'ln -sf $$PWD/{} $(IMAGES_PATH)/$@/$(SYMLINK_PREFIX)$$(basename {})' \;
# Link builds # Link builds
@for build in $$(cat $(IMAGES_PATH)/$@/builds); do \ for build in $$(cat $(IMAGES_PATH)/$@/builds); do \
ln -sf ../../../../builds/$${build}.pkr.hcl $(IMAGES_PATH)/$@/library_$${build}.build.pkr.hcl; \ ln -sf ../../../../builds/$${build}.pkr.hcl $(IMAGES_PATH)/$@/library_$${build}.build.pkr.hcl; \
done done
# Build the image # Build the image
@(cd $(IMAGES_PATH)/$@ && \ (cd $(IMAGES_PATH)/$@ && \
export DATE=$(DATE_TAG) && \ export DATE=$(DATE_TAG) && \
export OS_NAME=$$(echo $@ | cut -d'/' -f1) && \ export OS_NAME=$$(echo $@ | cut -d'/' -f1) && \
export OS_VERSION_FULL=$$(echo $@ | cut -d'/' -f2) && \ export OS_VERSION_FULL=$$(echo $@ | cut -d'/' -f2) && \
@ -84,7 +84,7 @@ $(DIRS):
packer build . ) packer build . )
# Update build timestamp and date in Consul if on master branch # Update build timestamp and date in Consul if on master branch
@if [ "$(GIT_BRANCH)" = "master" ]; then \ if [ "$(GIT_BRANCH)" = "master" ]; then \
echo "Current branch is $(GIT_BRANCH), updating consul."; \ echo "Current branch is $(GIT_BRANCH), updating consul."; \
CURRENT_TIMESTAMP=$$(date +%s); \ CURRENT_TIMESTAMP=$$(date +%s); \
READABLE_DATE=$$(date '+%Y-%m-%d %H:%M:%S %Z'); \ READABLE_DATE=$$(date '+%Y-%m-%d %H:%M:%S %Z'); \