Adding self installation command for fabrica
This commit is contained in:
31
.packer/script/build
Executable file
31
.packer/script/build
Executable 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}
|
Reference in New Issue
Block a user