Last active
June 29, 2018 14:17
-
-
Save raulneis/6c45439012907cb4f13a9173ac4d33c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in .env