Skip to content
Merged
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
22 changes: 13 additions & 9 deletions testing_using_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Details:
# - container name: agama
# - port 9090 is exposed so that web UI works
# - port 9091 is exposed and forwarded to the container
# - 'WITH_RUBY_DBUS=1 $0' will prefer ../ruby-dbus to any ruby-dbus.gem

set -x
Expand All @@ -17,7 +17,7 @@ CIMAGE=registry.opensuse.org/systemsmanagement/agama/staging/containers/opensuse
# rename this if you test multiple things
CNAME=agama

test -f service/agama.gemspec || { echo "You should run this from a checkout of agama"; exit 1; }
test -f service/agama-yast.gemspec || { echo "You should run this from a git checkout of Agama"; exit 1; }

# destroy the previous instance, can fail if there is no previous instance
podman stop ${CNAME?} || : no problem if there was nothing to stop
Expand All @@ -34,23 +34,27 @@ if [ "${WITH_RUBY_DBUS-}" = 1 ]; then
MORE_VOLUMES=(-v ../ruby-dbus:/checkout-ruby-dbus)
fi

# use the host networking, port forwarding does not work for some reason :-/
podman run --name ${CNAME?} \
--privileged --detach --ipc=host \
--privileged --detach \
-v .:/checkout \
${MORE_VOLUMES[@]} \
-p 9090:9090 \
--network=host \
${CIMAGE?}

# shortcut for the following
CEXEC="podman exec ${CNAME?} bash -c"

${CEXEC?} "cd /checkout && ./setup.sh"

# Now the CLI is in the same repo, just symlink it
${CEXEC?} "ln -sfv /checkout/./rust/target/debug/agama /usr/bin/agama"

# Manually start cockpit as socket activation does not work with port forwarding
${CEXEC?} "systemctl start cockpit"
echo "Set the Agama (root) password:"
podman exec -it ${CNAME?} passwd

# Interactive shell in the container
podman exec --tty --interactive ${CNAME?} bash

echo "To attach again to the Agama container run:"
echo " podman exec --tty --interactive ${CNAME?} bash"
echo "To stop and remove the Agama container run:"
echo " podman stop ${CNAME?}"
echo " podman rm ${CNAME?}"