-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (43 loc) · 1.1 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
include config.env
.PHONY: all
all: build
.PHONY: build
build:
@bin/prepare.sh
@bin/build-docker.sh
.PHONY: deploy
deploy:
cd "$(IN_ROOT)/var/server" && \
docker stack deploy -c docker-swarm.yml intranet
.PHONY: deploy-single
deploy-single:
mkdir -p \
"$(IN_ROOT)/srv/docker-registry" \
"$(IN_ROOT)/srv/drone" \
"$(IN_ROOT)/srv/gogs" \
"$(IN_ROOT)/srv/mirrors" \
"$(IN_ROOT)/srv/registry" \
"$(IN_ROOT)/srv/storage" \
"$(IN_ROOT)/srv/storage/data"
touch "$(IN_ROOT)/srv/storage/database.db" \
&& chown 1000:1000 "$(IN_ROOT)/srv/storage/database.db"
docker node update \
--label-add ci-builder=true \
--label-add ci-server=true \
--label-add docker-registry=true \
--label-add git=true \
--label-add mirrors=true \
--label-add registry=true \
--label-add site=true \
--label-add storage=true \
"$$(hostname)"
@$(MAKE) -s deploy
.PHONY: secrets
secrets:
@bin/secrets.sh || rm -rf "$(IN_ROOT)/etc/letsencrypt"
# Development
srcfiles := $(shell find . -iname "*.sh" -type f)
srcfiles := $(filter-out ./services/%, $(srcfiles))
.PHONY: lint
lint:
shellcheck -s sh $(srcfiles)