-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
31 lines (22 loc) · 976 Bytes
/
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
DOCKER_IP=$(shell docker network inspect bridge | jq -r '.[0].IPAM.Config[0].Gateway')
ifeq ($(DOCKER_IP),null)
$(error Cannot detect Docker network IP, please start Docker daemon first)
endif
HOST_NAME ?= $(shell hostname)
DOCKER_HOSTNAME?=$(shell expr "`ping -c 1 $(HOST_NAME)`" : '.*(\(.*\)).*')
DOCKER_SERVER_URL=unix:///var/run/docker.sock
run:
DOCKER_IP=${DOCKER_IP} DOCKER_HOSTNAME=${DOCKER_HOSTNAME} DOCKER_SERVER_URL=${DOCKER_SERVER_URL} && docker-compose up
start:
DOCKER_IP=${DOCKER_IP} DOCKER_HOSTNAME=${DOCKER_HOSTNAME} DOCKER_SERVER_URL=${DOCKER_SERVER_URL} && docker-compose up -d
build:
cd jenkins-pipeline && docker build -t jenkins-pipeline .
docker-compose build
cd slave-sbt && docker build -t slave-sbt .
stop:
-docker-compose down
clean: stop
for dockid in $$(docker ps -a -q); do docker rm -f $$dockid; done
for volid in $$(docker volume ls -q); do docker volume rm $$volid; done
restart: stop start
.PHONY: run build clean stop clean