-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·60 lines (51 loc) · 961 Bytes
/
run.sh
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
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
#!/bin/sh
build() {
mvn clean install -Dmaven.test.skip=true || exit 1
docker build -t afayes/word-api . || exit 1
}
start() {
docker-compose up
}
stop() {
docker-compose down
}
run() {
build
start
}
push() {
docker push afayes/word-api
docker push afayes/word-api
}
logs() {
docker-compose logs -f
}
case "$1" in
build)
build
;;
start)
start
;;
stop)
stop
;;
run)
run
;;
push)
push
;;
logs)
logs
;;
*)
echo "USAGE: $0 {build|start|stop|run|push}"
echo "build: build the maven project and build the docker image"
echo "start: start the docker containers"
echo "stop: stop the docker containers"
echo "run: build and start"
echo "push: push images to docker hub"
echo "logs: shows output from docker containers"
esac