forked from ibm-developer/generator-ibm-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·25 lines (24 loc) · 911 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
echo "Auto publish script : version 0.0.2"
echo "Checking if a new publish cycle is required ..."
PKG_NAME=`node -e "console.log(require('./package.json').name);"`
PKG_VER=`node -e "console.log(require('./package.json').version);"`
NPM_VER=`npm show $PKG_NAME version --silent`
echo "$PKG_NAME : version = $PKG_VER, npm version = $NPM_VER"
if [[ $TRAVIS_BRANCH == "master" ]]; then
echo "Build targetting master - checking if this is a PR or not"
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
echo "This is a build on master, performing additional steps"
if [[ $PKG_VER == $NPM_VER ]]; then
echo "Version numbers match, so changing version and committing changes"
../prerelease.sh
retval=$?
if [ $retval != 0 ]; then
exit $retval
fi
else
echo "Version numbers don't match, so publishing to the registry"
npm publish
fi
fi
fi