-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsinthoma.sh
90 lines (74 loc) · 1.95 KB
/
sinthoma.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh
#Base path
APP_HOME=`pwd`
echo
# Output colors
NORMAL='\033[0;39m'
RED='\033[1;31m'
BLUE='033[1;34m'
log() {
echo "$BLUE > $1 $NORMAL"
}
error() {
echo ""
echo "$RED >>> ERROR - $1$NORMAL"
}
up() {
log "Building and starting services"
docker-compose up
}
down() {
docker-compose down
}
start() {
log "Starting services"
docker-compose start
}
stop() {
log "Stopping services"
docker-compose stop
}
top() {
docker-compose top
}
remove() {
log "Removing previous container $CONTAINER_NAME" && \
docker rm -f $CONTAINER_NAME &> /dev/null || true
}
build() {
log "Building services"
user_manager
if [[ "$?" -ne 0 ]] ; then
error "Docker image build failed!"; exit 100
fi
}
user_manager() {
log "User Manager Docker image install started"
cd $APP_HOME/service/user-manager
sh mvnw clean package -Prelease
if [[ "$?" -ne 0 ]] ; then
error "User Manager API Docker image install failed!"; exit 101
fi
log "User Manager Docker image install completed"
}
help() {
echo "-----------------------------------------------------------------------"
echo " Available commands -"
echo "-----------------------------------------------------------------------"
echo -e -n "$BLUE"
echo " > build - To build the Docker image"
echo " > npm - To install NPM modules/deps"
echo " > bower - To install Bower/Js deps"
echo " > jkbuild - To build Jekyll project"
echo " > grunt - To run grunt task"
echo " > jkserve - To serve the project/blog on 127.0.0.1:4000"
echo " > install - To execute full install at once"
echo " > stop - To stop main jekyll container"
echo " > start - To start main jekyll container"
echo " > bash - Log you into container"
echo " > remove - Remove main jekyll container"
echo " > help - Display this help"
echo -e -n "$NORMAL"
echo "-----------------------------------------------------------------------"
}
$*