Skip to content

Commit

Permalink
fixup! rjeffman: this is a fixup for infra/images/build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeffman committed Jul 20, 2024
1 parent d48b9f1 commit d818e93
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions infra/image/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ EOF

name="ansible-test"
hostname="ipaserver.test.local"
cpus="2"
# Number of cpus is not available in usptream CI (Ubuntu 22.04).
# cpus="2"
memory="4g"
REBUILD="Y"
INSTALL="Y"
Expand Down Expand Up @@ -72,9 +73,15 @@ container_state="$(podman ps -q --all --format "{{.State}}" --filter "name=${nam

if [ "${REBUILD}" == "Y" ] || [ -z "${container_state}" ]
then
log info "= Cleanup possible existing ${DISTRO} ="
podman image rm "${DISTRO}" --force
echo
# in older (as in Ubuntu 22.04) podman versions,
# 'podman image rm --force' fails if the image
# does not exist.
if podman image exist "${DISTRO}"
then
log info "= Cleanup possible existing ${DISTRO} ="
podman image rm "${DISTRO}" --force
echo
fi

log info "= Building ${DISTRO} ="
podman build -t "${DISTRO}" -f "${BASEDIR}/dockerfile/${DISTRO}" \
Expand All @@ -84,7 +91,7 @@ then
log info "= Creating ${name} ="
podman create --privileged --name "${name}" --hostname "${hostname}" \
--network bridge:interface_name=eth0 --systemd true \
--cpus "${cpus}" --memory "${memory}" --memory-swap -1 --no-hosts \
--memory "${memory}" --memory-swap -1 --no-hosts \
--replace "${DISTRO}"
echo
fi
Expand Down

0 comments on commit d818e93

Please sign in to comment.