Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Created February 9, 2016 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/57b8fea87d874ec1c2c5 to your computer and use it in GitHub Desktop.
Save ThomasG77/57b8fea87d874ec1c2c5 to your computer and use it in GitHub Desktop.
Prepare Github repo to manage npmjs release publication
# Mainly inspired by http://mclear.co.uk/2013/10/06/publishing-to-npm-on-git-commit-using-github-hooks-and-travis/
# One shot for installation: uncomment below 3 lines
# sudo apt-get install rubygems
# sudo gem install json
# gem install travis
key="your_key" # Obtained from ~/.npmrc
email="your_mail" # Obtained from ~/.npmrc
base_url_project_github="git@github.com:kosmtik/"
plugins="kosmtik-mbtiles-export kosmtik-map-compare kosmtik-overpass-layer kosmtik-fetch-remote kosmtik-tiles-export kosmtik-geojson-overlay kosmtik-overlay kosmtik-mapnik-reference kosmtik-deploy kosmtik-place-search kosmtik-open-in-josm kosmtik-osm-data-overlay"
for plugin in $plugins;
do git clone $base_url_project_github$plugin'.git' && \
cd $plugin && \
echo 'language: node_js
deploy:
api_key: "'$key'"
email: "'$email'"
provider: npm' > .travis.yml && \
travis encrypt --add deploy.api_key && \
git add .travis.yml && git commit -m "Travis auto publish config" && git push && \
cd ..;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment