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

update/improve travis.yml #4

Merged
merged 1 commit into from Sep 14, 2019
Merged

update/improve travis.yml #4

merged 1 commit into from Sep 14, 2019

Conversation

ljharb
Copy link
Contributor

@ljharb ljharb commented Jan 19, 2019

add node 10 and 11; use nvm install-latest-npm; fix install script so it works on older nodes; cache nvm dir

add node 10 and 11; use `nvm install-latest-npm`; fix install script so it works on older nodes; cache nvm dir
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
- '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;'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain what each segment in the before_install and install does, as my travis/bash cripts are nowhere near as gooda as yours it seems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@balupton balupton Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards this being another awesome-travis script as it conflicts with the existing node-install and node-upgrade-npm functionality.

Would be nice for these two parts to become their own scripts for easy embedding/combination with other awesome-travis scripts.

I can make the necessary alterations upon feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line; it just means any package with scoped deps won’t be able to successfully install on 0.6.

I’m confused what conflicts tho, since it’s using nvm already inside Travis.

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
- linux
before_install:
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac'
- 'nvm install-latest-npm'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this installs the latest supported version of npm for the current node version, with logic that is far more accurate than anything else in the ecosystem :-)

Copy link
Member

@balupton balupton Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this functionality should go into the node-upgrade-npm script or become another script — not sure how their functionality differs.

The code inside this snippet should allow easy embedding of the various awesome-travis scripts.

I can make the necessary alterations upon feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the logic is baked into nvm; it’s not a simple mapping (it’s multi step) and i keep it up to date as npm releases new versions. tbh I’d just replace that entire upgrade npm script with this nvm command, since it’s always available in Travis.

- '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;'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

README.md Show resolved Hide resolved
@balupton balupton merged commit 49ac740 into bevry-archive:master Sep 14, 2019
@balupton
Copy link
Member

Ok merged, will extract the scripts out, so they are more plug-n-play with the rest of the scripts.

@ljharb ljharb deleted the patch-1 branch September 14, 2019 04:41
balupton added a commit that referenced this pull request Sep 14, 2019
@balupton
Copy link
Member

Ok all done. I replaced node-upgrade-npm with your script, and moved the old code to node-latest-npm, and added your new install script to node-npm-install. And added their appropriate listings to the readme. Also updated the node versions to the latest as of merging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants