Skip to content

Instantly share code, notes, and snippets.

@Himura2la
Created July 1, 2024 19:28
Show Gist options
  • Save Himura2la/ef78c94ac59af59e8e9ed357a4c9eb62 to your computer and use it in GitHub Desktop.
Save Himura2la/ef78c94ac59af59e8e9ed357a4c9eb62 to your computer and use it in GitHub Desktop.
Update file in a named volume
#!/bin/sh
echo "Usage: $0 deploy|extract (default: deploy)"
engine=podman
script_dir="$(readlink -f "$(dirname "$0")")"
set -x
action=${1-deploy}
cc=$($engine run --rm -dtv grafana-config:/g -v prometheus-config:/p busybox)
case $action in
extract)
$engine cp $cc:/p/prometheus.yml "$script_dir/prometheus.yml"
;;
deploy)
$engine cp "$script_dir/prometheus.yml" $cc:/p/prometheus.yml
;;
esac
$engine stop -t0 $cc
$engine restart prometheus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment