-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 949 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
# Minimal makefile for containerized SLATE Remote Client
#
# Variables
ENVS = local dev staging prod prod2
IMAGENAME = slate-remote-client
IMAGETAG = local
VERSION="latest"
# Targets
build:
docker build --file ./Dockerfile --build-arg slateclientversion=$(VERSION) --tag $(IMAGENAME):$(IMAGETAG) .
build-nocache:
docker build --file ./Dockerfile --build-arg slateclientversion=$(VERSION) --tag $(IMAGENAME):$(IMAGETAG) --no-cache .
clean:
docker image rm $(IMAGENAME):$(IMAGETAG) -f
$(ENVS): build-nocache
(docker run -it \
-v ${PWD}/work:/work:Z \
--env SLATE_ENV=$@ \
--name $(IMAGENAME)-$@ \
--network="host" \
$(IMAGENAME):$(IMAGETAG)) || \
(echo "Removing old containers....................................................." && \
docker container rm $(IMAGENAME)-$@ && \
docker run -it \
-v ${PWD}/work:/work:Z \
--env SLATE_ENV=$@ \
--name $(IMAGENAME)-$@ \
--network="host" \
$(IMAGENAME):$(IMAGETAG))