nodejs-install macro can install different versions of node

This patch modifies the nodejs-install macro to install based on the
{version} parameter. All current uses of nodejs-install have been set to use
version '4'.

Change-Id: I73a0c5b801137d8700b16acb8375eaabfb668d5f
This commit is contained in:
Dong Ma
2016-07-05 15:11:55 +08:00
committed by Michael Krotscheck
parent 2c9ce1c3b5
commit cc6c8b6f73
4 changed files with 17 additions and 9 deletions

View File

@@ -50,7 +50,8 @@
builders:
- gerrit-git-prep
- nodejs-install
- nodejs-install:
version: 4
- install-distro-packages
- revoke-sudo
- tox:

View File

@@ -18,7 +18,8 @@
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install
- nodejs-install:
version: 4
- xvfb-install
- chrome-install
- firefox-install
@@ -56,7 +57,8 @@
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install
- nodejs-install:
version: 4
- revoke-sudo
# This will build ./{name}-{version}.tgz, where {version} is read from
@@ -95,7 +97,8 @@
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install
- nodejs-install:
version: 4
- revoke-sudo
# This will build ./{name}-{version}.tgz, where {version} is read from
# package.json.
@@ -147,7 +150,8 @@
builders:
- print-template-name:
template-name: "{template-name}"
- nodejs-install
- nodejs-install:
version: 4
- gerrit-git-prep
- install-distro-packages
- revoke-sudo
@@ -183,7 +187,8 @@
builders:
- print-template-name:
template-name: "{template-name}"
- nodejs-install
- nodejs-install:
version: 4
- gerrit-git-prep
- install-distro-packages
- revoke-sudo

View File

@@ -226,6 +226,7 @@
name: nodejs-install
builders:
- shell: |
#!/bin/bash -eux
# Prerequisites
sudo apt-get update
sudo apt-get install -y apt-transport-https lsb-release curl
@@ -235,8 +236,8 @@
# Install via nodesource
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
echo "deb https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
echo "deb https://deb.nodesource.com/node_{version}.x $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/node_{version}.x $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install -y nodejs

View File

@@ -10,7 +10,8 @@
builders:
- gerrit-git-prep
- install-distro-packages
- nodejs-install
- nodejs-install:
version: 4
- xvfb-install
- chrome-install
- shell: |