-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun
executable file
·87 lines (69 loc) · 3.31 KB
/
run
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
#!/bin/bash
# Colors
NC='\033[0m'
BBlue='\033[1;34m'
BRed='\033[1;33m'
function uppercase() {
local TEXT=$1
echo $(echo $TEXT | tr '[a-z]' '[A-Z]')
}
echo "\n${BRed}Are you planning to use the Laravel Sail? (Y/y for yes or anything else for no)${NC}"
read LARAVELSAIL
LARAVELSAIL=$(uppercase $LARAVELSAIL)
if [ "$LARAVELSAIL" == "Y" ]; then
echo "\n${BRed}Do you want to install the Laravel Sail? (Y/y for yes or anything else for no)${NC}"
read INSTALLSAIL
INSTALLSAIL=$(uppercase $INSTALLSAIL)
if [ "$INSTALLSAIL" == "Y" ]; then
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/laravel-sail)"
fi
echo "\n${BBlue}Initializing Laravel Sail\n${NC}"
./vendor/bin/sail up -d
echo "\n${BBlue}Remember to create the bash alias below\n${NC}"
echo "${BRed}alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'${NC}"
fi
echo "\n${BBlue}Installing Husky Hooks on the \".husky\" folder\n${NC}"
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/hooks/run)"
echo "\n${BRed}Do you want to create the README template? (Y/y for yes or anything else for no)${NC}"
read READMETEMPLATE
READMETEMPLATE=$(uppercase $READMETEMPLATE)
if [ "$READMETEMPLATE" == "Y" ]; then
echo "\n${BBlue}Installing README template${NC}"
curl -s -o README.md "https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/templates/README.md"
fi
if git remote -v | grep -q 'github'; then
echo "\n${BRed}Do you want to create the Pull Request template? (Y/y for yes or anything else for no)${NC}"
read PRTEMPLATE
PRTEMPLATE=$(uppercase $PRTEMPLATE)
if [ "$PRTEMPLATE" == "Y" ]; then
echo "\n${BBlue}Installing .github pull request template${NC}"
curl -s -o .github/pull_request_template.md "https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/templates/pull_request_template.md"
fi
fi
echo "\n${BRed}Do you want to install the PHP verification tools? (Y/y for yes or anything else for no)${NC}"
read PHPPACKAGES
PHPPACKAGES=$(uppercase $PHPPACKAGES)
if [ "$PHPPACKAGES" == "Y" ]; then
echo "\n${BBlue}Installing necessary PHP packages${NC}"
if [ "$LARAVELSAIL" == "Y" ]; then
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/vendor-packages-sail)"
else
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/vendor-packages)"
fi
echo "\n${BBlue}Installing PHP verification tools settings files${NC}"
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/verification-tools/run)"
fi
if git remote -v | grep -q 'github'; then
echo "\n${BBlue}Installing necessary GitHub Actions${NC}"
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/repo-automation/github/run)"
elif git remote -v | grep -q 'bitbucket'; then
echo "\n${BBlue}Installing necessary Bitbucket Pipelines${NC}"
sh -c "$(curl -fsSl https://raw.githubusercontent.com/elitedevsquad/devsquad-setup/master/repo-automation/bitbucket/run)"
fi
echo "\n${BBlue}Installing workspace directory${NC}"
if [ ! -d './workspace' ]; then
mkdir ./workspace
echo "*
!.gitignore" >./workspace/.gitignore
fi
echo "\n${BBlue}All done! 😎\n${NC}"