-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (39 loc) · 1.67 KB
/
Makefile
File metadata and controls
42 lines (39 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.PHONY: help # List phony targets
help:
@cat "Makefile" | grep '^.PHONY:' | sed -e "s/^.PHONY:/- make/"
.PHONY: lint # Lint and test the Helm chart (as in GitHub Actions)
lint:
@echo "Running Helm lint..."
@helm lint .
@echo "✓ Helm lint passed"
@echo "Running Helm template test..."
@helm template test . --namespace test > /dev/null
@echo "✓ Helm template test passed"
@echo "Running chart-testing lint with Docker..."
@docker run --rm -v $(shell pwd)/..:/workdir --workdir /workdir quay.io/helmpack/chart-testing:latest ct lint --chart-dirs . --charts plone --validate-maintainers=false
@echo "✓ Chart-testing lint passed"
.PHONY: test # Run Helm unit tests
test:
@docker run --rm -v $(shell pwd):/apps helmunittest/helm-unittest:latest .
.PHONY: release # Create and push a git tag (usage: make release VERSION=1.0.0 MESSAGE="my release message")
release:
@if [ -z "$(VERSION)" ]; then \
echo "Error: VERSION is required. Usage: make release VERSION=1.0.0 MESSAGE=\"my release message\""; \
exit 1; \
fi; \
if [ -z "$(MESSAGE)" ]; then \
echo "Error: MESSAGE is required. Usage: make release VERSION=1.0.0 MESSAGE=\"my release message\""; \
exit 1; \
fi; \
if git rev-parse "$(VERSION)" >/dev/null 2>&1; then \
echo "Error: Tag $(VERSION) already exists"; \
exit 1; \
fi; \
echo "Updating Chart.yaml version to $(VERSION)..."; \
sed -i "s/^version: .*/version: $(VERSION)/" Chart.yaml && \
git add Chart.yaml && \
git commit -m "chore: Bump version to $(VERSION)" && \
git tag -a "$(VERSION)" -m "$(MESSAGE)" && \
git push origin main && \
git push origin "$(VERSION)" && \
echo "Chart version updated, tag $(VERSION) created and pushed successfully"