Created
July 1, 2024 19:28
-
-
Save Himura2la/ef78c94ac59af59e8e9ed357a4c9eb62 to your computer and use it in GitHub Desktop.
Update file in a named volume
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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