Vasyl Saienko | 9740a4f | 2023-09-22 14:48:29 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -ex |
| 3 | |
Vasyl Saienko | ab3cead | 2023-09-24 14:25:37 +0000 | [diff] [blame] | 4 | export ENVIRONMENT=${ENVIRONMENT:-'23.3'} |
Vasyl Saienko | 9740a4f | 2023-09-22 14:48:29 +0000 | [diff] [blame] | 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 | |
Vasyl Saienko | 3cc01ca | 2023-09-25 12:23:43 +0000 | [diff] [blame] | 18 | $PACKER_BINARY build -on-error=cleanup template.json |