Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions lib/darwin/scripts/remote_machine.sh
Original file line number Diff line number Diff line change
@@ -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...