Browse Source

bugfixes to pdm scripts

feature/startup-from-labels
Mar Alegre 4 years ago
parent
commit
e4892d4720
  1. 4
      .install/bin/pdm-build
  2. 7
      .install/bin/pdm-launch
  3. 1
      .install/bin/pdm-shell

4
.install/bin/pdm-build

@ -51,6 +51,7 @@ while getopts ':sdt:h' arg; do
?) badarg "Invalid option '-$OPTARG'";;
esac
done
shift $((OPTIND -1))
# Handle non-option arguments
if [[ $# -gt 2 ]]; then
@ -110,6 +111,9 @@ else
podman rmi tmp-$epoch
fi
# tag image as latest
podman tag "$name:$today" "$name:latest"
# assign any extra tags
for tag in "${opt_tags[@]}"; do
podman tag "$name:$today" "$name:$tag"

7
.install/bin/pdm-launch

@ -40,6 +40,7 @@ while getopts ':fcl:e:h' arg; do
?) badarg "Invalid option '-$OPTARG'";;
esac
done
shift $((OPTIND -1))
# Handle non-option arguments
if [[ $# -lt 1 ]]; then
@ -52,7 +53,7 @@ if [[ $# -gt 2 ]]; then
badarg "Too many arguments"
fi
if [[ -n $2 ]]; then
if [[ $# -eq 2 ]]; then
container="$2"
else
container="$image"
@ -62,14 +63,14 @@ fi
if [[ $opt_config -eq 1 ]]; then
echo "Getting deploy options from image metadata label '$opt_label' ..."
deployconf=$(podman image inspect -f "{{ .Config.Labels.${opt_label} }}" "$image")
if [[ $config == "<no value>" ]]; then
if [[ $deployconf == "<no value>" ]]; then
echo "Error: could not find image metadata label '$opt_label'"
exit 1
fi
else
deployconf=""
fi
deployconf="$deployconf $opts_extras"
deployconf="$deployconf $opt_extras"
if [[ $opt_force -eq 1 ]]; then
podman rm -i -f "$container"

1
.install/bin/pdm-shell

@ -28,6 +28,7 @@ while getopts ':h' arg; do
?) badarg "Invalid option '-$OPTARG'";;
esac
done
shift $((OPTIND -1))
# Handle non-option arguments
if [[ $# -lt 1 ]]; then

Loading…
Cancel
Save