-
Notifications
You must be signed in to change notification settings - Fork 4
/
devi
executable file
·76 lines (62 loc) · 2.11 KB
/
devi
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
#!/bin/bash
############################################################
# The Imixs Developer Script
# start, build, hot, setup, deploy
#
############################################################
# Funktion zum Entfernen des '-' Zeichens von einem Parameter
strip_dash() {
echo "$1" | sed 's/^-//'
}
echo " _ _ _ _ "
echo " __| | _____ _(_) | |__ ___| |_ __"
echo " / _\` |/ _ \\ \\ / / | | '_ \\ / _ \\ | \'_ \\"
echo "| (_| | __/\ V /| | | | | | __/ | |_) |"
echo " \__,_|\___| \_/ |_| |_| |_|\___|_| .__/ "
echo " |_| "
echo " Imixs Developer Script..."
echo "_________________________________________"
# Verify params
if [[ "$(strip_dash $1)" == "setup" ]]; then
echo " Dev Setup..."
sudo chmod -R 777 docker/deployments/
echo " starting dev enrvionment..."
mvn clean install -Pdebug
cp ./*-app/target/*.war ./docker/deployments/
docker-compose -f ./docker/docker-compose-dev.yaml up
fi
if [[ "$(strip_dash $1)" == "docker" ]]; then
echo " Buld Docker Image..."
mvn clean install -Pdocker
fi
if [[ "$(strip_dash $1)" == "start" ]]; then
echo " Start Dev Environment..."
docker-compose -f ./docker/docker-compose-dev.yaml up
fi
if [[ "$(strip_dash $1)" == "build" ]]; then
echo " Build and Autodeploy..."
mvn clean install -DskipTests
fi
if [[ "$(strip_dash $1)" == "test" ]]; then
echo " Run JUnit Tests..."
mvn clean test
fi
if [[ "$(strip_dash $1)" == "hot" ]]; then
echo "* Hotdeploy..."
cd *-app
mvn manik-hotdeploy:hotdeploy
cd ..
fi
# Überprüfen, ob keine Parameter übergeben wurden - standard build
if [[ $# -eq 0 ]]; then
echo " Run with ./dev.sh -XXX"
echo " "
echo " -start : start Docker Containers"
echo " -build : build application and redeploy"
echo " -docker : build the Docker image"
echo " -hot : Manik Hotdeploy"
echo " -test : run tests"
echo " -setup : setup dev environment - rebuild docker containers "
echo "_________________________________________"
echo " "
fi