forked from oliviabarrick/fluxcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (17 loc) · 925 Bytes
/
Makefile
File metadata and controls
22 lines (17 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: test build release
%-release:
@echo -e "Release $$(DRYRUN=1 git semver $*):\n" > /tmp/CHANGELOG
@echo -e "$$(git log --pretty=format:"%h (%an): %s" $$(git describe --tags --abbrev=0 @^)..@)\n" >> /tmp/CHANGELOG
@cat /tmp/CHANGELOG CHANGELOG > /tmp/NEW_CHANGELOG
@mv /tmp/NEW_CHANGELOG CHANGELOG
@sed -i 's#image: justinbarrick/fluxcloud:.*#image: justinbarrick/fluxcloud:$(shell DRYRUN=1 git semver $*)#g' examples/fluxcloud.yaml
@sed -i 's#image: justinbarrick/fluxcloud:.*#image: justinbarrick/fluxcloud:$(shell DRYRUN=1 git semver $*)#g' examples/flux-deployment-sidecar.yaml
@git add CHANGELOG examples/fluxcloud.yaml examples/flux-deployment-sidecar.yaml
@git commit -m "Release $(shell DRYRUN=1 git semver $*)"
@git semver $*
test:
test -z $(shell gofmt -l ./cmd/ ./pkg/)
go test ./...
build:
gofmt -w ./cmd ./pkg
CGO_ENABLED=0 go build -ldflags '-w -s' -installsuffix cgo -o fluxcloud ./cmd/