Skip to content

Commit

Permalink
Automation of npm/yarn installation (#276)
Browse files Browse the repository at this point in the history
* [travis][m]: refactored travis config for automation of npm/yarn installables + added shell script for it - refs #274

* [travis][xs]: fixed array syntax for yaml data - refs #274

* [travis][xs]: re-wrote travis config matrix otherwise listing node_js versions weren't working - refs #274

* [travis][xs]: added after_success script to test out how shell script works (will be removed later) - refs #274

* [travis][xs]: removed temporary 'after_success' script so now we're ready to open a pull request - refs #274
  • Loading branch information
anuveyatsu committed Feb 13, 2018
1 parent 2b2b79c commit 54d937d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
33 changes: 28 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
language: node_js
node_js:
- '8'
install:
- npm install
script: npm test
matrix:
include:
- os: linux
node_js: '8'
env: TEST=true
sudo: required
- os: linux
node_js: '7'
env: TEST=false
sudo: required
- os: linux
node_js: '9'
env: TEST=false
sudo: required
- os: osx
node_js: '7'
env: TEST=false
- os: osx
node_js: '8'
env: TEST=false
- os: osx
node_js: '9'
env: TEST=false
install: if $TEST; then npm install; else echo 'skipping this script...'; fi
script: if $TEST; then npm test; else echo 'skipping this script...'; fi
before_deploy: npm run pack
deploy:
- provider: releases
Expand All @@ -20,3 +40,6 @@ deploy:
secure: "riGRy8fqyJPXeTJulBENhxLLktvVimqTlyrjckdifenI8q0vxbTvw4fRep3fKQqgNFrh0dccIagtPO8RSuf0Se9dK+M6mBM2dc8W6t84i0jg+EDoavvhgHlVfXFNEx50lWz2H1EZH4I9MvFbAiXQm7svhaXSMwudzdlHFq/K+0xjDkVgnv4AWOnkezf8XqyOmBfVPcS6mvfEMZgtQPR41eaFM7GZ1hAwOZnOwLSTRMljBiDlBSKp89ahNsmoDua3JMZ8/5s5pp1fBzlHJx6knNF9lSTjXQtJEd1ZGZljdyjIawwCdohzcR37P6iRlCLVAOGKrbeFMUnprUk23HFg3eD86cUtly+jdZd7YqBTSBQ4m9r+3G5YKbUdCbavC0pnc3/cKwP3tYRnLN5PPxo9pTypHwvVzADgG4XBnvXsE07k8F+QBdIJce7JpM1QjDi5xiqJyOEW1YIpVnxOBtO6qc/w+cmlZzcBcdbOfss0+mEU0WHJFj+FE8jDGtt3TJK9PvkV5EKo0KtDGmZVrOeW63CJ3SE47jOcS0GwtxdlSzTsKK9Ic3b9s1pHAoqHy0n/PJEXAJ6NcS0MyeHPPwg1NWWQMIXEt1JQf6iXdcWVVCZBBXShdX4KUUQLkOHXSNv1vIKgE/5UP3bjJ+FHazLQjPjquMIRuGmy6yAwD/GaaLI="
on:
tags: true
after_deploy:
- chmod ugo+x test-script.sh
- ./test-script.sh
22 changes: 22 additions & 0 deletions test-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -ev
echo '>>> Now running shell script...'
npm i -g data-cli
data --version
data help
data info https://datahub.io/core/finance-vix

echo '>>> Install data-cli with yarn...'
npm uninstall -g data-cli
if [ $(uname) = 'Darwin' ]; then
brew install yarn
else
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
fi

export PATH="$(yarn global bin):$PATH"
yarn global add data-cli
data --version
data info https://datahub.io/core/finance-vix

0 comments on commit 54d937d

Please sign in to comment.