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'";; ?) badarg "Invalid option '-$OPTARG'";;
esac esac
done done
shift $((OPTIND -1))
# Handle non-option arguments # Handle non-option arguments
if [[ $# -gt 2 ]]; then if [[ $# -gt 2 ]]; then
@ -110,6 +111,9 @@ else
podman rmi tmp-$epoch podman rmi tmp-$epoch
fi fi
# tag image as 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
podman tag "$name:$today" "$name:$tag" 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'";; ?) badarg "Invalid option '-$OPTARG'";;
esac esac
done done
shift $((OPTIND -1))
# Handle non-option arguments # Handle non-option arguments
if [[ $# -lt 1 ]]; then if [[ $# -lt 1 ]]; then
@ -52,7 +53,7 @@ if [[ $# -gt 2 ]]; then
badarg "Too many arguments" badarg "Too many arguments"
fi fi
if [[ -n $2 ]]; then if [[ $# -eq 2 ]]; then
container="$2" container="$2"
else else
container="$image" container="$image"
@ -62,14 +63,14 @@ fi
if [[ $opt_config -eq 1 ]]; then if [[ $opt_config -eq 1 ]]; then
echo "Getting deploy options from image metadata label '$opt_label' ..." echo "Getting deploy options from image metadata label '$opt_label' ..."
deployconf=$(podman image inspect -f "{{ .Config.Labels.${opt_label} }}" "$image") 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'" echo "Error: could not find image metadata label '$opt_label'"
exit 1 exit 1
fi fi
else else
deployconf="" deployconf=""
fi fi
deployconf="$deployconf $opts_extras" deployconf="$deployconf $opt_extras"
if [[ $opt_force -eq 1 ]]; then if [[ $opt_force -eq 1 ]]; then
podman rm -i -f "$container" podman rm -i -f "$container"

1
.install/bin/pdm-shell

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

Loading…
Cancel
Save