Skip to content

Commit

Permalink
feat: add crane setup
Browse files Browse the repository at this point in the history
  • Loading branch information
armandomiani committed Dec 19, 2024
1 parent 5ed0f71 commit 88cef96
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion k8s/c2d_deployer.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ $(info ---- RELEASE = $(RELEASE))
.build/$(CHART_NAME): | .build
mkdir -p "$@"

app/build:: .build/$(CHART_NAME)/VERSION \
app/build:: .build/setup_crane \
.build/$(CHART_NAME)/VERSION \
.build/$(CHART_NAME)/$(CHART_NAME) \
.build/$(CHART_NAME)/images \
.build/$(CHART_NAME)/deployer
Expand All @@ -58,6 +59,25 @@ DEPLOYER_BUILDER := deployer-builder-$(shell echo $$RANDOM)
TESTER_BUILDER := tester-builder-$(shell echo $$RANDOM)


.build/setup_crane:
@if ! command -v crane &>/dev/null; then \
VERSION=$$(curl -s "https://api.github.com/repos/google/go-containerregistry/releases/latest" | jq -r '.tag_name'); \
OS=Linux; \
ARCH=x86_64; \
echo "Downloading crane version $$VERSION..."; \
curl -sL "https://github.com/google/go-containerregistry/releases/download/$$VERSION/go-containerregistry_$${OS}_$${ARCH}.tar.gz" > go-containerregistry.tar.gz; \
tar -zxvf go-containerregistry.tar.gz crane; \
sudo mv crane /usr/local/bin/crane; \
chmod 755 /usr/local/bin/crane; \
rm go-containerregistry.tar.gz; \
sudo chmod +x /usr/local/bin/crane; \
echo "crane successfully installed"; \
else \
echo "crane is already installed"; \
fi; \
crane version


.build/$(CHART_NAME)/deployer: deployer/* \
chart/$(CHART_NAME)/* \
chart/$(CHART_NAME)/templates/* \
Expand Down

0 comments on commit 88cef96

Please sign in to comment.