-
Notifications
You must be signed in to change notification settings - Fork 85
/
.vagrant-provision.sh
49 lines (38 loc) · 1.09 KB
/
.vagrant-provision.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
#!/usr/bin/env bash
set -o errexit
main() {
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
sudo apt update -y
sudo apt install -y \
build-essential \
git \
redis-tools
if ! gimme version; then
curl -sSL \
-o /usr/local/bin/gimme \
https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
chmod +x /usr/local/bin/gimme
fi
sudo -u vagrant HOME=/home/vagrant bash -c 'gimme 1.8.3'
if ! docker version; then
curl -sSL https://get.docker.io | sudo bash
fi
docker run -d -p 5672:5672 --name rabbitmq rabbitmq:3-management
docker run -d -p 6379:6379 --name redis redis
cat >/home/vagrant/.bash_profile <<EOF
export PATH="\$HOME/bin:\$HOME/go/bin:\$PATH"
export GOPATH="\$HOME/go"
eval "\$(gimme 1.8.3)"
set -o vi
EOF
chown vagrant:vagrant /home/vagrant/.bash_profile
chown -R vagrant:vagrant /home/vagrant/go
sudo -u vagrant HOME=/home/vagrant bash <<EOBASH
source \$HOME/.bash_profile
go get github.com/FiloSottile/gvt
go get -u github.com/alecthomas/gometalinter
gometalinter --install || echo look whatever OK
EOBASH
}
main "$@"