-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
executable file
·52 lines (43 loc) · 1016 Bytes
/
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
# Makefile for building firecares
ORG ?= prominentedgestatengine
REPO ?= firecares
ENVIRONMENT ?= development
SHA=$(shell git rev-parse --short HEAD)
BRANCH=$(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)
TAG=${BRANCH}-${SHA}-${ENVIRONMENT}
.PHONY: build
build:
docker pull $(ORG)/$(REPO):base && \
docker build \
--network=host \
-t $(ORG)/$(REPO):${TAG} \
--no-cache \
.
echo "TAG=${TAG}" > tag.properties
test:
pip install docker-compose
docker-compose down 2>1 || true
docker-compose build
docker-compose up -d
sleep 10
docker exec -it firecares_firecares_1 bash -c "python ./manage.py test --noinput"
docker-compose down
build-base:
docker build \
-f Dockerfile-base \
-t prominentedgestatengine/firecares:base \
--no-cache \
.
echo "TAG=${TAG}" > tag.properties
push:
docker push \
$(ORG)/$(REPO):${TAG}
push-base:
docker push \
prominentedgestatengine/firecares:base
run:
docker run -it \
--rm \
-p 8000:8000 \
--env-file .env.local \
$(ORG)/$(REPO):${TAG}