Skip to content

Commit

Permalink
Merge pull request #182 from mintel/INFRA-35385-Add-packer-helpers
Browse files Browse the repository at this point in the history
Infra 35385 add packer helpers
  • Loading branch information
EmmanuelOgiji authored May 16, 2024
2 parents 8d6b36f + 207a2eb commit a4cb046
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
18 changes: 18 additions & 0 deletions modules/packer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Packer helpers
PACKER_REPO_BRANCH?=main
PACKER_REPO?[email protected]:mintel/satoshi/templates/packer-repo.git
PACKER_REPO_DIR=/tmp/packer-repo
PACKER_SOURCE_FILE="sources.pkr.hcl"

.PHONY: packer/update-sources
## Pulls in the current version of the `sources.pkr.hcl` file from the packer-repo template
packer/update-sources:
@echo "Cloning packer-repo: "${PACKER_REPO}""
@if [ -f "$(PACKER_SOURCE_FILE)" ]; then \
rm -rf $(PACKER_SOURCE_FILE) ;\
fi ;\
git clone --depth=1 $(PACKER_REPO) -b $(PACKER_REPO_BRANCH) $(PACKER_REPO_DIR) ;\
echo "Copying "${PACKER_SOURCE_FILE}""
cp "${PACKER_REPO_DIR}/${PACKER_SOURCE_FILE}" "${PACKER_SOURCE_FILE}"
echo "Cleanup cloned dir ${PACKER_REPO_DIR}"
rm -rf ${PACKER_REPO_DIR}
25 changes: 25 additions & 0 deletions modules/satoshi/packer-makefile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# DO NOT OVERRIDE THIS FILE. AUTO-GENERATED FROM 'make satoshi/update-makefile/packer'
#
export HELP_FILTER ?= asdf|grafana|jsonnet|k8s|kyverno|opa|pluto|satoshi|updater
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
export BUILD_HARNESS_PATH ?= $(shell 'pwd')
export BUILD_HARNESS_EXTENSIONS_PATH ?= $(BUILD_HARNESS_PATH)/build-harness-extensions

## Init build-harness and build-harness-extensions
.PHONY: bootstrap
bootstrap:
make init
if [ ! -d "./build-harness-extensions" ]; then git submodule add https://github.com/mintel/build-harness-extensions.git build-harness-extensions ; fi
git submodule update --init --recursive
exit 0

## Install tools
.PHONY: install
install:
@if [ ! -f .tool-versions ]; then \
make satoshi/update-tools/packer; \
else \
make asdf/install; \
fi
exit 0
6 changes: 6 additions & 0 deletions modules/satoshi/packer-tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# DO NOT OVERRIDE THIS FILE. AUTO-GENERATED FROM 'make satoshi/update-tools/packer'.
#

#asdf:plugin add packer
packer 1.10.3
2 changes: 1 addition & 1 deletion modules/satoshi/tf-makefile.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT OVERRIDE THIS FILE. AUTO-GENERATED FROM 'make satoshi/update-makefile'
# DO NOT OVERRIDE THIS FILE. AUTO-GENERATED FROM 'make satoshi/update-makefile/tf'
#
export HELP_FILTER ?= asdf|satoshi
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
Expand Down

0 comments on commit a4cb046

Please sign in to comment.