Skip to content

Instantly share code, notes, and snippets.

@mitsuse
Created December 25, 2017 07:39
Show Gist options
  • Save mitsuse/30f165bcdaf3232d74725de85c0cbbe6 to your computer and use it in GitHub Desktop.
Save mitsuse/30f165bcdaf3232d74725de85c0cbbe6 to your computer and use it in GitHub Desktop.
Run `bitrise run` on the specific commit in a temporary directory.
#!/bin/bash
validate_variable() {
name=$1
value=${!name}
if [ -z "$value" ]; then
echo "error: \$${name} is required." >&2
exit 128
fi
}
url_repository=$1
hash_commit=$2
workflow=$3
validate_variable url_repository
validate_variable hash_commit
validate_variable workflow
path_temporary=$(mktemp -d)
git clone $url_repository $path_temporary
cd $path_temporary
git checkout $hash_commit
bitrise run $workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment