/
talk
executable file
·68 lines (53 loc) · 1.5 KB
/
talk
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
#!/bin/bash
if ! [ -x "$(command -v docker)" ]; then
echo 'Error: docker is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v docker-compose)" ]; then
echo 'Error: docker-compose is not installed.' >&2
exit 1
fi
if [ $# -eq 0 ]; then
echo "No command found"
exit
fi
if [ $1 == "ready" ]; then
if [ -e .env ]
then
echo ".env is already exists"
else
echo "Making .env file ..."
cp .env.example .env
fi
source .env
if [ -e docker-compose.yml ]
then
echo "docker-compose.yml is already exists"
else
echo "Making docker-compose.yml file ..."
cp docker-compose.yml.example docker-compose.yml
fi
COMPOSE="docker-compose -f docker-compose.yml"
echo "Setting permission for docker/php/init.sh ..."
chmod a+x docker/php/init.sh
echo "Build and Run docker images ..."
$COMPOSE up -d --build
echo "Resolve dependencies ..."
$COMPOSE exec app composer install
echo "Migrating database and run seed ..."
$COMPOSE exec app php artisan migrate --seed
echo "Talk Example project is ready to use"
echo "Thank you"
fi
if [ $1 == "about" ]; then
echo "Developed By - Nahid Bin Azhar"
echo "Email - nahid.dns@gmail.com"
echo "Repo Link - https://github.com/nahid/talk-example"
echo "Talk Repo Link - https://github.com/nahid/talk"
fi
if [ $1 == "example" ]; then
open https://github.com/nahid/talk-example
fi
if [ $1 == "go" ]; then
open https://github.com/nahid/talk
fi