Install Packer#
首先我们要安装 hashicorp packer.
PackerInstaller 可以自动化安装 packer pre-compiled binary. 使用方法可以参考 install_packer.py. 下面是这个例子的源代码:
install_packer.py
1# -*- coding: utf-8 -*-
2
3from pathlib import Path
4import packer_ami_workflow.api as paw
5
6packer_installer = paw.PackerInstaller(
7 version="1.11.0",
8 platform=paw.PlatformEnum.macOS_arm64,
9 # platform=paw.PlatformEnum.linux_amd64,
10 dir_workspace=Path(__file__).absolute().parent,
11)
12packer_installer.install()