aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Buchholz <tomalok@gmail.com>2019-05-02 20:59:14 -0700
committerJake Buchholz <tomalok@gmail.com>2019-05-02 20:59:14 -0700
commite4005531e672e808da776de732d516bbe8504b60 (patch)
treea1970ba93134dde5528181e58443c000561758e6
parent92dcbe24ef3cbbcdd961f155b3af6bb7623665a8 (diff)
downloadalpine-ec2-ami-e4005531e672e808da776de732d516bbe8504b60.tar.bz2
alpine-ec2-ami-e4005531e672e808da776de732d516bbe8504b60.tar.xz
alpine-ec2-ami-e4005531e672e808da776de732d516bbe8504b60.zip
some fixes, etc
* base/1 - fix revision quotes * packer.conf - fix ami_description (when suffix is empty), add Name/Created tags to AMI & Snapshot, shutdown_behavior = terminate * scripts/setup-ami.sh - stop warnings when untarring alpine-keys.apk * remove security_group stuff (packer creates temporary one) * .gitignore - mask all profile build configs, except the ones we vend
-rw-r--r--.gitignore6
-rw-r--r--packer.conf10
-rw-r--r--profiles/base/13
-rw-r--r--profiles/test.conf6
-rwxr-xr-xscripts/setup-ami.sh2
5 files changed, 16 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index efc91a3..01e46bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
1**/*~ 1**/*~
2**/*.swp 2**/*.swp
3/build/ 3/build/
4/.py3/
5/variables.yaml
6/variables.yaml_*
7/scrub-old-amis.py 4/scrub-old-amis.py
8/gen-readme.py 5/gen-readme.py
6/profiles/*.conf
7!/profiles/alpine-amis.conf
8!/profiles/test.conf.conf
diff --git a/packer.conf b/packer.conf
index 513f093..cd98c5e 100644
--- a/packer.conf
+++ b/packer.conf
@@ -6,7 +6,6 @@ builders = [
6 6
7 region = "{{user `build_region`}}" 7 region = "{{user `build_region`}}"
8 subnet_id = "{{user `build_subnet`}}" 8 subnet_id = "{{user `build_subnet`}}"
9 security_group_id = "{{user `build_security_group`}}"
10 instance_type = "{{user `build_instance_type`}}" 9 instance_type = "{{user `build_instance_type`}}"
11 associate_public_ip_address = "{{user `build_public_ip`}}" 10 associate_public_ip_address = "{{user `build_public_ip`}}"
12 source_ami_filter { 11 source_ami_filter {
@@ -28,14 +27,19 @@ builders = [
28 volume_size = "{{user `ami_volume_size`}}" 27 volume_size = "{{user `ami_volume_size`}}"
29 } 28 }
30 ] 29 ]
31 ssh_username = "{{user `build_user`}}" 30 shutdown_behavior = "terminate"
31 ssh_username = "{{user `build_user`}}"
32 32
33 ### AMI Build Details 33 ### AMI Build Details
34 34
35 ami_name = 35 ami_name =
36 "{{user `ami_name_prefix`}}{{user `release`}}-{{user `arch`}}-{{user `revision`}}{{user `ami_name_suffix`}}" 36 "{{user `ami_name_prefix`}}{{user `release`}}-{{user `arch`}}-{{user `revision`}}{{user `ami_name_suffix`}}"
37 ami_description = 37 ami_description =
38 "{{user `ami_desc_prefix`}}{{user `release`}} {{user `arch`}} {{user `revision`}} {{user `ami_desc_suffix`}}" 38 "{{user `ami_desc_prefix`}}{{user `release`}} {{user `arch`}} {{user `revision`}}{{user `ami_desc_suffix`}}"
39 tags {
40 Name = "{{user `ami_name_prefix`}}{{user `release`}}-{{user `arch`}}-{{user `revision`}}{{user `ami_name_suffix`}}"
41 Created = "{{isotime \"2006-01-02 03:04:05 MST\"}}"
42 }
39 ami_virtualization_type = "hvm" 43 ami_virtualization_type = "hvm"
40 ami_root_device { 44 ami_root_device {
41 volume_type = "gp2" 45 volume_type = "gp2"
diff --git a/profiles/base/1 b/profiles/base/1
index 3bda7ed..abd1413 100644
--- a/profiles/base/1
+++ b/profiles/base/1
@@ -3,7 +3,7 @@
3# Profile/Build 3# Profile/Build
4profile = null 4profile = null
5profile_build = null 5profile_build = null
6revision = 'r0' 6revision = "r0"
7 7
8# Versioning 8# Versioning
9version = null 9version = null
@@ -17,7 +17,6 @@ build_arch = null
17# Builder-instance 17# Builder-instance
18build_region = null 18build_region = null
19build_subnet = null 19build_subnet = null
20build_security_group = null
21build_instance_type = "t3.nano" 20build_instance_type = "t3.nano"
22build_public_ip = null 21build_public_ip = null
23build_user = "ec2-user" 22build_user = "ec2-user"
diff --git a/profiles/test.conf b/profiles/test.conf
index 01d38d6..6bf9fbe 100644
--- a/profiles/test.conf
+++ b/profiles/test.conf
@@ -7,8 +7,10 @@ arch-aarch64 { include "arch/aarch64" }
7 7
8# specific to this profile's builds 8# specific to this profile's builds
9test { 9test {
10 build_region = "us-west-2" 10 ami_name_prefix = "test"
11 build_subnet = "subnet-033a30d7b5220d177" 11 ami_desc_prefix = "test"
12 build_region = "us-west-2"
13 build_subnet = "subnet-033a30d7b5220d177"
12 ami_regions { 14 ami_regions {
13 us-west-2 = true 15 us-west-2 = true
14 } 16 }
diff --git a/scripts/setup-ami.sh b/scripts/setup-ami.sh
index 2c0a1a6..e56cece 100755
--- a/scripts/setup-ami.sh
+++ b/scripts/setup-ami.sh
@@ -119,7 +119,7 @@ fetch_keys() {
119 local tmp="$(mktemp -d)" 119 local tmp="$(mktemp -d)"
120 120
121 wgets "$ALPINE_KEYS" "$ALPINE_KEYS_SHA256" "$tmp/alpine-keys.apk" 121 wgets "$ALPINE_KEYS" "$ALPINE_KEYS_SHA256" "$tmp/alpine-keys.apk"
122 tar -C "$target" -xvf "$tmp"/alpine-keys.apk etc/apk/keys 122 tar -C "$target" --warning=no-unknown-keyword -xvf "$tmp"/alpine-keys.apk etc/apk/keys
123 rm -rf "$tmp" 123 rm -rf "$tmp"
124} 124}
125 125