-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
29 lines (22 loc) · 931 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
.PHONY: build nocache bash test run clean
docker_tag = macropin/strider
APP_HOST = localhost
build:
docker build -t $(docker_tag) .
nocache:
docker build --no-cache=true -t $(docker_tag) .
bash:
docker run --rm -it $(docker_tag) bash
test:
./test.sh
run:
$(eval MONGO_ID := $(shell docker run -p 3000:3000 --name strider-mongo -d mongo))
$(eval STRIDER_ID := $(shell docker run --env [email protected] --env STRIDER_ADMIN_PASSWORD=password --name strider-app --link strider-mongo:mongo -d ${docker_tag}))
$(eval STRIDER_IP := $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${STRIDER_ID}))
@echo "Running ${STRIDER_ID} @ http://${STRIDER_IP}:3000"
@echo "Running ${MONGO_ID} MongoDB"
@docker attach ${STRIDER_ID}
@docker kill ${STRIDER_ID} ${MONGO_ID}
@docker rm ${STRIDER_ID} ${MONGO_ID}
clean:
@docker ps -a | grep strider | awk '{ print $$1 }' | xargs -r docker rm -f