-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (54 loc) · 1.63 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
61
62
63
64
65
66
67
68
69
70
71
72
export LANGUAGES := go
.DEFAULT_GOAL := all
# TAG := $(shell date '+%Y-%m-%dT%H-%M-%SZ')
.PHONY: clean
clean:
rm -f go.sum
rm -f bin/*
.PHONY: dependencies
dependencies:
go mod tidy
go mod vendor
.PHONY: format
format: dependencies
golangci-lint run --fix
.PHONY: utest
utest: dependencies
go test -v ./...
.PHONY: build
build: dependencies
go build -o bin/
ln -sf bin/homeServer homeServer
.PHONY: all
all: clean format utest build
.PHONY: dockerdbg
dockerdbg:
-docker rmi -f home-server-dbg
docker build -t home-server-dbg -f Dockerfile_dbg .
.PHONY: dockerrun
dockerrun:
-docker rm -f home-server-dbg-run
docker run -p 40000:40000 -p 8080:8080 --name home-server-dbg-run home-server-dbg
.PHONY: docker
docker:
-docker rmi -f home-server
docker build -t home-server .
.PHONY: push
push:
az acr login --name hunterhome
docker tag home-server hunterhome.azurecr.io/home-server
docker push hunterhome.azurecr.io/home-server
.PHONY: pushdh
pushdh:
# docker login --username xueweihan
docker tag home-server xueweihan/home-server:0.1.0
docker push xueweihan/home-server:0.1.0
# Create azure app keys (json-auth):
# az ad sp create-for-rbac --name home-rg-deploy-app \
--role contributor \
--scopes /subscriptions/10e43d30-2be8-42eb-8fef-b334040d4cc0/resourceGroups/home-rg \
--json-auth
# az ad sp create-for-rbac --name home-rg-server-app \
--role "Storage Blob Data Contributor" \
--scopes /subscriptions/10e43d30-2be8-42eb-8fef-b334040d4cc0/resourceGroups/home-rg/providers/Microsoft.Storage/storageAccounts/homeserverdata \
--json-auth