forked from cf-container-networking/c2c-workspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·186 lines (137 loc) · 4.74 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/bin/bash
set -e
set -u
function confirm() {
read -r -p "Are you sure? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
return
;;
*)
echo "Bailing out, you said no"
exit 187
;;
esac
}
confirm
cd $(dirname $0)
echo "Install homebrew..."
if [ -z "$(which brew)" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "Run the Brewfile..."
brew update
brew tap Homebrew/bundle
ln -sf $(pwd)/Brewfile ${HOME}/.Brewfile
brew bundle --global
brew bundle cleanup
echo "Updating pip"
pip3 install --upgrade pip
echo "Install python-client for neovim"
pip3 install neovim
echo "Install the plug vim plugin manager..."
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "Symlink the vimrc to .config/nvim/init.vim..."
ln -sf $(pwd)/vimrc ${HOME}/.config/nvim/init.vim
echo "Run the vim plugin install..."
nvim -c "PlugInstall" -c "qall" --headless
echo "Update vim plugins..."
nvim -c "PlugUpdate" -c "qall" --headless
echo "Copy snippets..."
mkdir -p ${HOME}/.vim/UltiSnips
echo "Symlink the go.snippets to .vim/UltiSnips..."
ln -sf $(pwd)/go.snippets ${HOME}/.vim/UltiSnips
echo "Install the vim go binaries..."
nvim -c "GoInstallBinaries" -c "qall!" --headless /tmp/foo.go
echo "Add yamllint for neomake..."
pip3 install -q yamllint
echo "Symlink the git-authors file to .git-authors..."
ln -sf $(pwd)/git-authors ${HOME}/.git-authors
echo "Copy the shared.bash file into .bash_profile"
ln -sf $(pwd)/shared.bash ${HOME}/.bash_profile
echo "Copy the gitconfig file into ~/.gitconfig..."
cp -rf $(pwd)/gitconfig ${HOME}/.gitconfig
echo "Copy the inputrc file into ~/.inputrc..."
ln -sf $(pwd)/inputrc ${HOME}/.inputrc
echo "Link global .gitignore"
ln -sf $(pwd)/global-gitignore ${HOME}/.global-gitignore
echo "link global .git-prompt-colors.sh"
ln -sf $(pwd)/git-prompt-colors.sh ${HOME}/.git-prompt-colors.sh
echo "link global .tmux.conf"
ln -sf $(pwd)/tmux.conf ${HOME}/.tmux.conf
echo "Install ruby 2.3.0..."
rbenv install -s 2.3.0
rbenv global 2.3.0
rm -f ~/.ruby-version
eval "$(rbenv init -)"
echo "Symlink the gemrc file to .gemrc..."
ln -sf $(pwd)/gemrc ${HOME}/.gemrc
echo "Install the bundler gem..."
gem install bundler
echo "Install the bosh cli gem..."
gem install bosh_cli
rbenv rehash
echo "Install the go bosh cli gem..."
go get -u github.com/cloudfoundry/bosh-cli
echo "Cloning colorschemes..."
if [ ! -d ${HOME}/.config/colorschemes ]; then
git clone https://github.com/chriskempson/base16-shell.git "${HOME}/.config/colorschemes"
fi
echo "Ignoring ssh security for ephemeral environments..."
if [ ! -d ${HOME}/.ssh ]; then
mkdir ${HOME}/.ssh
chmod 0700 ${HOME}/.ssh
fi
if [ -f ${HOME}/.ssh/config ]; then
echo "Looks like ~/.ssh/config already exists, overwriting..."
fi
cp $(pwd)/ssh_config ${HOME}/.ssh/config
chmod 0644 ${HOME}/.ssh/config
echo "Setting up spectacle..."
cp -f "$(pwd)/com.divisiblebyzero.Spectacle.plist" "${HOME}/Library/Preferences/"
echo "Creating go/src and workspace..."
go_src=${HOME}/go/src
if [ ! -e ${go_src} ]; then
mkdir -pv ${HOME}/go/src
fi
if [ -L ${go_src} ]; then
echo "${go_src} exists, but is a symbolic link"
fi
workspace=${HOME}/workspace
mkdir -p $workspace
echo "Install bosh-target..."
GOPATH="${HOME}/go" go get -u github.com/kkallday/bosh-target
echo "Install cf-target..."
GOPATH="${HOME}/go" go get -u github.com/dbellotti/cf-target
echo "Install hclfmt..."
GOPATH="${HOME}/go" go get -u github.com/fatih/hclfmt
echo "Install ginkgo..."
GOPATH="${HOME}/go" go get -u github.com/onsi/ginkgo/ginkgo
echo "Install gomega..."
GOPATH="${HOME}/go" go get -u github.com/onsi/gomega
echo "Install counterfeiter..."
GOPATH="${HOME}/go" go get -u github.com/maxbrunsfeld/counterfeiter
echo "Install deployment extractor..."
GOPATH="${HOME}/go" go get -u github.com/kkallday/deployment-extractor
echo "Install bbl..."
GOPATH="${HOME}/go" go get -u github.com/cloudfoundry/bosh-bootloader/bbl
echo "Install spiff"
if [ -z "$(which spiff)" ]; then
wget https://github.com/cloudfoundry-incubator/spiff/releases/download/v1.0.7/spiff_darwin_amd64.zip
unzip spiff_darwin_amd64.zip -d /usr/local/bin
rm spiff_darwin_amd64.zip
fi
echo "Install bosh-init"
if [ -z "$(bosh-init)" ]; then
wget https://s3.amazonaws.com/bosh-init-artifacts/bosh-init-0.0.99-darwin-amd64
mv bosh-init-0.0.99-darwin-amd64 /usr/local/bin/bosh-init
chmod +x /usr/local/bin/bosh-init
fi
echo "Install fly"
if [ -z "$(fly -v)" ]; then
wget https://github.com/concourse/concourse/releases/download/v2.4.0/fly_darwin_amd64
mv fly_darwin_amd64 /usr/local/bin/fly
chmod +x /usr/local/bin/fly
fi
echo "Workstation setup complete, open a new window to apply all settings"