-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_dev.sh
executable file
·99 lines (84 loc) · 2.94 KB
/
build_dev.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
91
92
93
94
95
96
97
98
99
#!/usr/bin/env bash
file="already.build"
if [ -f "$file" ]
then
echo "Continuando..."
sleep 1s
echo "Continuando...."
sleep 1s
echo "Continuando....."
sleep 1s
echo "Clonando Base de Datos"
wget https://git.stp.gov.py/dis/docker-files/raw/master/sql/spr.sql.gz -O files/pgalpine/sql/spr.sql.gz
wget https://git.stp.gov.py/dis/docker-files/raw/master/sql/tablero.sql.gz -O files/pgalpine/sql/tablero.sql.gz
echo "Clonando repositorios"
cd repos
git clone https://github.com/stppy/tcp
git clone https://github.com/stppy/spr
line_old='<outputDirectory>/usr/share/tomcat/webapps</outputDirectory>'
line_new='<outputDirectory>../webapps</outputDirectory>'
sed -i "s%$line_old%$line_new%g" ./tcp/pom.xml
sed -i "s%$line_old%$line_new%g" ./spr/pom.xml
echo "Compilando Tablero."
cd tcp
echo "Compilando Tablero.."
sleep 1s
echo "Compilando Tablero..."
mvn install
echo "Compilando SPR."
cd ../spr
sleep 1s
echo "Compilando SPR.."
echo "Compilando SPR..."
mvn install
cd ../..
echo "Iniciando entorno."
sleep 1s
echo "Iniciando entorno.."
sleep 1s
echo "Iniciando entorno..."
./run.sh
else
echo -n "Por favor seleccione su sistema operativo: Ubuntu (u), Centos (c): "
read so
case $so in
[uU])
echo "Ubuntu"
echo "Configurando $JAVA_HOME.."
sudo cp ./javau.sh /etc/profile.d/java.sh
source /etc/profile.d/java.sh
sudo apt-get -y install openjdk-8-jdk openjdk-8-jre maven wget gzip
;;
[cC])
echo "Configurando $JAVA_HOME.."
sudo cp ./javac.sh /etc/profile.d/java.sh
source /etc/profile.d/java.sh
echo "Centos";
sudo yum -y install java-1.8.0-openjdk maven wget gzip
echo "Requerimientos Instalados! Continuando...."
;;
*) echo "Entrada no valida"
;;
esac
echo "Descargando DOCKER...."
curl -fsSL https://get.docker.com/ | sh
echo "Iniciando el servicio de DOCKER...."
sudo service docker start
echo "Dando permisos a tu usuario para usar docker...."
sudo usermod -aG docker $(whoami)
echo "Descargando e instalando DOCKER COMPOSE...."
sudo curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname -s`-`uname -m` -o "/usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
echo "Es necesario reiniciar el equipo y volver a correr el script para continuar."
echo "Desea reiniciar? S/N"
read REPLY
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Ss]$ ]]
then
touch already.build
sudo reboot
else
echo "Se recomienda cerrar y volver a abrir la sesion del usuario actual para poder usar docker"
touch already.build
fi
fi