Browse Source

Add debug info

www
Fernando Alegre 7 months ago
parent
commit
98ba92273e
  1. 19
      .install/bin/pdm-build

19
.install/bin/pdm-build

@ -112,35 +112,40 @@ done
### export BUILDAH_FORMAT=docker ### export BUILDAH_FORMAT=docker
# build image # build image
echo "Building image ..." echo "Building image tmp-$epoch ..."
podman build -f Containerfile -t tmp-$epoch $buildopts podman build -f Containerfile -t tmp-$epoch $buildopts
# Initfile is for commands that need systemd to execute # Initfile is for commands that need systemd to execute
if [[ -f Initfile ]]; then if [[ -f Initfile ]]; then
echo "Running initialization ..." echo "Running initialization ..."
echo "Creating temporary container ..." echo "Creating temporary container tmp-$epoch ..."
podman create --name tmp-$epoch $runopts tmp-$epoch podman create --name tmp-$epoch $runopts tmp-$epoch
podman start tmp-$epoch podman start tmp-$epoch
echo "Copying script to container ..." echo "Copying script to container tmp-$epoch ..."
podman cp Initfile tmp-$epoch:/root/ podman cp Initfile tmp-$epoch:/root/
echo "Running script ..." echo "Running Initfile script ..."
podman exec tmp-$epoch bash -c "chmod +x /root/Initfile && /root/Initfile" podman exec tmp-$epoch bash -c "chmod +x /root/Initfile && /root/Initfile"
echo "Committing container to image ..." echo "Committing container tmp-$epoch to image $name:$today ..."
podman commit tmp-$epoch "$name:$today" podman commit tmp-$epoch "$name:$today"
else else
echo "Initfile not found, skipping temporary container step ..." echo "Initfile not found, skipping temporary container step ..."
# tag image we already built with appropriate tag, and untag with tmp # tag image we already built with appropriate tag, and untag with tmp
echo "Tagging image tmp-$epoch as $name:$today ..."
podman tag tmp-$epoch "$name:$today" podman tag tmp-$epoch "$name:$today"
podman rmi tmp-$epoch
fi fi
echo "Removing temporary image tmp-$epoch ..."
podman rmi tmp-$epoch
# tag image as latest # tag image as latest
echo "Adding latest tag to image $name:$today ..."
podman tag "$name:$today" "$name:latest" podman tag "$name:$today" "$name:latest"
# assign any extra tags # assign any extra tags
for tag in "${opt_tags[@]}"; do for tag in "${opt_tags[@]}"; do
echo "Adding tag $tag to image $name:$today ..."
podman tag "$name:$today" "$name:$tag" podman tag "$name:$today" "$name:$tag"
done done
echo "Done!" echo "... Done!"

Loading…
Cancel
Save