Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
ref #4 add node-npm-install node-upgrade-npm
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Sep 14, 2019
1 parent 7974f5a commit 19a6771
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 34 deletions.
35 changes: 25 additions & 10 deletions README.md
Expand Up @@ -29,24 +29,21 @@ sudo: false
language: node_js
os:
- linux
before_install:
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac'
- 'nvm install-latest-npm'
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
node_js:
- '11' # current
- '12' # current release
- '10' # active lts
- '8' # active lts
- '6' # active lts
- '4' # end of life lts
- '8' # maintenance lts
- '6' # end of life
- '4' # end of life
- '0.12' # end of life
- '0.10' # end of life
- '0.8' # end of life
- '0.6' # end of life
matrix:
fast_finish: true
allow_failures:
- node_js: '6'
- node_js: '4'
- node_js: '0.12'
- node_js: '0.10'
- node_js: '0.8'
Expand All @@ -62,6 +59,8 @@ cache:

We provide many premade scripts to accelerate your Travis CI usage. They are available within the [`scripts` directory](https://github.com/bevry/awesome-travis/tree/master/scripts) directory of this repository. Click on each script to see available configuration, and installation instructions.

### Listing

#### [`deploy-custom`](https://github.com/bevry/awesome-travis/blob/master/scripts/deploy-custom.bash)

If the tests succeed on the specified `DEPLOY_BRANCH`, then prepare git for deployment, and then run the `DEPLOY_COMMAND`.
Expand All @@ -78,13 +77,29 @@ If the tests succeed on the specified `DEPLOY_BRANCH`, then deploy with https://

Use the `DESIRED_NODE_VERSION` (defaults to the latest LTS node version) to install dependencies using `SETUP_COMMAND` (defaults to `npm install`).

This is an alternative to the `node-npm-install` script.

#### [`node-npm-install`](https://github.com/bevry/awesome-travis/blob/master/scripts/node-npm-install.bash)

Because the latest npm version that node 0.6 and 0.9 support, doesn't support scoped modules, so it uses node 0.8 to install npm packages and then switches back.

This is an alternative to the `node-install` script.

#### [`node-publish`](https://github.com/bevry/awesome-travis/blob/master/scripts/node-publish.bash)

Use the `DESIRED_NODE_VERSION` (defaults to the latest LTS node version) to login with npm and run `npm publish`.

#### [`node-upgrade-npm`](https://github.com/bevry/awesome-travis/blob/master/scripts/node-upgrade-npm.bash)

Installs the latest supported version of npm for the current node version, using nvm's `install-latest-npm` command.

This is an alternative to the `node-latest-npm` script.

#### [`node-latest-npm`](https://github.com/bevry/awesome-travis/blob/master/scripts/node-latest-npm.bash)

Ensure that the npm version is the latest npm version released.
Installs the latest npm version, using npm's `update` command.

This is an alternative to the `node-upgrade-npm` script.

#### [`node-verify`](https://github.com/bevry/awesome-travis/blob/master/scripts/node-verify.bash)

Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy-custom.bash
Expand Up @@ -3,12 +3,12 @@ set -ueE -o pipefail

# If the tests succeed on the specified `DEPLOY_BRANCH`, then prepare git for deployment, and then run the `DEPLOY_COMMAND`.

# TRAVIS SCRIPT
# SCRIPT
#
# after_success:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/deploy-custom.bash)"

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DEPLOY_BRANCH
# The branch name that you want tested and deployed, set correctly:
Expand All @@ -18,7 +18,7 @@ set -ueE -o pipefail
# The command that will do the compilation and git push:
# travis env set DEPLOY_COMMAND "npm run our:deploy" --public

# EXTERNAL ENVIRONMENT VARIABLES
# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_BRANCH
# TRAVIS_TAG
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy-git.bash
Expand Up @@ -4,12 +4,12 @@ set -ueE -o pipefail
# If the tests succeed on the specified `DEPLOY_BRANCH`, then prepare git for deployment, and then run the `DEPLOY_COMMAND`.
# The `DEPLOY_COMMAND` should be the command responsible for the compilation, git add, git commit, and git push.

# TRAVIS SCRIPT
# SCRIPT
#
# after_success:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/deploy-git.bash)"

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DEPLOY_BRANCH
# The branch name that you want tested and deployed, set correctly:
Expand All @@ -35,7 +35,7 @@ set -ueE -o pipefail
# The email that is used for the deployment commit, set to whatever:
# travis env set DEPLOY_EMAIL "deployer@travis-ci.org" --public

# EXTERNAL ENVIRONMENT VARIABLES
# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_BRANCH
# TRAVIS_TAG
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy-now.bash
Expand Up @@ -3,7 +3,7 @@ set -ueE -o pipefail

# If the tests succeed on the specified `DEPLOY_BRANCH`, then deploy with https://zeit.co/now

# TRAVIS SCRIPT
# SCRIPT
#
# after_success:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/deploy-now.bash)"
Expand All @@ -13,7 +13,7 @@ set -ueE -o pipefail
# You will need to make sure you have now installed as a local dependency,
# using npm: npm install --save-dev now

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DEPLOY_BRANCH
# The branch name that you want tested and deployed (defaults to `master`)
Expand All @@ -27,7 +27,7 @@ set -ueE -o pipefail
# Your now team, if applicable. You can fetch your teams via the `now teams list` command.
# travis env set NOW_TEAM "$NOW_TEAM" --public

# EXTERNAL ENVIRONMENT VARIABLES
# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_BRANCH
# TRAVIS_TAG
Expand Down
4 changes: 2 additions & 2 deletions scripts/node-install.bash
Expand Up @@ -3,12 +3,12 @@ set -ueE -o pipefail

# Use the `DESIRED_NODE_VERSION` (defaults to the latest LTS node version) to install dependencies using `SETUP_COMMAND` (defaults to `npm install`).

# TRAVIS SCRIPT
# SCRIPT
#
# install:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/node-install.bash)"

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DESIRED_NODE_VERSION
# To specify a specific node version (rather tha the LTS version):
Expand Down
4 changes: 2 additions & 2 deletions scripts/node-latest-npm.bash
@@ -1,9 +1,9 @@
#!/bin/bash
set -ueE -o pipefail

# Ensure that the npm version is the latest npm version released.
# Installs the latest npm version, using npm's `update` command.

# TRAVIS SCRIPT
# SCRIPT
#
# install:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/node-latest-npm.bash)"
Expand Down
23 changes: 23 additions & 0 deletions scripts/node-npm-install.bash
@@ -0,0 +1,23 @@
#!/bin/bash
set -ueE -o pipefail

# Because the latest npm version that node 0.6 and 0.9 support, doesn't support scoped modules, so it uses node 0.8 to install npm packages and then switches back.

# SCRIPT
#
# install:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/node-npm-install.bash)"

# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_NODE_VERSION

if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then
set +u && nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}" && set -u
else
npm install
fi

# while our scripts pass linting, other scripts may not
# /home/travis/.travis/job_stages: line 81: secure: unbound
set +u
6 changes: 3 additions & 3 deletions scripts/node-publish.bash
Expand Up @@ -3,12 +3,12 @@ set -ueE -o pipefail

# Use the `DESIRED_NODE_VERSION` (defaults to the latest LTS node version) to login with npm and run `npm publish`.

# TRAVIS SCRIPT
# SCRIPT
#
# after_success:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/node-publish.bash)"

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DESIRED_NODE_VERSION
# Specficy a specific node version (rather than the LTS version)
Expand All @@ -34,7 +34,7 @@ set -ueE -o pipefail
# Specify whether or not to bump the npm version
# travis env set NPM_VERSION_BUMP "patch"

# EXTERNAL ENVIRONMENT VARIABLES
# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_TAG
# TRAVIS_PULL_REQUEST
Expand Down
22 changes: 22 additions & 0 deletions scripts/node-upgrade-npm.bash
@@ -0,0 +1,22 @@
#!/bin/bash
set -ueE -o pipefail

# Installs the latest supported version of npm for the current node version, using nvm's `install-latest-npm` command.

# SCRIPT
#
# before_install:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/node-upgrade-npm.bash)"

# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_NODE_VERSION

# avoid ssl errors
case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac
# install latest npm for current node version using nvm's code to do so
set +u && nvm install-latest-npm && set -u

# while our scripts pass linting, other scripts may not
# /home/travis/.travis/job_stages: line 81: secure: unbound
set +u
4 changes: 2 additions & 2 deletions scripts/node-verify.bash
Expand Up @@ -5,12 +5,12 @@ set -ueE -o pipefail
# then compile and lint our project with: `npm run our:compile && npm run our:verify`
# otherwise just compile our project with: `npm run our:compile`

# TRAVIS SCRIPT
# SCRIPT
#
# before_script:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/node-verify.bash)"

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DESIRED_NODE_VERSION
# To specify a specific node version (rather than the LTS version)
Expand Down
6 changes: 3 additions & 3 deletions scripts/surge.bash
Expand Up @@ -8,7 +8,7 @@ set -ueE -o pipefail
# causing a documentation recompile to always leave a dirty state - this solution avoids that,
# as documentation can be git ignored.

# TRAVIS SCRIPT
# SCRIPT
#
# after_success:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/surge.bash)"
Expand All @@ -19,7 +19,7 @@ set -ueE -o pipefail
# You will need to make sure you have surge installed as a local dependency,
# using npm: npm install --save-dev surge

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# DESIRED_NODE_VERSION
# Specficy a specific node version (rather than the LTS version)
Expand All @@ -37,7 +37,7 @@ set -ueE -o pipefail
# Set the path that you want to deploy to surge
# travis env set SURGE_PROJECT "." --public

# External Environment Variables
# TRAVIS ENVIRONMENT VARIABLES
#
# TRAVIS_REPO_SLUG
# TRAVIS_BRANCH
Expand Down
6 changes: 3 additions & 3 deletions scripts/travis-another.bash
Expand Up @@ -6,7 +6,7 @@ set -ueE -o pipefail
# and as such, when the content repository changes, you want to rerun the tests for the other repository,
# perhaps even for deployment purposes.

# TRAVIS SCRIPT
# SCRIPT
#
# sudo: false
# language: ruby
Expand All @@ -17,7 +17,7 @@ set -ueE -o pipefail
# script:
# - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/travis-another.bash)"

# TRAVIS ENVIRONMENT VARIABLES
# CUSTOM ENVIRONMENT VARIABLES
#
# GITHUB_TRAVIS_TOKEN
# Specify your [GitHub Personal Access Token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) with the `repo` permission.
Expand All @@ -29,7 +29,7 @@ set -ueE -o pipefail
#
# TRAVIS_ANOTHER_BRANCH
# The branch we should run this script on
#

# Run
if test "${TRAVIS_BRANCH-}" = "${TRAVIS_ANOTHER_BRANCH}"; then
echo "pinging $TRAVIS_ANOTHER_SLUG..."
Expand Down

0 comments on commit 19a6771

Please sign in to comment.