labsync/scripts/packer.sh
2020-01-24 21:54:55 +01:00

17 lines
310 B
Bash
Executable file

#!/bin/sh
set -e
set -o nounset
export NAME="$1"
mkdir -p images
export IMAGES="$(realpath images)"
(
cd packer
python3 -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout, indent=4)' < "$NAME.yaml" > "$NAME.json"
packer build "$NAME.json"
)
echo "$NAME" >> images.txt