![Jake Buchholz](/assets/img/avatar_default.png)
* Match meanings of 'version' and 'release' to how Alpine uses them * Use optional 'revision' to denote any same-release AMI rebuild * Include CPU 'arch' in naming/description (may also offer 'aarch64' AMIs someday) * Upgrade build instance to use Amazon Linux 2 AMIs * Use env vars to pass details to 'make_ami.sh' instead of via CLI parameters * make_ami.sh + minimum version/release shouldn't be overrideable + update APK tools & Alpine keys + check build's release vs. installed /etc/alpine-release
71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
variables:
|
|
|
|
# NOTE: Configuration is done with a 'variables.yaml' file. If it doesn't
|
|
# exist, default configuration is copied from 'variables.yaml-default'.
|
|
|
|
# NOTE: Changing arch/version/release may require modifying 'make_ami.sh'.
|
|
arch: x86_64
|
|
version: "3.9"
|
|
release: "3.9.0"
|
|
revision: ""
|
|
|
|
builders:
|
|
- type: "amazon-ebssurrogate"
|
|
|
|
### Builder Instance Details
|
|
|
|
region: "{{user `region`}}"
|
|
subnet_id: "{{user `subnet`}}"
|
|
security_group_id: "{{user `security_group`}}"
|
|
instance_type: "t3.nano"
|
|
associate_public_ip_address: "{{user `public_ip`}}"
|
|
launch_block_device_mappings:
|
|
- volume_type: "gp2"
|
|
device_name: "/dev/xvdf"
|
|
delete_on_termination: "true"
|
|
volume_size: "{{user `volume_size`}}"
|
|
ssh_username: "ec2-user"
|
|
source_ami_filter:
|
|
# use the latest Amazon Linux AMI
|
|
filters:
|
|
virtualization-type: "hvm"
|
|
root-device-type: "ebs"
|
|
architecture: "x86_64"
|
|
name: "amzn2-ami-hvm-2.0.*-gp2"
|
|
owners:
|
|
- "137112412989"
|
|
most_recent: "true"
|
|
|
|
### AMI Build Details
|
|
|
|
ami_name: "{{user `ami_name_prefix`}}{{user `release`}}{{user `revision`}}-{{user `arch`}}{{user `ami_name_suffix`}}"
|
|
ami_description: "{{user `ami_desc_prefix`}}{{user `release`}}{{user `revision`}} {{user `arch`}}{{user `ami_desc_suffix`}}"
|
|
ami_virtualization_type: "hvm"
|
|
ami_root_device:
|
|
source_device_name: "/dev/xvdf"
|
|
device_name: "/dev/xvda"
|
|
delete_on_termination: "true"
|
|
volume_size: "{{user `volume_size`}}"
|
|
volume_type: "gp2"
|
|
encrypt_boot: "{{user `encrypt_ami`}}"
|
|
ena_support: "true"
|
|
sriov_support: "true"
|
|
ami_groups: "{{user `ami_access`}}"
|
|
ami_regions: "{{user `deploy_regions`}}"
|
|
|
|
|
|
provisioners:
|
|
- type: "file"
|
|
source: "nvme/"
|
|
destination: "/tmp"
|
|
- type: "shell"
|
|
script: "make_ami.sh"
|
|
environment_vars:
|
|
- "VERSION={{user `version`}}"
|
|
- "RELEASE={{user `release`}}"
|
|
- "REVISION={{user `revision`}}"
|
|
- "ADD_REPOS='{{user `add_repos`}}'"
|
|
- "ADD_PKGS='{{user `add_pkgs`}}'"
|
|
- "ADD_SVCS='{{user `add_svcs`}}'"
|
|
execute_command: 'sudo sh -c "{{ .Vars }} {{ .Path }}"'
|