Skip to content

Instantly share code, notes, and snippets.

@kidbrax
Last active December 11, 2019 19:25
Show Gist options
  • Save kidbrax/0542890fe4c8ca22cbcf13b8d8229a71 to your computer and use it in GitHub Desktop.
Save kidbrax/0542890fe4c8ca22cbcf13b8d8229a71 to your computer and use it in GitHub Desktop.
kitchen alias to keep from retyping regex
# Provides an alias for the kitchen cli - https://docs.chef.io/ctl_kitchen.html
# place the following into your ~/.bashrc or similar
kitchen_specific_instances() {
if [ -z "$WORKING_INSTANCES" ]
then
echo "\$WORKING_INSTANCES is empty"
else
echo "\$WORKING_INSTANCES=$WORKING_INSTANCES"
fi
echo $1
echo "kitchen $1 '$WORKING_INSTANCES'"
kitchen $1 "'$WORKING_INSTANCES'"
}
alias kit=kitchen_specific_instances
# then you could use something like this
# export WORKING_INSTANCES="client.*(2016|7).*"
# kit list
# kit create
# kit converge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment