Ever have a bunch of podman plays or docker composes you have to manage?
Wish you had an easy way to select which play or compose to run?

Requires fd[1] and gum[2].

#!/usr/bin/env bash

set -e

SELECTED_PLAY=$(fd -e yaml -x basename -s .yaml | sort | gum filter)
PLAY_OPTIONS=("--build" "--replace" "--quiet")
if [ ! "$(gum spin --show-output --spinner dot \
            --title "Running play..." -- \
            podman kube play \
            "${PLAY_OPTIONS[@]}" \
            "${SELECTED_PLAY}.yaml")" ]
then
    gum log --level error "Failed to run play: ${SELECTED_PLAY}. \
        Please check containers in play"
fi

This is how the website you’re currently visiting is deployed 🙂

[1]: https://github.com/sharkdp/fd
[2]: https://github.com/charmbracelet/gum