-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2246 from manlge/master
add $GOPATH/bin to PATH environment variable for root user.
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ Vagrant.configure("2") do |config| | |
end | ||
|
||
pouch.vm.provision "shell", inline: <<-SHELL | ||
until apt-get update &> /dev/null; do echo "Waiting apt-get for 3 seconds..."; sleep 3; done | ||
until apt-get update; do echo "Waiting apt-get for 3 seconds..."; sleep 3; done | ||
apt-get --no-install-recommends install lxcfs | ||
apt-get --no-install-recommends install curl apt-transport-https ca-certificates software-properties-common | ||
curl -fsSL http://mirrors.aliyun.com/opsx/pouch/linux/debian/[email protected] | apt-key add - | ||
|
@@ -34,18 +34,20 @@ Vagrant.configure("2") do |config| | |
pouch.vm.provision "shell", inline: <<-SHELL | ||
# configring environments for pouch | ||
GO_VERSION=1.9.1 | ||
GOROOT=/opt/go | ||
GOPATH=/root/go | ||
apt-get install -y --no-install-recommends build-essential | ||
wget --progress=bar:force:noscroll https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz -O /tmp/go$GO_VERSION.linux-amd64.tar.gz | ||
tar xf /tmp/go$GO_VERSION.linux-amd64.tar.gz -C /opt/ | ||
echo "export GOROOT=/opt/go" >> ~/.bashrc | ||
echo "export GOROOT=$GOROOT" >> ~/.bashrc | ||
echo "export GOPATH=$GOPATH" >> ~/.bashrc | ||
cd /usr/bin && find /opt/go/bin -type f | xargs -n1 ln -f -s | ||
echo "export PATH=$PATH:$GOROOT/bin:$GOPATH/bin" >> ~/.bashrc | ||
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin | ||
mkdir -p $GOPATH/src/github.com/alibaba | ||
ln -s /vagrant $GOPATH/src/github.com/alibaba/pouch | ||
ln -s -f /vagrant $GOPATH/src/github.com/alibaba/pouch | ||
cd $GOPATH/src/github.com/alibaba/pouch | ||
make PREFIX=/usr install | ||
make && make PREFIX=/usr install | ||
systemctl restart pouch | ||
SHELL | ||
end | ||
|