gordlea
2/16/2015 - 6:52 PM

Jenkins NPM Publish

Jenkins NPM Publish

#!/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
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"));