Guest User

Untitled

a guest
Jun 22nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # This script sets a parameter with the git tag that was
  3. # just checked out (this is a post-checkout hook).
  4. # If there is no tag, the parameter is set with the current
  5. # branch name + the HEAD hash.
  6. # Place this file into .git/hooks/ and chmod +x it.
  7.  
  8. set -e
  9.  
  10. # This is the parameters.yml parameter to look for
  11. VERSION=version
  12.  
  13.  
  14. tag=$(git tag --points-at HEAD)
  15. if [ "$tag" == "" ]; then
  16. tag="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse HEAD)"
  17. fi;
  18.  
  19. sed -i -E s/$VERSION:\ .+/$VERSION:\ $tag/g app/config/parameters.yml
Add Comment
Please, Sign In to add comment