[tasks.lint] usage = ''' arg "" help="Directory containing the Packer template to lint e.g. debian/13-trixie" ''' run = ''' packer fmt --recursive --check ${usage_dir?} \ && packer validate ${usage_dir?} ''' [tasks.fmt] usage = ''' arg "" help="Directory containing the Packer template to format e.g. debian/13-trixie" default="." ''' run = "packer fmt --recursive ${usage_dir?}" [tasks.build] usage = ''' arg "" help="Directory containing the Packer template to build e.g. debian/13-trixie" flag "-i --install-finished-inform-port " help="Server port to inform when installation is finished" hide=#true ''' run = ''' mise run lint ${usage_dir?} [[ -z "${usage_install_finished_inform_port}" ]] && packer build ${usage_dir?} [[ -n "${usage_install_finished_inform_port}" ]] && packer build \ -var "install_finished_inform_port=${usage_install_finished_inform_port?}" \ ${usage_dir?} ''' [tasks.build-luks] usage = ''' arg "" help="Directory containing the Packer template to build e.g. debian/13-trixie" flag "--luks-wait-seconds " help="Seconds to wait for the LUKS password prompt after installation before sending the password" default="45" ''' run = ''' _scripts/unlock-luks-after-install.py -t ${usage_dir?} --luks-wait-seconds ${usage_luks_wait_seconds?} ''' [tasks.init] usage = ''' arg "" help="Directory containing the Packer template to initialize e.g. debian/13-trixie" ''' run = "packer init ${usage_dir?}" [tasks.setup] usage = ''' arg "" help="The Linux distribution name (e.g. debian)" arg "" help="The Linux distribution version (e.g. 13-trixie)" ''' run = ''' mkdir -p ${usage_distribution?}/${usage_version?} \ && ln -s ../../credentials.auto.pkrvars.hcl ${usage_distribution?}/${usage_version?}/credentials.auto.pkrvars.hcl \ && ln -s ../../variables-common.pkr.hcl ${usage_distribution?}/${usage_version?}/variables-common.pkr.hcl \ && touch ${usage_distribution?}/${usage_version?}/${usage_distribution?}-${usage_version?}.pkr.hcl '''