Vasyl Saienko | 9740a4f | 2023-09-22 14:48:29 +0000 | [diff] [blame^] | 1 | #!/bin/bash |
2 | set -ex | ||||
3 | |||||
4 | export ENVIRONMENT=${ENVIRONMENT:-'mosk-23.3'} | ||||
5 | |||||
6 | source env/${ENVIRONMENT}.sh | ||||
7 | export VM_NAME=${VM_NAME:-"${ENVIRONMENT}-amd64-$(date +"%Y%m%d%H%M%S").qcow2"} | ||||
8 | |||||
9 | export PACKER_LOG=1 | ||||
10 | export PACKER_IMAGES_CACHE="./packer_images_cache" | ||||
11 | mkdir -p "${PACKER_IMAGES_CACHE}" | ||||
12 | |||||
13 | PACKER_BINARY=${PACKER_BINARY:-"$(which packer)"} | ||||
14 | |||||
15 | |||||
16 | ./config_drive.sh | ||||
17 | |||||
18 | $PACKER_BINARY build -on-error=abort template.json |