I created a Jenkins Snapshot Pipeline for an npm project. If the version inside the package.json contains -SNAPSHOT, it will increment the prerelease version, so 0.0.1-SNAPSHOT will become 0.0.1-SNAPSHOT.0, then -SNAPSHOT.1,... I did that so it will publish, when there are changes in SVN. I wrote a script, which is changing the Version in the package.json automatically, according to the prerelease-version. The only issue I have is, that i can't checkin the package.json file to SVN. With maven I'm using:
sh """mvn -f $pomFileName -Dstyle.color=always -Dusername=\${REDUCTED} -Dpassword=\${REDUCTED} -s path/to/.m2/settings-release.xml \
-DconnectionUrl=scm:svn:$SVNPATH/ -DdeveloperConnectionUrl=scm:svn:$SVNPATH/ \
scm:checkin -Dmessage=\"Release Message\" \
scm:tag -Dtag=V_TAGNAME -DtagBase=TAGBASE -DconnectionUrl=scm:svn:SVNPATH/trunk"""
Is there a way to commit the package.json without maven, with npm?
Thanks in advance.