Skip to content

Instantly share code, notes, and snippets.

@jamesdaniels
Created January 13, 2012 19:14
Show Gist options
  • Save jamesdaniels/1608185 to your computer and use it in GitHub Desktop.
Save jamesdaniels/1608185 to your computer and use it in GitHub Desktop.
Jenkins: push tagged commits to AppBlade
# Push tagged commits to AppBlade
# https://appblade.com/api
# Look up all the tags, grep for any on this commit, excluding jenkins-build tags
TAGGED_RELEASE=`git show-ref --tags --dereference | grep \`git rev-parse HEAD\` | awk '$2 !~ /refs\/tags\/jenkins(.+)\^\{\}/ { print $2 }'`
# Any results?
if [ -n "$TAGGED_RELEASE" ]
then
# If there was a match, we are on a tagged release (or many), normalize them, and grab the first one
GIT_TAG=`echo $TAGGED_RELEASE | tr "^{}" " " | tr "/refs/tags/" " " | awk -F" " '{print $1}'`
# Set the tag as the version number
OVERRIDE_BUNDLE_VERSION_STRING=GIT_TAG
# Set the change-log as the message of the tag
CHANGELOG=`git show -s --format=%n $GIT_TAG`
API_KEY=YOUR_API_KEY
BUNDLE_PATH=/path/to/bundle
ZIPPED_DSYM_PATH=/path/to/a/zipped/dsym
PROJECT_UUID=XXXX-XXXX-XXXX-XXXX
curl -# -H "Accept: application/json" -H "Authorization: Bearer $API_KEY" -F "version[async_bundle]=@$BUNDLE_PATH" -F "version[dsym]=@$ZIPPED_DSYM_PATH" -F "version[version_string]=\"$OVERRIDE_BUNDLE_VERSION_STRING\"" -F "version[changelog]=$CHANGELOG" https://appblade.com/api/projects/$PROJECT_UUID/versions
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment