Skip to content
Snippets Groups Projects
Commit 7382af0e authored by nimrod's avatar nimrod
Browse files

Migrate workbench to use Podman Toolbox.

- wb shell function to launch tmux inside a toolbox container locally.
- wbr shell function to do the same but on ns4.
- Remove the workbench SSH config, not used now.
- Set the DOCKER_HOST environment variable to the Podman socket in case
  the Docker socket isn't available but the Podman socket is.
- A few aliases (for now flatpak-spawn and podman) that are set if
  running in a toolbox container.
parent 281dc014
No related branches found
No related tags found
No related merge requests found
......@@ -293,7 +293,11 @@ toux () {
}
wb () {
ssh -t workbench.shore.co.il 'if tmux ls >/dev/null 2>&1; then tmux a; else tmux; fi;'
toolbox run --container workbench -- /bin/sh -ic 'if tmux ls >/dev/null 2>&1; then tmux a; else tmux; fi;'
}
wbr () {
ssh -t ns4.shore.co.il toolbox run --container workbench -- /bin/sh -ic "'if tmux ls >/dev/null 2>&1; then tmux a; else tmux; fi;'"
}
__prompt () {
......@@ -380,5 +384,21 @@ then
! command -v direnv > /dev/null || eval "$(direnv hook bash)"
fi
if [ ! -S /var/run/docker.sock ] &&
[ -z "${DOCKER_HOST:-}" ] &&
[ -S "$XDG_RUNTIME_DIR/podman/podman.sock" ] &&
[ -w "$XDG_RUNTIME_DIR/podman/podman.sock" ]
then
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
fi
if [ "$HOSTNAME" = 'toolbox' ]
then
alias flatpak-spawn='/usr/libexec/flatpak-xdg-utils/flatpak-spawn --host'
[ ! -S "$XDG_RUNTIME_DIR/podman/podman.sock" ] ||
[ ! -w "$XDG_RUNTIME_DIR/podman/podman.sock" ] ||
alias podman='podman --remote'
fi
# shellcheck disable=SC2119
prune_ssh_sockets
......@@ -18,11 +18,6 @@ IdentityFile ~/.ssh/gitlab_ed25519
HostName host01.shore.co.il
Port 2222
Host workbench.shore.co.il
HostName ns4.shore.co.il
LocalForward 8080 localhost:8080
Port 2222
Host *.shore.co.il 192.168.3.*
IdentityFile ~/.ssh/shore_ecdsa
IdentityFile ~/.ssh/shore_ed25519
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment