forked from argoproj-labs/argocd-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 1.25 KB
/
Makefile
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
VERSION?=$(shell cat VERSION)
IMAGE_TAG?=v$(VERSION)
IMAGE_PREFIX?=argoprojlabs
DOCKER_PUSH?=false
.PHONY: test
test:
go test ./... -coverprofile=coverage.out -race
.PHONY: lint
lint:
golangci-lint run
.PHONY: catalog
catalog:
go run github.com/argoproj-labs/argocd-notifications/hack/gen catalog
go run github.com/argoproj-labs/argocd-notifications/hack/gen docs
.PHONY: manifests
manifests:
kustomize build manifests/controller > manifests/install.yaml
kustomize build manifests/bot > manifests/install-bot.yaml
.PHONY: generate
generate: manifests catalog
go generate ./...
.PHONY: build
build:
ifeq ($(RELEASE), true)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ./dist/argocd-notifications-linux-amd64 ./cmd
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o ./dist/argocd-notifications-darwin-amd64 ./cmd
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o ./dist/argocd-notifications-windows-amd64.exe ./cmd
else
CGO_ENABLED=0 go build -ldflags="-w -s" -o ./dist/argocd-notifications ./cmd
endif
.PHONY: image
image:
docker build -t $(IMAGE_PREFIX)/argocd-notifications:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)/argocd-notifications:$(IMAGE_TAG) ; fi