-
Notifications
You must be signed in to change notification settings - Fork 0
/
up_local_servers.sh
75 lines (69 loc) · 1.4 KB
/
up_local_servers.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
#!/bin/bash
download_system_folder () {
git clone https://github.com/devscola/culturaaccesible-system.git
}
download_app_folder () {
git clone https://github.com/devscola/culturaaccesible-app.git
}
close_connection () {
fuser -k 4567/tcp
}
up_bundle_in_system () {
cd culturaaccesible-system
bundle exec rake &
sleep 4
cd ..
}
up_ionic () {
cd culturaaccesible-app
ionic serve --all
cd ..
}
install_bundle_in_system () {
cd culturaaccesible-system
bundle install --path vendor --jobs 3
cd ..
}
install_bundle_in_app () {
cd culturaaccesible-app
bundle install --path vendor --jobs 3
cd ..
}
install_bundle_in_testapp () {
cd test-app
bundle install --path vendor --jobs 3
cd ..
}
install_npm_in_app () {
cd culturaaccesible-app
npm install -f
cd ..
}
if [ ! -d "culturaaccesible-system" ]; then
download_system_folder
fi
if [ ! -d "culturaaccesible-app" ]; then
download_app_folder
fi
if hash docker-compose 2>/dev/null; then
docker-compose build
else
if [ ! -d "culturaaccesible-system/vendor" ]; then
install_bundle_in_system
fi
if [ ! -d "culturaaccesible-app/vendor" ]; then
install_bundle_in_app
install_bundle_in_testapp
install_npm_in_app
fi
if [ ! -d "test-app/vendor" ]; then
install_bundle_in_testapp
fi
fi
if hash docker-compose 2>/dev/null; then
docker-compose up
else
close_connection
up_bundle_in_system
up_ionic
fi