-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenvironment_setup.sh
More file actions
executable file
·145 lines (114 loc) · 3.42 KB
/
Copy pathenvironment_setup.sh
File metadata and controls
executable file
·145 lines (114 loc) · 3.42 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
#set -e
confirmupdate () {
read -r -p "$1 [y/n]" response
case $response in
[yY])
true
;;
*)
false
;;
esac
}
xcode_path=`xcode-select -p`
echo ""
echo "Sets up the standard ThinkShout development environment."
echo ""
echo "There's no UNDO for this script, so please double check the prereqs now:"
echo "- Required: OSX 10.15 Catalina or higher"
echo "- Required: An active internet connection"
echo ""
if ! confirmupdate "Would you like to proceed?"; then
exit
fi
echo "Starting setup... which will install your environment or update it."
# Check Homebrew is installed.
brew_installed=`which brew`
if [ "$brew_installed" == "" ] ; then
echo $'\n'
echo "Installing Homebrew."
echo $'\n'
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew doctor
fi
echo "Downloading Homebrew standard bundle."
if [ ! -d ~/ts_environment ] ; then
git clone -b contractors https://github.com/thinkshout/ts_environment.git ~/ts_environment
fi
cd ~/ts_environment; git checkout contractors && git pull
if confirmupdate "Would you like to proceed?"; then
echo "Starting setup..."
else
exit
fi
# Install everything in the *minimal* Brewfile
brew bundle --file=Brewfile-minimal
if confirmupdate "Would you like to install the minimal local development--nginx, MariaDB, dnsmasq, etc?"; then
echo $'\n'
echo 'Installing local development environment...'
brew bundle --file=Brewfile-dev-minimal
# Set some standard git configuration
git config --global pull.rebase true
export PATH=./vendor/bin:~/.composer/vendor/bin:/usr/local/bin:/usr/local/sbin:$PATH
# installed=`ls ~/.oh-my-zsh | grep -i 'oh-my-zsh'`
# if [ "$installed" == "" ] ; then
# echo $'\n'
# echo ' Installing Oh My ZSH'
# echo $'\n'
#
# curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
#
# echo "export PATH=./vendor/bin:~/.composer/vendor/bin:/usr/local/bin:/usr/local/sbin:$PATH" >> ~/.zshrc
#
# mkdir -pv ~/.oh-my-zsh/custom
# cp config/ts.zsh ~/.oh-my-zsh/custom/ts.zsh
# fi
# Configure MariaDB by copying remote config file to local system.
cp config/ts.cnf $(brew --prefix)/etc/my.cnf.d/ts.cnf
brew services restart mariadb
source scripts/nginx.sh
sudo cp config/co.echo.httpdfwd.plist /Library/LaunchDaemons/
sudo launchctl load -Fw /Library/LaunchDaemons/co.echo.httpdfwd.plist
source scripts/php.sh
echo $'\n'
echo "Configuring Frontend tools with Ruby and Rbenv"
echo $'\n'
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi'>> ~/.zshrc
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi'>> ~/.bashrc
rbenv install 2.6.5
rbenv global 2.6.5
installed=`which bundler`
if [ "$installed" == "" ] ; then
echo $'\n'
echo "Installing Bundler"
echo $'\n'
~/.rbenv/shims/gem install bundler
fi
installed=`which grunt`
if [ "$installed" == "" ] ; then
echo $'\n'
echo 'Installing Grunt'
echo $'\n'
npm install -g grunt-cli
fi
installed=`which gulp`
if [ "$installed" == "" ] ; then
echo $'\n'
echo 'Installing gulp'
echo $'\n'
npm install --global gulp-cli
fi
installed=`which compass`
if [ "$installed" == "" ] ; then
echo $'\n'
echo 'Installing Compass'
echo $'\n'
~/.rbenv/shims/gem install compass
fi
echo $'\n'
echo "Dev environment setup complete"
echo $'\n'
fi
exit