forked from nodeshift-archived/centos7-s2i-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 1.07 KB
/
Makefile
File metadata and controls
43 lines (33 loc) · 1.07 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
FROM=centos/s2i-base-centos7
IMAGE_NAME=bucharestgold/centos7-s2i-nodejs
# These values are changed in each version branch
# This is the only place they need to be changed
# other than the README.md file.
include versions.mk
TARGET=$(IMAGE_NAME):$(IMAGE_TAG)
.PHONY: all
all: build squash test
build: Dockerfile s2i contrib
docker build \
--build-arg NODE_VERSION=$(NODE_VERSION) \
--build-arg NPM_VERSION=$(NPM_VERSION) \
-t $(TARGET) .
.PHONY: squash
squash:
if [ -z $(SKIP_SQUASH) ] ; then docker-squash -f $(FROM) $(TARGET) -t $(TARGET); fi
.PHONY: test
test: build
BUILDER=$(TARGET) NODE_VERSION=$(NODE_VERSION) ./test/run.sh
.PHONY: clean
clean:
docker rmi `docker images $(TARGET) -q`
.PHONY: tag
tag:
if [ ! -z $(LTS_TAG) ]; then docker tag $(TARGET) $(IMAGE_NAME):$(LTS_TAG); fi
docker tag $(TARGET) $(IMAGE_NAME):$(NODE_VERSION)
.PHONY: publish
publish: all
echo $(DOCKER_PASS) | docker login -u $(DOCKER_USER) --password-stdin
docker push $(TARGET)
docker push $(IMAGE_NAME):$(NODE_VERSION)
if [ ! -z $(LTS_TAG) ]; then docker push $(IMAGE_NAME):$(LTS_TAG); fi