forked from omt-tech/base-docker-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (48 loc) · 1.31 KB
/
Makefile
File metadata and controls
65 lines (48 loc) · 1.31 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
include config.mk
DESTINATION=${REPO}/${IMAGE}
.DEFAULT_GOAL := default
default: build
opt:
@echo "build options:"
@echo " REPO = ${REPO}"
@echo " IMAGE = ${IMAGE}"
@echo " VERSION = ${VERSION}"
all: opt build push git
base: opt build-base push-base git-base
dev: opt build-dev push-dev git-dev
ci: opt build-ci push-ci git-ci
build: build-base build-dev build-ci
build-base:
docker build -t ${DESTINATION}:latest base
docker tag ${DESTINATION}:latest ${DESTINATION}:${VERSION}
build-dev:
docker build -t ${DESTINATION}:dev-${VERSION} dev
build-ci:
docker build -t ${DESTINATION}:ci-${VERSION} ci
push: push-base push-dev push-ci
push-base:
docker push ${DESTINATION}:latest
docker push ${DESTINATION}:${VERSION}
push-dev:
docker push ${DESTINATION}:dev-${VERSION}
push-ci:
docker push ${DESTINATION}:ci-${VERSION}
git: git-base git-dev git-ci
git-base:
git add -A base
git commit -m "Docker image version ${DESTINATION}:${VERSION}"
git tag ${VERSION}
git push
git push origin ${VERSION}
git-dev:
git add -A dev
git commit -m "Docker image version ${DESTINATION}:dev-${VERSION}"
git tag dev-${VERSION}
git push
git push origin dev-${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}