Monty Taylor 0cd5075466
Pin to npm4 until npm 5.6.0 comes out
npm5 has an issue uploading tarballs it didn't build. For now, install
npm4 and use that to upload our tarballs.

The fix for https://github.com/npm/npm/issues/16723 should be in 5.6.0
which should allow us to revert this.

Change-Id: I8f633ee2119218799706b47ba3b471dcb04c1253
2017-12-08 17:20:51 -06:00

26 lines
766 B
YAML

# This is not optimized, but allows for getting a version of node in the
# home dir.
- name: Create .npmrc configuration file
template:
dest: "~/.npmrc"
mode: 0400
src: .npmrc.j2
- name: Install NVM
git:
repo: 'https://github.com/creationix/nvm'
dest: '~/.nvm'
version: v0.33.5
- name: Upload tarball to npm
shell:
executable: /bin/bash
cmd: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm install node
nvm use node
# Workaround for https://github.com/npm/npm/issues/16723
npm install npm@4
node_modules/.bin/npm publish --ignore-scripts {{ zuul.executor.work_root }}/artifacts/{{ zuul.project.short_name }}-{{ project_ver }}.tar.gz