CONTINUOUS INTEGRATION & CONTINUOUS DEPLOYMENT CI - Merge back to the ‘integration branch’ often Small units of work Tests to know that the feature is done & that it will continue to work CD - Deploy the ‘integration branch’ often Allows for ‘human’ testing and acceptance The real ‘end-to-end’ testing of the work Determines if the work can go to users (production)
CONTINUOUS INTEGRATION & CONTINUOUS DEPLOYMENT CI - Merge back to the ‘integration branch’ often Small units of work Tests to know that the feature is done & that it will continue to work CD - Deploy the ‘integration branch’ often Allows for ‘human’ testing and acceptance The real ‘end-to-end’ testing of the work Determines if the work can go to users (production) Testing Builds Confidence
`NPM PREPARE` LIFECYCLE HOOK “Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies (See below). This is run AFTER prepublish, but BEFORE prepublishOnly”
`NPM PREPARE` LIFECYCLE HOOK “Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies (See below). This is run AFTER prepublish, but BEFORE prepublishOnly”
`NPM VERSION` ON CI AND BACK AGAIN Custom NPM Version Commands: npm version prepatch --preid=alpha --message “[no ci] new version!!!” Based on the Branch Name or Feature
`NPM VERSION` ON CI AND BACK AGAIN Custom NPM Version Commands: npm version prepatch --preid=alpha --message “[no ci] new version!!!” Based on the Branch Name or Feature Grant CI Access to NPM: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc Generate a NPM Auth Token on npmjs.org
`NPM VERSION` ON CI AND BACK AGAIN Custom NPM Version Commands: npm version prepatch --preid=alpha --message “[no ci] new version!!!” Based on the Branch Name or Feature Grant CI Access to NPM: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc Generate a NPM Auth Token on npmjs.org Push to NPM: npm publish --tag alpha Or use custom tags for your branch
`NPM VERSION` ON CI AND BACK AGAIN Custom NPM Version Commands: npm version prepatch --preid=alpha --message “[no ci] new version!!!” Based on the Branch Name or Feature Grant CI Access to NPM: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc Generate a NPM Auth Token on npmjs.org Push to NPM: npm publish --tag alpha Or use custom tags for your branch Push the new version back to Git: git push && git push --tags Only on the Integration Branch Make sure CI has access to Git. You can usual use a commit message [no ci] to prevent loops
PRODUCTION === STABLE BRANCH When on the Stable Branch:
Make a new ‘release’ tag: npm version patch Grant CI Access to NPM: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc Push to NPM: npm publish --tag latest (or skip the --tag) Push the new version back to Git: git checkout master && git rebase stable && git push && git push --tags
PRODUCTION === STABLE BRANCH When on the Stable Branch:
Make a new ‘release’ tag: npm version patch Grant CI Access to NPM: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc Push to NPM: npm publish --tag latest (or skip the --tag) Push the new version back to Git: git checkout master && git rebase stable && git push && git push --tags human discretion here
PRODUCTION === STABLE BRANCH When on the Stable Branch:
Make a new ‘release’ tag: npm version patch Grant CI Access to NPM: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc Push to NPM: npm publish --tag latest (or skip the --tag) Push the new version back to Git: git checkout master && git rebase stable && git push && git push --tags human discretion here Or maybe semantic-release
Stop Worrying and Let the Robot Publish to NPM Thank You All my Co-workers & Grouparoo SlidesGo, Flaticon, Freepik BenSound.com Unsplash Carbon.now.sh NPM (Sorry!) Code: github.com/evantahler/cascadiajs