From 9d3776a6a3ccf2cde0a93193bded617237c6c03a Mon Sep 17 00:00:00 2001 From: Ondrej Dockal Date: Fri, 13 Feb 2026 12:14:58 +0100 Subject: [PATCH] chore: add remote machine preparation script Signed-off-by: Ondrej Dockal --- lib/darwin/scripts/remote_machine.sh | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/darwin/scripts/remote_machine.sh diff --git a/lib/darwin/scripts/remote_machine.sh b/lib/darwin/scripts/remote_machine.sh new file mode 100644 index 0000000..f408cdf --- /dev/null +++ b/lib/darwin/scripts/remote_machine.sh @@ -0,0 +1,40 @@ +#!/bin/bash +podmanMachine="podman-machine" +remoteMachine="remote-machine" + +echo "Preparing remote podman machine..." + +podman machine init --now $podmanMachine + +podman machine ssh pull ghcr.io/podmandesktop-ci/alpine-remote + +podman machine ssh image exists podmandesktop-ci/alpine-remote && echo "Image exists... " || { echo "image does not exists"; exit 1; } + +# Parse the podman system connection json to get default connection + +name=$(podman system connection ls --format json | jq '.[] | select(.Default==true)' | jq -r '.Name') +uri=$(podman system connection ls --format json | jq '.[] | select(.Default==true)' | jq -r '.URI') +identity=$(podman system connection ls --format json | jq '.[] | select(.Default==true)' | jq -r '.Identity') + +echo "Default connection - Name: $name, URI: $uri, Identity: $identity" + +podman system connection rm $podmanMachine +podman system connection rm $podmanMachine-root + +# remove default connections and other podman related file +if [[ "$(uname)" = *Linux* ]]; then + rm -rf /run/user/1000/podman/*$podmanMachine* +fi + +# Do not remove ~/.local/share/containers/podman as there are keys to the machine + +# remove other configuration files from USERPROFILE\.config\containers +rm -rf ~/.config/containers/podman/machine/qemu/$podmanMachine* + +# create a connection from previous information +podman system connection add $remoteMachine --identity $identity $uri + +# check connection +podman system connection ls --format json + +# run the remote e2e tests...