-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
32 lines (27 loc) · 852 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
32
include .env
default:
# build-swarm-agent:
# Builds a docker image using Dockerfile.java-swarm-agent
# with Java JDK, Maven, Git, and Docker installed
build-swarm-agent:
docker build --rm \
-f dockerfiles/Dockerfile.java-swarm-agent \
-t java-swarm-agent .
# swarm-agent
# Runs the docker image created in build-java-agent above.
# NOTE: Params must exist in .env file
swarm-agent:
docker run -d \
--network=$(SWARM_NETWORK) \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume ${MAVEN_CACHE}:/root/.m2 \
java-swarm-agent \
java -jar swarm-client-3.3.jar \
-master $(SWARM_MASTER) \
-username $(SWARM_USER) \
-password $(SWARM_PASS) \
-executors $(SWARM_EXECUTORS) \
# destroy
# Stops all instances of the java-swarm-agent image that are running
destroy:
docker stop $$(docker ps -q --filter ancestor="java-swarm-agent")