-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreams-ci.mk
50 lines (38 loc) · 1.36 KB
/
streams-ci.mk
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
# This make file is intended for an override for streams
# Check if there is only one directory/group, assume that is the stream name
# or if there are more than one, then the stream name needs to be specified
DOCKERMK := $(shell if [ ! -e docker-ci.mk ]; then \
wget -N -q https://raw.githubusercontent.com/full360/docker-ci/master/docker-ci.mk; fi)
include docker-ci.mk
getstreams:
ifeq "$(words $(GROUPS))" "1"
BUILDARGS = "STREAM_NAME=$(firstword $(GROUPS))"
STREAM_NAME = $(firstword $(GROUPS))
CONTAINER_NAME = $(firstword $(GROUPS))
else
ifndef STREAM_NAME
$(warning You must specify the stream name you are building if there are multiple streams)
$(warning e.g. STREAM_NAME=somestream make build)
BUILDARGS = "STREAM_NAME=$(STREAM_NAME)"
CONTAINER_NAME = $STREAM_NAME
endif
endif
# override the targets (so it only builds the particular stream)
# with this override, docker-ci.mk does not have to change for this
# stream specific functionality
build: ;
build: build-$(STREAM_NAME) getstreams
tag: ;
tag: tag-$(STREAM_NAME) getstreams
push: ;
push: push-$(STREAM_NAME) getstreams
.PHONY: plan-nomad
plan-nomad:
@for x in $(NOMAD_JOBS); do \
nomad-helper.sh plan $(CURDIR)/ogs-consumer/nomad/$$x.nomad; \
done
.PHONY: deploy-nomad
deploy-nomad:
@for x in $(NOMAD_JOBS); do \
nomad-helper.sh run $(CURDIR)/ogs-consumer/nomad/$$x.nomad; \
done