Skip to content

Instantly share code, notes, and snippets.

@bondarewicz
Last active November 16, 2018 12:57
Show Gist options
  • Save bondarewicz/9f66f764cb6240de7576b90de968c8aa to your computer and use it in GitHub Desktop.
Save bondarewicz/9f66f764cb6240de7576b90de968c8aa to your computer and use it in GitHub Desktop.
k8s git namespace
PROJECT_NAME="$(basename -s .git `git config --get remote.origin.url` | tr "[:upper:]" "[:lower:]")" | REV="$(git rev-parse --short HEAD)" | BRANCH="$(git branch | grep \* | cut -d ' ' -f2 )" | sed -i "" "s/{{namespace}}/${PROJECT_NAME}-${BRANCH}-sha.${REV}/g" file.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment