install.fairie/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl
Brian Zalewski 2eead82bf1 Update 3 files
- /home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl
- /home/dot_local/bin/executable_install-program
2023-01-30 05:09:12 +00:00

38 lines
1.8 KiB
Cheetah

{{- if (eq .host.distro.family "linux") -}}
#!/usr/bin/env bash
# Docker plugins.json hash: {{ include (joinPath .chezmoi.homeDir ".config" "docker" "plugins.json") | sha256sum }}
{{ 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 -}}