Skip to content

Instantly share code, notes, and snippets.

@jamesdaniels
Last active September 29, 2015 23:17
Show Gist options
  • Save jamesdaniels/1684340 to your computer and use it in GitHub Desktop.
Save jamesdaniels/1684340 to your computer and use it in GitHub Desktop.
# 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`
# Get a Continuous Integration Token on AppBlade.com
# while on your project details page. If you don't
# have a project yet, you'll have to create one.
CI_TOKEN=YOUR_PROJECTS_CI_TOKEN
BUNDLE_PATH=/path/to/bundle
ZIPPED_DSYM_PATH=/path/to/a/zipped/dsym
# Include this for selective releases
RELEASE_TRACKS="Release Candidate"
curl -# -H "Accept: application/json" \
-H "Authorization: Bearer $CI_TOKEN" \
-F "version[bundle]=@$BUNDLE_PATH" \
-F "version[dsym]=@$ZIPPED_DSYM_PATH" \
-F "version[commit_id]=$GIT_TAG" \
-F "version[version_string]=$OVERRIDE_BUNDLE_VERSION_STRING" \
-F "version[changelog]=$CHANGELOG" \
-F "version[release_track_list]=$RELEASE_TRACKS" \
https://appblade.com/api/3/versions
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment