-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage
executable file
·56 lines (53 loc) · 1.54 KB
/
manage
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
#!/bin/bash
case $1 in
"dev")
printf "Initialising laravel project dependencies in a dev environment\n"
composer install
npm install
FILE=.env
if [[ ! -f "$FILE" ]]; then
cp .env.example .env
php artisan key:generate
fi
printf "please open your .env file and change the database credentials if need be \n"
;;
"deploy")
printf "Setting up laravel project for a production environment\n"
composer install --optimize-autoloader --no-dev
FILE=.env
if [[ ! -f "$FILE" ]]; then
printf "You do not have the .env file, generating one for you!\n"
cp .env.example .env
php artisan key:generate
printf "Please edit your .env file accordingly and rerun the deploy command.\n"
exit
fi
npm install
npm run build
php artisan down
rm -r node_modules/
php artisan config:cache
php artisan event:cache
php artisan route:cache
php artisan view:cache
php artisan migrate
php artisan storage:link
php artisan optimize
php artisan up
;;
"clear")
printf "clearing the cached resources of this web app.\n"
php artisan config:clear
php artisan event:clear
php artisan route:clear
php artisan cache:clear
php artisan view:clear
;;
*)
printf "Invalid command\n"
printf "Try\n"
printf "dev --to initialise the project for a dev environment\n"
printf "deploy --to deploy the website to a server. Note: Please consider elevating the rights for reading and writing!\n"
printf "clear --to clear the cache\n"
;;
esac