This repository was archived by the owner on Apr 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·58 lines (46 loc) · 1.43 KB
/
dev.sh
File metadata and controls
executable file
·58 lines (46 loc) · 1.43 KB
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
#!/bin/bash
if [ ! -f ./.env ]
then
cp .env.example .env
cp sera-back/.env.example sera-back/.env
cp sera-front/.env.example sera-front/.env
chmod 755 ./sera-back/.env
chmod 755 ./sera-front/.env
chmod 755 .env
echo ".env file is not found, copying from .env.example, waiting for 5 seconds..."
sleep 5
if [ ! -f ./.env ]
then
echo "copying .env failed, please copy .env.example to .env manually"
exit ;
fi
fi
echo "--- composer install ---"
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd)/sera-back:/opt \
-w /opt \
laravelsail/php81-composer \
composer install --ignore-platform-reqs
#Check if sail folder exists
if [ ! -d ./sera-back/vendor/laravel/sail ]
then
echo "sail folder not found, exiting..."
exit ;
fi
echo "--- launch docker container ---"
./sera-back/vendor/bin/sail up -d --build --force-recreate
./sera-back/vendor/bin/sail artisan key:generate
# On remove le cache de toutes les configurations, des routes, des api, etc.
./sera-back/vendor/bin/sail artisan config:clear
./sera-back/vendor/bin/sail artisan route:clear
#Storage link
./sera-back/vendor/bin/sail artisan storage:link
#Generate l5-swagger
./sera-back/vendor/bin/sail artisan l5-swagger:generate
echo "--- wait for 10 seconds ---"
sleep 10
echo "--- migrate database ---"
./sera-back/vendor/bin/sail artisan migrate:fresh --seed
echo "--- done ---"
echo "visit http://localhost"