# cluster-map Deckhouse module. # # make test unit tests of the app and the hooks # make lint golangci-lint + dmt # make render helm template with test values (catches template errors fast) # make publish VERSION=v0.7.0 [CHANNEL=alpha] build, push and register the module # make release VERSION=v0.7.0 CHANNEL=stable move a release channel # # The registry layout follows deckhouse/modules-actions: : # registers the module, /: is the bundle, # //release: is the release image. MODULE ?= cluster-map SOURCE ?= git.project-chimera.ru/fanchji/cluster-map CHANNEL ?= alpha BASE_IMAGES_VERSION ?= v2.1.7 CRANE ?= crane DMT ?= dmt API_VERSIONS ?= --api-versions autoscaling.k8s.io/v1/VerticalPodAutoscaler --api-versions monitoring.coreos.com/v1/PodMonitor .PHONY: test lint render base-images build publish release test: cd images/cluster-map/src && go test -race -count=1 ./... cd hooks/batch && go test -count=1 ./... lint: cd images/cluster-map/src && golangci-lint run ./... cd hooks/batch && go vet ./... $(DMT) lint . render: helm template $(MODULE) . --namespace d8-cluster-map $(API_VERSIONS) -f tests/values/default.yaml > /dev/null helm template $(MODULE) . --namespace d8-cluster-map $(API_VERSIONS) -f tests/values/default.yaml -f tests/values/no-hubble.yaml > /dev/null @echo render OK # Deckhouse publishes its base image digests; the same file official modules build from. base_images.yml: curl -sfL -o $@ "https://fox.flant.com/api/v4/projects/deckhouse%2Fcontainer-base%2Fbase-images/packages/generic/base_images/$(BASE_IMAGES_VERSION)/base_images.yml" base-images: base_images.yml build: base_images.yml @test -n "$(VERSION)" || (echo "VERSION is required, e.g. VERSION=v0.7.0" && exit 1) MODULES_MODULE_TAG=$(VERSION) werf build --repo=$(SOURCE)/$(MODULE) --save-build-report --build-report-path images_tags_werf.json publish: build $(CRANE) copy "$$(jq -r '.Images.bundle.DockerImageName' images_tags_werf.json)" "$(SOURCE)/$(MODULE):$(VERSION)" $(CRANE) copy "$$(jq -r '.Images."release-channel-version".DockerImageName' images_tags_werf.json)" "$(SOURCE)/$(MODULE)/release:$(VERSION)" $(CRANE) append --oci-empty-base --new_layer "" --new_tag "$(SOURCE):$(MODULE)" $(MAKE) release VERSION=$(VERSION) CHANNEL=$(CHANNEL) release: @test -n "$(VERSION)" || (echo "VERSION is required" && exit 1) $(CRANE) copy "$(SOURCE)/$(MODULE)/release:$(VERSION)" "$(SOURCE)/$(MODULE)/release:$(CHANNEL)"