Last active
September 9, 2019 18:49
-
-
Save gordlea/07b2c3e2dc789bca2504 to your computer and use it in GitHub Desktop.
Jenkins NPM Publish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo `env` | |
echo `ls` | |
git fetch --tags | |
git checkout master | |
git pull origin master | |
git branch release-$PROMOTED_GIT_COMMIT $PROMOTED_GIT_COMMIT | |
git clean -f | |
case $INCREMENT_VERSION in | |
skip) | |
echo "Skipping version increment" | |
;; | |
*) | |
echo "Incrementing $INCREMENT_VERSION" | |
npm version $INCREMENT_VERSION -m "Release %s" | |
git checkout master | |
git pull | |
git merge --no-ff release-$PROMOTED_GIT_COMMIT -m "Merging release branch" | |
git push origin master --tags | |
;; | |
esac | |
if [ $PUBLISH_TO_NPM = true ]; then | |
if [ $FORCE_PUBLISH_OVER_EXISTING = true ]; then | |
npm unpublish --force ./ | |
fi | |
npm publish ./ | |
export NPM_PACKAGE_VERSION=`cat package.json | grep version | awk -F\" '{ print $4 }'` | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(Jenkins.instance.getJobNames()) | |
//Jenkins.instance.getItemByFullName("identity-lens/identity-lens-pr").getBuildByNumber(146).finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment