Skip to content

Instantly share code, notes, and snippets.

@onuralp
Last active May 22, 2017 09:52
Show Gist options
  • Save onuralp/e803bfc5d1c130e50cb534fcafaef7b6 to your computer and use it in GitHub Desktop.
Save onuralp/e803bfc5d1c130e50cb534fcafaef7b6 to your computer and use it in GitHub Desktop.
Marvel Character slug names for bash
#!/bin/bash
set -e
# Gets a marvel-charecter slug
NAME=$(marvel-characters)
# For MacOS
echo "$NAME" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z
# For other OS
# echo "$NAME" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
#!/bin/bash
set -e
# If you don't like release-names that's helm auto-generated. You are not alone.
# This trick let us to use marvel-character names instead of helm release names
npm install -g marvel-characters
# Resources:
# https://gist.github.com/oneohthree/f528c7ae1e701ad990e6
# https://github.com/mattdesl/marvel-characters
@onuralp
Copy link
Author

onuralp commented May 22, 2017

I don't like kubernetes helms' auto-generated release names. That's why I created this bash. I like elasticsearchs' naming. They are using marvel characters. So why don't we use it for helm.

chmod +x marvel-ch.sh
helm install --name $(./marvel-ch.sh)  stable/nginx-ingress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment