-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
59 lines (46 loc) · 1.28 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
#!/bin/sh
cd api
FILE=.env
if [ ! -f "$FILE" ]; then
echo 'Creating .env file...'
cp .env.example .env
fi
FILE=packages/marvel/stubs
if [ ! -h "$FILE" ]; then
echo "Creating stubs..."
cp -R packages/marvel/stubs-backup packages/marvel/stubs
fi
echo "Building docker image..."
docker build -t="redq/php74-composer" .
echo "Installing composer dependencies..."
docker run --rm \
-v $(pwd):/opt \
-w /opt \
redq/php74-composer:latest \
composer install
echo "Stopping running sail container if any..."
./vendor/bin/sail down
echo "Starting app container..."
./vendor/bin/sail up -d
echo "Generating application key..."
./vendor/bin/sail artisan key:generate
sleep 30 & PID=$! #simulate a long process
echo "Processing please be patient..."
printf "["
# While process is running...
while kill -0 $PID 2> /dev/null; do
printf "▇"
sleep 1
done
echo "]"
echo "Installing marvel dependncies..."
./vendor/bin/sail artisan marvel:install
FILE=public/storage
if [ ! -h "$FILE" ]; then
echo "Linking storage path..."
./vendor/bin/sail artisan storage:link
fi
echo "Installation successfull!"
echo "- GraphQL Playground Endpoint: http://localhost/playground"
echo "- Graphql Endpoint: http://localhost/graphql"
echo "- REST Endpoint: http://localhost/"