-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (53 loc) · 1.33 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
52
53
54
55
56
57
58
59
60
61
62
63
64
BASE_DOCKER_FILE=Dockerfile-base
DOCKER_FILE=Dockerfile
BASE_VERSION=latest
TOP_VERSION=latest
TAG_LATEST=1
MAP_SHINYTEST=0
SECRET_PATH=.mysecret
APP_REGISTRY="docker.artifactory.pnnl.gov/mscviz/freda"
BASE_IMAGE_TAG="${APP_REGISTRY}/base:${BASE_VERSION}"
IMAGE_TAG="${APP_REGISTRY}:${TOP_VERSION}"
MAP_SHINYTEST=2
PROFILE=''
DO_BUILD=false
ifeq ($(DO_BUILD), true)
BUILD_TARGET=build_top
endif
.PHONY: build_base
build_base:
docker build . --secret id=access_tokens,src=${SECRET_PATH} \
-f ${BASE_DOCKER_FILE} \
-t ${BASE_IMAGE_TAG} \
2>&1 | tee build_base.log \
.PHONY: build_top
build_top:
docker build . \
--build-arg base_tag=${BASE_IMAGE_TAG} \
-f ${DOCKER_FILE} \
-t ${IMAGE_TAG} \
2>&1 | tee build_top.log \
.PHONY: build
build: build_base build_top
.PHONY: run
run: ${BUILD_TARGET}
docker compose --profile ${PROFILE} up
.PHONY: login
login:
docker login docker.artifactory.pnnl.gov
.PHONY: push_base
push_base: login
docker push ${BASE_IMAGE_TAG}
@if [ ${TAG_LATEST} = 1 ]; then\
docker tag ${BASE_IMAGE_TAG} "${APP_REGISTRY}/base:latest";\
docker push "${APP_REGISTRY}/base:latest";\
fi
.PHONY: push_top
push_top: login
docker push ${IMAGE_TAG}
@if [ ${TAG_LATEST} = 1 ]; then\
docker tag ${IMAGE_TAG} "${APP_REGISTRY}:latest";\
docker push "${APP_REGISTRY}:latest";\
fi
.PHONY: push
push: push_base push_top