Skip to content

Instantly share code, notes, and snippets.

@johnnyhalife
Created October 11, 2012 15:27
Show Gist options
  • Save johnnyhalife/3873218 to your computer and use it in GitHub Desktop.
Save johnnyhalife/3873218 to your computer and use it in GitHub Desktop.
cd $WORKSPACE #=> step on the workspace
git clean -xdf
rm -rf ./package
# UPDATE PACKAGE JSON VERSION
APP_VERSION=$(cat $WORKSPACE/package.json | grep version | echo "$(grep -o '[0-9]\.[0-9]\.')$BUILD_NUMBER")
sed -e "s|\"version\": \".*\"|\"version\": \"$APP_VERSION\"|g" package.json > new.file
mv new.file package.json
sed -e "s|{MURALLY_VERSION}|$APP_VERSION|g" web.config > new.file
mv new.file web.config
OUTPUT_FILE=$(npm pack)
tar -xf $OUTPUT_FILE
cd package/
git init .
git add .
git commit -am "deployment for v.$BUILD_NUMBER"
git push -f https://user:Passw0rd!@murally.scm.azurewebsites.net/murally.git master
git push -f git@heroku.com:murally.git $(git rev-parse HEAD):master
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment