From 937039c271232b6577c48c0d8c4df1ff4fb444f0 Mon Sep 17 00:00:00 2001 From: Gregory Haskins Date: Fri, 15 Jul 2016 09:37:19 -0400 Subject: [PATCH] DEVENV: Provide strong feedback when provisioning fails Fixes Github issue #2222 (from pre gerrit/jira days). Forward ported at the request of @cbf. Change-Id: I3fc03fbf74837d7462ceead1a6faa81392c2d3be Signed-off-by: Greg Haskins --- devenv/setup.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/devenv/setup.sh b/devenv/setup.sh index 90f54373b04..cd5fc34d21a 100755 --- a/devenv/setup.sh +++ b/devenv/setup.sh @@ -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 </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 @@ -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 </etc/profile.d/vagrant-devenv.sh # Expose the devenv/tools in the $PATH @@ -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