Adding Chapter 1 : Packer will build for you

This commit is contained in:
2021-03-18 16:11:35 +01:00
commit 02e13dfb00
97 changed files with 4630 additions and 0 deletions

31
packer/script/build Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -eo pipefail
PACKER_TEMPLATE=$1
shift
if [ -f '.env' ]; then
set -a
source .env
set +a
fi
export PACKER_KEY_INTERVAL=10ms
export PATH="$PATH:.bin"
function usage {
cat<<EOF
Usage: $0 </chemin/vers/template/packer>
Construit l'image correspondante au template Packer donné
EOF
exit 1
}
[ -z "${PACKER_TEMPLATE}" ] && usage
# Validate template
packer validate ${PACKER_TEMPLATE}
[[ $? -ne 0 ]] && exit 123
packer build $@ ${PACKER_TEMPLATE}