-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (56 loc) · 2.02 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
65
66
67
68
################################################################################
# start / stop / prepare
################################################################################
init:
npm install
################################################################################
# releases
################################################################################
# patches a version
patch:
npm run release:patch
# minor up
minor:
npm run release:minor
# major up
release:
npm run release
################################################################################
# docker building stuff
################################################################################
# you have to know what you're doing if your using this ;)
RUBY_VERSION=2.5.5
NODE_VERSION=12.16.0
PG_MAJOR=10
DEBIAN_VERSION_NAME=buster
BUNDLER_VERSION=1.17.3
REGISTRY=talentplatforms/ruby-node
VCS_URL=https://github.com/talentplatforms/ruby-node
# DO NOT OVERRIDE!
_BUILD_DATE=$(shell echo $$(date -u +'%Y-%m-%dT%H:%M:%SZ'))
_VCS_REF=$(shell echo $$(git rev-parse --verify HEAD))
_IMAGE_LATEST=${REGISTRY}:latest
_IMAGE_TAGGED=${REGISTRY}:ruby-${RUBY_VERSION}-node-${NODE_VERSION}-slim-${DEBIAN_VERSION_NAME}
# builds the image and tags it with the latest tag and the more specific tag defined in _IMAGE_TAGGED
build:
docker build \
--rm \
--build-arg RUBY_VERSION=${RUBY_VERSION} \
--build-arg NODE_VERSION=${NODE_VERSION} \
--build-arg PG_MAJOR=${PG_MAJOR} \
--build-arg DEBIAN_VERSION_NAME=${DEBIAN_VERSION_NAME} \
--build-arg BUNDLER_VERSION=${BUNDLER_VERSION} \
--build-arg BUILD_DATE=${_BUILD_DATE} \
--build-arg VCS_URL=${VCS_URL} \
--build-arg VCS_REF=${_VCS_REF} \
--build-arg BUILDKIT_INLINE_CACHE=1 \
-t ${_IMAGE_LATEST} \
-t ${_IMAGE_TAGGED} \
.
# pushes the tagged image to the registry
# if no variables are set, it uses the defaults
push:
docker push ${_IMAGE_LATEST}
docker push ${_IMAGE_TAGGED}
# make NODE_VERSION=13.10.1 build push
# -> registry.gitlab.com/talentplatforms-territory/docker/node-frontend:13.10.1-alpine3.11