Skip to content

Commit

Permalink
Update helm-push targets to support pushing to non-OCI
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi committed Aug 29, 2024
1 parent 4fe1001 commit 30f87ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,23 @@ helm-push: helm-package
chart_version=$$(echo $$base | grep -o "v\{0,1\}[0-9]\+\.[0-9]\+\.[0-9].*"); \
chart_name="$${base%-"$$chart_version"}"; \
echo "Verifying if chart $$chart_name, version $$chart_version already exists in $(REGISTRY_REPO)"; \
chart_exists=$$($(HELM) pull $(REGISTRY_REPO)/$$chart_name --version $$chart_version --destination /tmp 2>&1 | grep "not found" || true); \
chart_exists=$$($(HELM) pull --repo $(REGISTRY_REPO) $$chart_name --version $$chart_version --destination /tmp 2>&1 | grep "not found" || true); \
if [ -z "$$chart_exists" ]; then \
echo "Chart $$chart_name version $$chart_version already exists in the repository."; \
else \
echo "Pushing $$chart to $(REGISTRY_REPO)"; \
$(HELM) push "$$chart" $(REGISTRY_REPO); \
if [ $(REGISTRY_REPO) == "oci://*" ]; then \
echo "Pushing $$chart to $(REGISTRY_REPO)"; \
$(HELM) push "$$chart" $(REGISTRY_REPO); \
else \
if [ ! $$REGISTRY_USERNAME ] && [ ! $$REGISTRY_PASSWORD ]; then \
echo "REGISTRY_USERNAME and REGISTRY_PASSWORD must be populated to push the chart to an HTTPS repository"; \
exit 1; \
else \
$(HELM) repo add hmc $(REGISTRY_REPO); \
echo "Pushing $$chart to $(REGISTRY_REPO)"; \
$(HELM) cm-push "$$chart" $(REGISTRY_REPO) --username $$REGISTRY_USERNAME --password $$REGISTRY_PASSWORD; \
fi; \
fi; \
fi; \
done

Expand Down
6 changes: 3 additions & 3 deletions config/dev/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ metadata:
spec:
template: aws-standalone-cp
config:
region: us-west-2
region: us-east-2
publicIP: true
controlPlaneNumber: 1
workersNumber: 1
controlPlane:
amiID: ami-0989c067ff3da4b27
amiID: ami-02f3416038bdb17fb
instanceType: t3.small
worker:
amiID: ami-0989c067ff3da4b27
amiID: ami-02f3416038bdb17fb
instanceType: t3.small

0 comments on commit 30f87ce

Please sign in to comment.