DEV Community

Gitflow and NPM versions

Tirtha Guha on August 03, 2018

I am following standard gitflow, and I have different environments for testing the dev builds, and release builds. master goes to production. I a...
Collapse
 
dmfay profile image
Dian Fay

Multi-module Node projects and git-flow just do not play well together. Lerna might be your best bet.

Collapse
 
tirthaguha profile image
Tirtha Guha

Fixed it. with a little shell script.

Collapse
 
tirthaguha profile image
Tirtha Guha

Lerna is intriguing indeed. Will explore. Thanks.

Collapse
 
tirthaguha profile image
Tirtha Guha

The way I fixed it is as follows

//${buildNumber} and ${branch} are available as env variables in the build agent(at least available in jenkins/bamboo)
tagversion="1.0.0-${branch}.${buildNumber}"
echo $tagversion
npm version $tagversion

so my builds are created and published as
1.0.0-master.1 //for master
1.0.0-release.1 //for release
1.0.0-dev.1 //for dev