-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
60 lines (48 loc) · 1.47 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.DEFAULT_GOAL := default
ARTIFACTS := $(shell pwd)/artifacts
BUILD := $(shell pwd)/.build
CONFIGURATION := Release
CLI_PROJECT := src/cloudflare-ddns/cloudflare-ddns.csproj
CLI_TEST_PROJECT := test/CloudflareDDNS.Tests/CloudflareDDNS.Tests.csproj
CLI_TOOL := cloudflare-ddns
RUNTIME := $(shell uname -s | awk '{print tolower($$0)}' | sed "s/darwin/osx/")-x64
.PHONY: default
default: package package.chart
.PHONY: clean
clean:
@rm -rf $(ARTIFACTS)
@rm -rf $(BUILD)
.PHONY: restore
restore:
dotnet restore
dotnet tool restore
.PHONY: restore
build: restore
dotnet build --configuration $(CONFIGURATION) --no-restore $(CLI_PROJECT)
.PHONY: build.docker
build.docker: VERSION:=$(shell dotnet minver -t v -a minor -v e)
build.docker:
echo $(VERSION)
cd $(shell dirname $(CLI_PROJECT)) && \
docker build --build-arg MINVERVERSIONOVERRIDE=$(VERSION) -t cloudflare-ddns:v$(VERSION) .
.PHONY: version
version:
@dotnet minver -t v -a minor -v e
.PHONY: run
run:
dotnet run --project $(CLI_PROJECT) -- --log-level verbose
.PHONY: test
test:
dotnet test $(CLI_TEST_PROJECT) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
.PHONY: package
package: restore build
@echo ""
@echo "\033[0;32mPackaging nuget \033[0m"
@echo "\033[0;32m------------------- \033[0m"
dotnet pack $(CLI_PROJECT) --configuration $(CONFIGURATION) \
--no-build \
--output $(ARTIFACTS) \
--include-symbols
.PHONY: package.chart
package.chart:
helm package chart --destination $(ARTIFACTS)