Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
Created March 18, 2014 07:43
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 jedi4ever/9615305 to your computer and use it in GitHub Desktop.
Save jedi4ever/9615305 to your computer and use it in GitHub Desktop.
Nodejs & Versioning etc.. in Continous Delivery

Current setup

  • npm install from public repo
  • use of github URLs for private dependencies:
    • PRO: easy to use, using #master always fetches latests
    • BAD: npm install downloads every time, need to npm link or rm -rf node_modules to make sure
  • rebuild of consolidated/minified files every time, using Git version
    • BAD: results in consistent build overwriting
    • IMPROVE: using hash of result and upload to cloudfront

Improved flow:

  • post-commit hook to verify unit tests pass
  • triggers github -> CI (CircleCI)
  • should do build of JS first (tag it and release it)

NPM ~ versioning mechanisms

npm install

  • npm install defaults to updating both dependencies & devDependencies
  • npm update only updates dependencies

package.json

  • use of ^ or ~ in versions
  • github URLs
  • use of latests

.npmignore

  • .gitignore vs .npmignore
  • always ignore node_modules unless bundledDependencies

npm publish

  • bundledDependencies : will make sure the dependencies are included

  • private: true

  • buildConfig? : to point to private repo

  • npm publish defaults to tagging the release with latest

  • npm publish --tag rc

  • npm install --tag rc

grunt release

  • grunt release
  • ci skip in message
  • no npm publish

npm shrinkwrap & lockdown

  • seems to conflict with bundledDependencies sometimes
  • lockdown solves hashing issues

Private NPM repo

  • sinopia
  • chef-sinopia (haproxy needed)
  • chef-npmjs
  • reggie?

Semver & nodejs

  • bower always makes rc < release

How will the CI flow work?

  • grunt build
  • npm test
  • grunt release --tag rc
  • deploy to staging (npm install --tag rc)
  • run web tests
  • grunt release:prerelease
  • grunt release (minor)

do we do git commits & merge in other branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment