-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
78 lines (59 loc) · 1.5 KB
/
install.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
#!/bin/sh
# functions
setup(){
case $freshInstall in
y|Y)
echo "Setup project...";;
*)
echo "Setup existing project...";;
esac
# update folder permissions
echo "Updating folder permissions..."
sudo chmod -R 775 storage/ bootstrap/cache/ vendor/
# install composer dependency
case $freshInstall in
y|Y)
echo "Skip install composer dependencies...";;
*)
echo "Installing composer dependencies..."
composer install
# copy .env.example to .env
echo "Setup .env"
cp .env.example .env
# update permissions for .env
sudo chmod 777 .env ;;
esac
# start application installation process
php artisan application:install
php artisan migrate
php artisan db:seed
# Install node dependency
# npm install
}
removeInstall(){
rm -r laravel-app
}
install(){
echo "Starting fresh install of laravel application...";
composer create-project laravel/laravel laravel-app
mv laravel-app/* .
mv laravel-app/.[!.]* .
pwd
# make install application command
php artisan make:command InstallApplication
cp installation/InstallApplication.php app/Console/Commands/
setup "$freshInstall"
# remove installation folder
removeInstall
}
serve(){
php artisan serve
}
# start script
read -p "Start with fresh installation? [y,n] (Default n): " freshInstall
case $freshInstall in
y|Y) install $freshInstall;;
*) setup;;
esac
# serve application
serve