* Changes in goreleaser Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * few more fixes Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Test release Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * use setup-buildx action Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Project name Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * changes in cosign Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Fix image digest Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Verify provenance Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * temp commit Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * few more changes Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * fix attestations write permission Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Try pushing provenance to registry Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Simplify provenance and sbom for images * Sign all artifacts * Change repo to fission Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * fix docker builds for skaffold Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Fix sed commands Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> --------- Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
126 lines
3.9 KiB
Makefile
126 lines
3.9 KiB
Makefile
# Copyright 2017 The Fission Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
.DEFAULT_GOAL := check
|
|
|
|
SKAFFOLD_PROFILE ?= kind
|
|
|
|
VERSION ?= v0.0.0
|
|
TIMESTAMP ?= $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
|
COMMITSHA ?= $(shell git rev-parse HEAD)
|
|
|
|
GOOS ?= $(shell go env GOOS)
|
|
GOARCH ?= $(shell go env GOARCH)
|
|
GOAMD64 ?= $(shell go env GOAMD64)
|
|
GOPATH ?= $(shell go env GOPATH)
|
|
|
|
FISSION-CLI-SUFFIX :=
|
|
ifeq ($(GOOS), windows)
|
|
FISSION-CLI-SUFFIX := .exe
|
|
endif
|
|
|
|
# Show this help.
|
|
help:
|
|
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
|
|
|
|
print-%:
|
|
@echo '$*=$($*)'
|
|
|
|
debug-vars: print-GOOS print-GOARCH print-GOAMD64 print-VERSION print-TIMESTAMP print-COMMITSHA print-FISSION-CLI-SUFFIX print-SKAFFOLD_PROFILE
|
|
|
|
### Static checks
|
|
check: test-run build-fission-cli clean
|
|
|
|
code-checks:
|
|
golangci-lint run
|
|
|
|
# run basic check scripts
|
|
test-run: code-checks
|
|
hack/runtests.sh
|
|
@rm -f coverage.txt
|
|
|
|
### Binaries
|
|
build-fission-cli:
|
|
@GOOS=$(GOOS) GOARCH=$(GOARCH) GOAMD64=$(GOAMD64) GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --clean --single-target --id fission-cli
|
|
|
|
install-fission-cli:
|
|
# TODO: Fix this hack, replace v1 with GOAMD64
|
|
mv dist/fission-cli_$(GOOS)_$(GOARCH)_v1/fission$(FISSION-CLI-SUFFIX) /usr/local/bin/fission
|
|
|
|
### Codegen
|
|
codegen:
|
|
@./hack/update-codegen.sh
|
|
go tool controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
|
|
|
### CRDs
|
|
generate-crds:
|
|
go tool controller-gen crd \
|
|
paths=./pkg/apis/core/v1 \
|
|
output:crd:artifacts:config=crds/v1
|
|
|
|
### Webhook generation: it generates webhook configs with help of kubebuilder:webhook tag
|
|
generate-webhooks:
|
|
go tool controller-gen webhook \
|
|
paths=./pkg/webhook \
|
|
output:dir=charts/fission-all/templates/webhook-server
|
|
|
|
|
|
create-crds:
|
|
@kubectl create -k crds/v1
|
|
|
|
update-crds:
|
|
@kubectl replace -k crds/v1
|
|
|
|
delete-crds:
|
|
@kubectl delete -k crds/v1
|
|
|
|
### Cleanup
|
|
clean:
|
|
@rm -f dist/
|
|
|
|
### Misc
|
|
generate-swagger-doc:
|
|
@./hack/update-swagger-docs.sh
|
|
|
|
generate-cli-docs:
|
|
go run tools/cmd-docs/main.go -o "../fission.io/content/en/docs/reference/fission-cli"
|
|
|
|
generate-crd-ref-docs:
|
|
# crd-ref-docs: https://github.com/elastic/crd-ref-docs
|
|
go tool crd-ref-docs --source-path=pkg/apis/core/v1 --config=tools/crd-ref-docs/config.yaml --renderer markdown
|
|
cp tools/crd-ref-docs/header.md crd_docs.md
|
|
cat out.md >> crd_docs.md && rm out.md
|
|
mv crd_docs.md ../fission.io/content/en/docs/reference/crd-reference.md
|
|
|
|
all-generators: codegen generate-crds generate-swagger-doc generate-cli-docs generate-crd-ref-docs
|
|
|
|
skaffold-prebuild:
|
|
@GOOS=linux GOARCH=amd64 GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --clean --single-target
|
|
@cp -v cmd/builder/Dockerfile dist/builder_linux_amd64_v1/Dockerfile
|
|
@cp -v cmd/fetcher/Dockerfile dist/fetcher_linux_amd64_v1/Dockerfile
|
|
@cp -v cmd/fission-bundle/Dockerfile dist/fission-bundle_linux_amd64_v1/Dockerfile
|
|
@cp -v cmd/reporter/Dockerfile dist/reporter_linux_amd64_v1/Dockerfile
|
|
@cp -v cmd/preupgradechecks/Dockerfile dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
|
|
@find dist/ -name 'Dockerfile' -exec sed -i.bak 's|$$TARGETPLATFORM/||g' {} +; find dist/ -name 'Dockerfile.bak' -delete
|
|
|
|
skaffold-deploy: skaffold-prebuild
|
|
skaffold run -p $(SKAFFOLD_PROFILE)
|
|
|
|
### Release
|
|
release:
|
|
@./hack/generate-helm-manifest.sh $(VERSION)
|
|
@./hack/release.sh $(VERSION)
|
|
@./hack/release-tag.sh $(VERSION)
|
|
@./hack/changelog.sh
|