-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 961 Bytes
/
Makefile
File metadata and controls
47 lines (35 loc) · 961 Bytes
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
include config.mk
DESTINATION=${REPO}/${IMAGE}
all: opt build push git
main: opt build-main push-main git-main
ci: opt build-ci push-ci git-ci
opt:
@echo "build options:"
@echo " REPO = ${REPO}"
@echo " IMAGE = ${IMAGE}"
@echo " VERSION = ${VERSION}"
build: build-main build-ci
build-main:
docker build -t ${DESTINATION}:latest main
build-ci:
docker build -t ${DESTINATION}:ci-${VERSION} ci
push: push-main push-ci
push-main:
docker tag ${DESTINATION}:latest ${DESTINATION}:${VERSION}
docker push ${DESTINATION}:latest
docker push ${DESTINATION}:${VERSION}
push-ci:
docker push ${DESTINATION}:ci-${VERSION}
git: git-main git-ci
git-main:
git add -A main
git commit -m "Docker image version ${DESTINATION}:${VERSION}"
git tag ${VERSION}
git push
git push origin ${VERSION}
git-ci:
git add -A ci
git commit -m "Docker image version ${DESTINATION}:ci-${VERSION}"
git tag ci-${VERSION}
git push
git push origin ci-${VERSION}