forked from i-abhinav/OrdersAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·40 lines (29 loc) · 1007 Bytes
/
start.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
#!/bin/bash -e
red=$'\e[1;31m'
green=$'\e[1;32m'
white=$'\e[0m'
source ./src/.env
echo " $red <<<<<< Setting up Docker Environment >>>>>> $white "
docker-compose down && docker-compose up --build -d
echo " $grn <<<<<< Installing Dependencies >>>>>> $blu "
#sleep for 150 seconds
# sudo sleep 150s
vendor_present() {
[ -d /var/www/html/vendor ]
}
echo "Installing/Updating Lumen dependencies (composer)"
if ! vendor_present; then
# composer install
docker exec ${APP_NAME}_php composer install
echo "Dependencies installed"
else
# composer update
docker exec ${APP_NAME}_php composer update
echo "Dependencies updated"
fi
docker exec ${APP_NAME}_php chmod -R 777 /var/www/html/storage
echo " $red <<<<<< Running Migrations & Data Seeding >>>>>> $white "
docker exec ${APP_NAME}_php php artisan migrate
docker exec ${APP_NAME}_php php artisan db:seed
echo " $red <<<<<< Running All Test Cases >>>>>> $white "
docker exec ${APP_NAME}_php ./vendor/bin/phpunit