-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
install.sh
executable file
·98 lines (77 loc) · 3.44 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
set -e
reset="\033[0m"
red="\033[31m"
green="\033[32m"
yellow="\033[33m"
cyan="\033[36m"
blue="\033[34m"
white="\033[37m"
printf "$reset\n\n\n"
printf "$green /\ $reset\n"
printf "$green / \__ _____ ___ (_) ___ $reset\n"
printf "$green / /\ \ \ /\ / / _ \/ __| | |/ _ \ $reset\n"
printf "$green / ____ \ V V / __/\__ \ | | (_) |$reset\n"
printf "$green /_/ \_\_/\_/ \___||___/(_)|_|\___/ $reset\n"
printf "$reset\n\n"
printf "$reset\n\n\n"
# if [ ! -e "${PWD}/.env" ]; then
# if [ -z "$1" ]; then
# printf "$white Please create a project on 📦 Package Kit [It's FREE]. Follow the link:$reset$blue https://www.pkgkit.com/awes-io/create $reset\n\n"
# printf "$green> Enter your PKGKIT_CDN_KEY:$reset\n"
# read KEY
# else
# KEY=$1
# fi
# if [ -z "$2" ]; then
# printf "$green> Enter your API-TOKEN:$reset\n"
# read TOKEN
# else
# TOKEN=$2
# fi
# fi
printf "$green> Check chmod for storage directory$reset\n"
chmod -R 777 ./storage
printf "$green> Check bootstrap for storage directory$reset\n"
chmod -R 777 ./bootstrap
printf "$green> Shutdown all current docker demo containers$reset\n"
docker-compose down -v
printf "$green> Docker compose up$reset\n"
docker-compose up -d --build
printf "$green> Remove composer.lock file for getting a new updates$reset\n"
rm -f ./composer.lock
if [ ! -e "${PWD}/.env" ]; then
printf "$green> Create .ENV file from local example$reset\n"
cp .env.docker .env
# printf "$green> Writing PackageKit api token and cdn key$reset\n"
# docker exec -i awes-demo-php bash -c "composer global require awes-io/installer"
# docker exec -i awes-demo-php bash -c "php ~/.composer/vendor/bin/awes-io token -t $TOKEN"
# docker exec -i awes-demo-php bash -c "php ~/.composer/vendor/bin/awes-io key -k $KEY"
fi
printf "$green> Install all dependencies$reset\n"
docker exec -i awes-demo-php bash -c "composer install"
printf "$green> Service commands for Laravel: migration, key generate, cache clear etc $reset\n"
docker exec -i awes-demo-php sh -c "php artisan key:generate && php artisan migrate:fresh --seed && php artisan cache:clear"
# Nice output :)
printf "$reset\n\n\n"
printf "$green /\ $reset\n"
printf "$green / \__ _____ ___ (_) ___ $reset\n"
printf "$green / /\ \ \ /\ / / _ \/ __| | |/ _ \ $reset\n"
printf "$green / ____ \ V V / __/\__ \ | | (_) |$reset\n"
printf "$green /_/ \_\_/\_/ \___||___/(_)|_|\___/ $reset\n"
printf "$reset\n\n"
printf "$white 🙏 Please support us on Patreon:$reset$blue https://www.patreon.com/awesdotio$reset\n"
printf "$white ⭐️ Give thanks star on Github:$reset$blue https://github.com/awes-io$reset\n"
printf "$reset\n"
printf "$cyan | ------------------------------------------------------------------------------ |$reset\n"
printf "$cyan | Server started: http://localhost:5080 (Email: test@test.com Passwd: secret) |$reset\n"
printf "$cyan | PhpMyAdmin: http://localhost:5081 (User: root Passwd: awes) |$reset\n"
printf "$cyan | ------------------------------------------------------------------------------ |$reset\n"
printf "$reset\n"
read -p "Do you want to support us by giving Github star? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
composer thanks
else
printf "$green Please consider to run 'composer thanks' later to thank us$reset\n"
fi