-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 1.18 KB
/
Makefile
File metadata and controls
49 lines (35 loc) · 1.18 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
# Fetch env variables from .env
include .env.maintenance
# Configuration
LANG := en_US.UTF-8 # `make list` is language sensitive
BINARY := maintenance
IMAGE_NAME := maintenance
DEVELOPER := civilcode
DOCKERHUB_REPO := maintenance
# Targets
list:
@$(MAKE) -pRrq -f $(firstword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
# Deployment is a two step process. See the README for more information.
deploy.push: docker.build docker.push
deploy.release: docker.pull
docker.build:
docker image build --rm --no-cache -t $(DEVELOPER)/$(IMAGE_NAME) .
docker.push:
docker login
docker push $(DEVELOPER)/$(DOCKERHUB_REPO)
docker.pull:
docker pull $(DEVELOPER)/$(DOCKERHUB_REPO)
docker.restart: docker.stop docker.run
docker.run:
docker run --name $(IMAGE_NAME) -d -p $(PORT):80 \
--env-file .env.maintenance \
--restart=unless-stopped \
-v $(shell pwd)/maintenance:/web \
$(DEVELOPER)/$(DOCKERHUB_REPO)
docker.stop:
docker stop $(IMAGE_NAME)
docker rm --force $(IMAGE_NAME)
docker.log:
docker logs $(IMAGE_NAME)
docker.bash:
docker exec -it $(IMAGE_NAME) bash