-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
50 lines (37 loc) · 1.21 KB
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
GIT_COMMIT := $(shell git rev-list -1 HEAD)
VERSION ?= 0.3
#DOCKER_REPO := quay.io/yeospace/betterdev
DOCKER_REPO := r.getopty.com/betterdev
osx:
cd cmd && go build -ldflags "-X main.Version=$(VERSION) -X main.GitCommit=$(GIT_COMMIT)" -o ../bd
.PHONY: linux
linux:
cd cmd && GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=$(VERSION) -X main.GitCommit=$(GIT_COMMIT)" -o ../linux
install:
cp ./bd ~/bin/bd
chmod +x ~/bin/bd
server:
go run cmd/server.go
build:
bd
upload:
rsync -rap public/* $(DEPLOY_USER)@$(DEPLOY_PATH)
chmod:
ssh kurei@betterdev.link "$(DEPLOY_CMD)"
deploy: build upload chmod
docker:
docker build --platform=linux/amd64 -t ${DOCKER_REPO}:${GIT_COMMIT} .
docker tag ${DOCKER_REPO}:${GIT_COMMIT} ${DOCKER_REPO}:latest
docker push ${DOCKER_REPO}:${GIT_COMMIT}
docker push ${DOCKER_REPO}:latest
k8s-deploy:
kubectl -n opty set image deployment/betterdev betterdev=${DOCKER_REPO}:${GIT_COMMIT}
release: linux docker k8s-deploy
fanout:
export ISSUE
export PROFILE
cat k8s/job.yaml | envsubst | kubectl -n yeo delete -f - || true
cat k8s/job.yaml | envsubst | kubectl -n yeo create -f -
nginx:
docker build -t ${DOCKER_REPO}:static -f Dockerfile-static .
docker push ${DOCKER_REPO}:static