title: Angularjs + grunt + bower + Gitlab CI. Setup for testing
body: <p>I've a GitLab CI runner that runs every time I push code in my branch. 
  The problem is: I use npm+bower to have all dependencies I need, but I don't want to download all dependencies for each test: it's a waste of network and time.</p>
  
  <p>So I came up with this script. Does it make any sense?</p>
  
  <pre><code>touch ~/.bash_profile
  npm config set prefix ~/npm
  export PATH="~/npm/bin:$PATH"
  source ~/.bash_profile
  npm install
  rm -f ~/bower/bower.json
  cp bower.json ~/bower
  pushd ~/bower
  bower update
  bower install
  popd
  mkdir bower_components
  cp -r ~/bower/bower_components bower_components
  grunt test
  </code></pre>
  
  <p>Anyway, a problem I'm facing is it always goes on timeout with bower:</p>
  
  <pre><code>bower angular-cookies#1.2.16                  ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/angular/bower-angular-cookies.git", exit code of #128 fatal: unable to connect to github.com: github.com[0: 192.30.252.128]: errno=Connection timed out
  </code></pre>
  
  <p>Also, it didn't finish once, so I'm not sure, but it seems it re-download all packages every time.</p>
  
  <p>I tried to search on the net, but I didn't find anything. There is a way to achieve what I'm trying to achieve? (Also with a completely different strategy. I also have ssh access to the runner)</p>