install.fairie/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl
Brian Zalewski 9f775f5e6d Update 6 files
- /home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_14-timeshift.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.tmpl
- /software.yml
- /docs/TODO.md
2023-01-30 08:06:59 +00:00

36 lines
1.7 KiB
Cheetah

{{- if (eq .host.distro.family "linux") -}}
#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Docker push-rm
if [ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/docker/cli-plugins/docker-pushrm" ]; then
logg info 'Acquiring release information for Docker push-rm'
RELEASE_TAG="$(curl -sSL https://api.github.com/repos/christian-korneck/docker-pushrm/releases/latest | jq -r '.tag_name')"
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/docker/cli-plugins"
logg info 'Downloading Docker push-rm'
curl https://github.com/christian-korneck/docker-pushrm/releases/download/$RELEASE_TAG/docker-pushrm_darwin_amd64 -o "${XDG_CONFIG_HOME:-$HOME/.config}/docker/cli-plugins/docker-pushrm"
chmod +x "${XDG_CONFIG_HOME:-$HOME/.config}/docker/cli-plugins/docker-pushrm"
logg success 'Added Docker push-rm'
else
logg info 'Docker push-rm already added'
fi
### Docker Rclone plugin
# Source: https://rclone.org/docker/
if [ ! -d /var/lib/docker-plugins/rclone/config ]; then
logg info 'Creating directory /var/lib/docker-plugins/rclone/config'
sudo mkdir -p /var/lib/docker-plugins/rclone/config
fi
if [ ! -d /var/lib/docker-plugins/rclone/cache ]; then
logg info 'Creating directory /var/lib/docker-plugins/rclone/cache'
sudo mkdir -p /var/lib/docker-plugins/rclone/cache
fi
sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/docker-rclone.conf /var/lib/docker-plugins/rclone/config/rclone.conf
if ! sudo su -c 'docker plugin ls' - "$USER" | grep 'rclone:latest' > /dev/null; then
sudo su -c 'docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions' - "$USER"
fi
{{ end -}}