Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 1.36 KB
/
Copy pathMakefile
File metadata and controls
69 lines (56 loc) · 1.36 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: dep
dep:
@ go mod tidy && go mod verify
.PHONY: test
test:
@ go test -race ./...
.PHONY: cover
cover:
@ mkdir -p tmp
@ go test -coverprofile=./tmp/cover.out ./...
@ go tool cover -html=./tmp/cover.out
.PHONY: lint
lint: go-lint yamllint ansible-lint
.PHONY: go-lint
go-lint:
@ echo '----------------'
@ echo 'Running golangci-lint'
@ echo '----------------'
@ golangci-lint run --fix && echo OK
.PHONY: yamllint
yamllint:
@ echo '----------------'
@ echo 'Running yamllint'
@ echo '----------------'
@ yamllint --format colored --strict ./playbook.yml && echo OK
.PHONY: ansible-lint
ansible-lint:
@ echo '--------------------'
@ echo 'Running ansible-lint'
@ echo '--------------------'
@ ansible-lint -q ./playbook.yml && echo OK
.PHONY: config-diff
config-diff:
@ bash -c 'diff <(ansible-vault decrypt --output - config.yaml.vault) config.yaml || true'
.PHONY: config-encrypt
config-encrypt:
@ ansible-vault encrypt --output config.yaml.vault config.yaml
.PHONY: config-decrypt
config-decrypt:
@ ansible-vault decrypt --output config.yaml config.yaml.vault
.PHONY: build
build:
@ go build -o ./bin/feed-bot .
.PHONY: run
run:
@ ./bin/feed-bot
.PHONY: docker
docker:
@ docker build -t ghcr.io/tetafro/feed-bot .
.PHONY: deploy
deploy:
@ ansible-playbook \
--become \
--private-key ~/.ssh/id_ed25519 \
--inventory 'www,' \
./playbook.yml