Skip to content

Commit

Permalink
DEVENV: Provide strong feedback when provisioning fails
Browse files Browse the repository at this point in the history
Fixes Github issue #2222 (from pre gerrit/jira days).  Forward
ported at the request of @cbf.

Change-Id: I3fc03fbf74837d7462ceead1a6faa81392c2d3be
Signed-off-by: Greg Haskins <gregory.haskins@gmail.com>
  • Loading branch information
ghaskins committed Aug 23, 2016
1 parent 1d8e305 commit 937039c
Showing 1 changed file with 53 additions and 3 deletions.
56 changes: 53 additions & 3 deletions devenv/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,53 @@ set -e
BASEIMAGE_RELEASE=`cat /etc/hyperledger-baseimage-release`
DEVENV_REVISION=`(cd /hyperledger/devenv; git rev-parse --short HEAD)`

# Install WARNING before we start provisioning so that it
# will remain active. We will remove the warning after
# success
cat <<EOF >/etc/motd
##########################################################
,.-""``""-.,
/ ,:,;;,;, \ DANGER DANGER
\ ';';;';' / WILL ROBINSON...
`'---;;---'`
<>_==""==_<>
_<<<<<>>>>>_
.'____\==/____'.
_____|__ |__| __|______
/C \\\\\\\\ |..| //////// C\
\_C//////// |;;| \\\\\\\\C_/
|____o|##|o____|
\ ___|~~|___ /
'>--------<'
{==_==_==_=}
{= -=_=-_==}
{=_=-}{=-=_}
{=_==}{-=_=}
}~~~~""~~~~{
jgs }____::____{
/` || `\
| || |
| || |
| || |
'-----''-----'
##########################################################
If you see this notice, it means that something is wrong
with your hyperledger/fabric development environment.
Typically this indicates that something failed during
provisioning and your environment is incomplete. Builds,
execution, etc., may not operate as they were intended.
Please review the provisioning log and visit:
https://goo.gl/yqjRC7
for more information on troubleshooting and solutions.
##########################################################
EOF


# Update system
apt-get update -qq

Expand Down Expand Up @@ -101,9 +148,6 @@ sudo chown -R vagrant:vagrant $GOPATH
# Update limits.conf to increase nofiles for RocksDB
sudo cp /hyperledger/devenv/limits.conf /etc/security/limits.conf

# Set our shell prompt to something less ugly than the default from packer
echo "PS1=\"\u@hyperledger-devenv:v$BASEIMAGE_RELEASE-$DEVENV_REVISION:\w$ \"" >> /home/vagrant/.bashrc

# configure vagrant specific environment
cat <<EOF >/etc/profile.d/vagrant-devenv.sh
# Expose the devenv/tools in the $PATH
Expand All @@ -112,3 +156,9 @@ export VAGRANT=1
export CGO_CFLAGS=" "
export CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy"
EOF

# Set our shell prompt to something less ugly than the default from packer
echo "PS1=\"\u@hyperledger-devenv:v$BASEIMAGE_RELEASE-$DEVENV_REVISION:\w$ \"" >> /home/vagrant/.bashrc

# finally, remove our warning so the user knows this was successful
rm /etc/motd

0 comments on commit 937039c

Please sign in to comment.