Alejandro Casanova Mutis Alejandro Casanova Mutis - 1 month ago 15
Git Question

Getting repository commit messages with Ant to update Crashlytics Beta release notes for builds using VSTS or Bitrise

I´m kind of new with the CI thing so I would appreciate a as much details as you folks can provide me.

I have configured two build servers for different native Android applications, one is using Bitrise and the other VSTS (Visual Studio Team Services), I have also configured a Fabric account with the Crashlytics/Beta kit enabled to automatically distribute the APK in each build.
I need to add a build step or some configuration, maybe using Ant or whatever, to update the release notes for each build uploaded to Fabric for testing purposes using the messages from the commits in the repository.

Thanks in advance!




Here are the screenshots of my VSTS configuration

Powershell Script:
enter image description here

Ant script:
enter image description here

And the screenshot of both build.xml (Ant) and script_release_notes.txt (Powershell), which are in the root folder:
enter image description here

Answer

In case of Bitrise, if you use the Git Clone step that exposes the commit information as environment variables, which you can then use anywhere you want to, like any other environment variable.

You can find the full list of exported "outputs" (environment variables) of the Git Clone step here: https://github.com/bitrise-io/steps-git-clone/blob/master/step.yml#L80

Edit: If you want to save these into a release_notes.txt file you can simply echo "$the_env_var" >> release_notes.txt, e.g. with a Script step.

To save the full commit message into release notes:

#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x

echo "$GIT_CLONE_COMMIT_MESSAGE_SUBJECT" > release_notes.txt
echo "$GIT_CLONE_COMMIT_MESSAGE_BODY" >> release_notes.txt