title: "bower install" failing on jenkins, but runs well through command line
body: <h2>I'm getting error "Permission denied (publickey)." when I'm doing shell command in jenkins:</h2>
  
  <pre><code>export PATH="/usr/local/bin:$PATH"
  echo $PATH
  
  npm install
  bower cache clean
  bower install
  </code></pre>
  
  <hr>
  
  <p>I'm connecting through SSH to private git repo in STASH.
  My code is failing on <strong>random</strong> custom dependencies in "bower install".
  I did all jenkins-stash ssh configuration like <a href="https://wiki.csiro.au/display/ASC/Connecting+Jenkins+to+Stash" rel="nofollow">https://wiki.csiro.au/display/ASC/Connecting+Jenkins+to+Stash</a> </p>
  
  <h2>Here is exact error what I'm getting:</h2>
  
  <pre><code>.
  bower bootstrap#~3.3.4                                                  extract  archive.tar.gz
  bower bootstrap#~3.3.4                                              resolved git://github.com/twbs/bootstrap.git#3.3.5
  bower backbone#~1.2.0                                                extract archive.tar.gz
  bower backbone#~1.2.0                                               resolved git://github.com/jashkenas/backbone.git#1.2.3
  bower custom-theme#*                                     ECMDERR Failed to execute "git ls-remote --tags --heads ssh://git@stash.companyName:7999/cpui/custom-theme.git", exit code of #128 Permission denied (publickey). fatal: Could not read from remote repository.  Please make sure you have the correct access rights and the repository exists.
  
  Additional error details:
  Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  
  npm ERR! Darwin 14.5.0
  npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
  npm ERR! node v4.2.2
  npm ERR! npm  v2.14.7
  npm ERR! code ELIFECYCLE
  npm ERR! another-custom-theme@0.1.56 postinstall: `bower cache clean &amp;&amp; bower install &amp;&amp; grunt copy:hooks`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the another-custom-theme@0.1.56 postinstall script 'bower cache clean &amp;&amp; bower install &amp;&amp; grunt copy:hooks'.
  npm ERR! This is most likely a problem with the another-custom-theme package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     bower cache clean &amp;&amp; bower install &amp;&amp; grunt copy:hooks
  npm ERR! You can get their info via:
  npm ERR!     npm owner ls another-custom-theme
  npm ERR! There is likely additional logging output above.
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /Users/Shared/Jenkins/Home/jobs/CUSTOM_TEST/workspace/npm-debug.log
  Build step 'Execute shell' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <hr>
  
  <p>The only notice, that everything is OK if I'm running all that commands from command line directly.</p>
  
  <p>Thanks!</p>