Skip to content

Commit

Permalink
[FAB-7126] Changes Vagrant mount point to hyperledger
Browse files Browse the repository at this point in the history
This changes the main Vagrant mount point to hyperledger to provide
access to all present hyperledger repositories, including
fabric-samples.
This will give access to new repos as they are added without requiring
a modification of the Vagrantfile every time.

Patch-set #1: adds fabric-samples to the list of mounted volumes if it exists
Patch-set #2: fixes commit message
Patch-set #3: changes strategy, mounting the parent directory to be future proof
Patch-set #4: removed unrelated changes committed by error

Change-Id: If126bd9d6d8806f149a0e6bacb1d8d34875f7ba4
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
  • Loading branch information
lehors committed Dec 29, 2017
1 parent c52e9df commit d9e1ac8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
15 changes: 4 additions & 11 deletions devenv/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -x
echo "127.0.0.1 couchdb" | tee -a /etc/hosts
cd #{SRCMOUNT}/devenv
cd #{SRCMOUNT}/fabric/devenv
./setup.sh
SCRIPT
Expand All @@ -39,16 +39,9 @@ Vagrant.configure('2') do |config|
config.vm.network :forwarded_port, guest: 7053, host: 7053, id: "peer_event", host_ip: "localhost", auto_correct: true # fabric peer event service
config.vm.network :forwarded_port, guest: 7054, host: 7054, id: "ca", host_ip: "localhost", auto_correct: true # fabric-ca service
config.vm.network :forwarded_port, guest: 5984, host: 15984, id: "couchdb", host_ip: "localhost", auto_correct: true # CouchDB service
config.vm.synced_folder "..", "#{SRCMOUNT}"
config.vm.synced_folder "..", "/opt/gopath/src/github.com/hyperledger/fabric"
config.vm.synced_folder ENV.fetch('LOCALDEVDIR', ".."), "#{LOCALDEV}"
if File.exist?("../../fabric-ca")
config.vm.synced_folder "../../fabric-ca", "/opt/gopath/src/github.com/hyperledger/fabric-ca"
end
if File.exist?("../../fabric-test")
config.vm.synced_folder "../../fabric-test", "/opt/gopath/src/github.com/hyperledger/fabric-test"
end

config.vm.synced_folder "../..", "#{SRCMOUNT}"
config.vm.synced_folder "../..", "/opt/gopath/src/github.com/hyperledger"
config.vm.synced_folder ENV.fetch('LOCALDEVDIR', "../.."), "#{LOCALDEV}"
config.vm.provider :virtualbox do |vb|
vb.name = "hyperledger"
vb.customize ['modifyvm', :id, '--memory', '4096']
Expand Down
10 changes: 5 additions & 5 deletions devenv/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
set -e
set -x

DEVENV_REVISION=`(cd /hyperledger/devenv; git rev-parse --short HEAD)`
DEVENV_REVISION=`(cd /hyperledger/fabric/devenv; git rev-parse --short HEAD)`

# Install WARNING before we start provisioning so that it
# will remain active. We will remove the warning after
Expand Down Expand Up @@ -81,12 +81,12 @@ curl -sL $GO_URL | (cd $GOROOT && tar --strip-components 1 -xz)
# ----------------------------------------------------------------
# Install nvm and Node.js
# ----------------------------------------------------------------
runuser -l ubuntu -c '/hyperledger/devenv/install_nvm.sh'
runuser -l ubuntu -c '/hyperledger/fabric/devenv/install_nvm.sh'

# ----------------------------------------------------------------
# Install Behave
# ----------------------------------------------------------------
/hyperledger/scripts/install_behave.sh
/hyperledger/fabric/scripts/install_behave.sh

# ----------------------------------------------------------------
# Install Java
Expand Down Expand Up @@ -116,12 +116,12 @@ make clean gotools
sudo chown -R ubuntu:ubuntu $GOPATH

# Update limits.conf to increase nofiles for LevelDB and network connections
sudo cp /hyperledger/devenv/limits.conf /etc/security/limits.conf
sudo cp /hyperledger/fabric/devenv/limits.conf /etc/security/limits.conf

# Configure vagrant specific environment
cat <<EOF >/etc/profile.d/vagrant-devenv.sh
# Expose the devenv/tools in the $PATH
export PATH=\$PATH:/hyperledger/devenv/tools:/hyperledger/build/bin
export PATH=\$PATH:/hyperledger/fabric/devenv/tools:/hyperledger/fabric/build/bin
export VAGRANT=1
export CGO_CFLAGS=" "
EOF
Expand Down

0 comments on commit d9e1ac8

Please sign in to comment.