Adding self installation command for fabrica

This commit is contained in:
2021-03-23 10:47:39 +01:00
parent 740a8de4a2
commit b360760855
120 changed files with 301 additions and 164 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}