Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # This script sets a parameter with the git tag that was
- # just checked out (this is a post-checkout hook).
- # If there is no tag, the parameter is set with the current
- # branch name + the HEAD hash.
- # Place this file into .git/hooks/ and chmod +x it.
- set -e
- # This is the parameters.yml parameter to look for
- VERSION=version
- tag=$(git tag --points-at HEAD)
- if [ "$tag" == "" ]; then
- tag="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse HEAD)"
- fi;
- sed -i -E s/$VERSION:\ .+/$VERSION:\ $tag/g app/config/parameters.yml
Add Comment
Please, Sign In to add comment