Skip to content

AMI naming #16

Merged
merged 10 commits into from
Feb 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions bin/perms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

aws_acct_id="823003027569"
bucket="internet2-tier-appliance-us-west-1"
vagrant_key=$(aws s3api list-objects --bucket $bucket --query 'reverse(sort_by(Contents[?contains(Key, `vagrant`)], &LastModified))[0].[Key]' --output text | tr -d '\n' )
ova_key=$(aws s3api list-objects --bucket $bucket --query 'reverse(sort_by(Contents[?contains(Key, `ova`)], &LastModified))[0].[Key]' --output text | tr -d '\n' )

echo "Found $vagrant_key"
aws s3api put-object-acl --bucket $bucket --key $vagrant_key --acl public-read

echo "(https://s3-us-west-1.amazonaws.com/$bucket/$vagrant_key)"

echo $(md5sum builds/$vagrant_key)
ova_key=$(aws s3api list-objects --bucket $bucket --query 'reverse(sort_by(Contents[?contains(Key, `ova`)], &LastModified))[0].[Key]' --output text | tr -d '\n' )

echo "Found $ova_key"
aws s3api put-object-acl --bucket $bucket --key $ova_key --acl public-read
Expand Down
9 changes: 2 additions & 7 deletions comanage-appliance.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"variables": {
"profile": "xfs",
"disk_size": "20000",
"memory": "6122",
"cpus": "2",
"memory": "2048",
"cpus": "1",
"ssh_username": "centos",
"ssh_password": "centos",
"region": "us-west-1",
Expand Down Expand Up @@ -63,11 +63,6 @@
"compression_level": "9",
"output": "builds/{{user `outputfile_name`}}-ova-{{user `timestamper`}}.tar"
},
{
"type": "vagrant",
"compression_level": "9",
"output": "builds/{{user `outputfile_name`}}-vagrant-{{user `timestamper`}}.box"
},
{
"type": "amazon-import",
"access_key": "{{user `aws_access_key`}}",
Expand Down
5 changes: 0 additions & 5 deletions grouper-appliance.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@
"compression_level": "9",
"output": "builds/{{user `outputfile_name`}}-ova-{{user `timestamper`}}.tar"
},
{
"type": "vagrant",
"compression_level": "9",
"output": "builds/{{user `outputfile_name`}}-vagrant-{{user `timestamper`}}.tar"
},
{
"type": "amazon-import",
"access_key": "{{user `aws_access_key`}}",
Expand Down
3 changes: 3 additions & 0 deletions scripts/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY

# Disable the centos user
chsh -s /bin/false centos

# Add `sync` so Packer doesn't quit too early, before the large file is deleted.
sync
12 changes: 5 additions & 7 deletions shibboleth-appliance.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"ssh_password": "centos",
"region": "us-west-1",
"timestamper": "{{timestamp}}",
"outputfile_name": "shibboleth-appliance-centos7"
"outputfile_name": "shibboleth-appliance-centos7",
"build_number": "{{env `BUILD_NUMBER`}}"
},
"provisioners": [
{
Expand Down Expand Up @@ -65,19 +66,16 @@
"compression_level": "9",
"output": "builds/{{user `outputfile_name`}}-ova-{{user `timestamper`}}.tar"
},
{
"type": "vagrant",
"compression_level": "9",
"output": "builds/{{user `outputfile_name`}}-vagrant-{{user `timestamper`}}.tar"
},
{
"type": "amazon-import",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `region`}}",
"ami_name": "TIER-Shibb Build: {{user `build_number`}}",
"s3_bucket_name": "internet2-tier-ami-import-us-west-1",
"tags": {
"Description": "packer amazon-import-shibboleth-appliance {{user `timestamper`}}"
"Description": "packer amazon-import-shibboleth-appliance {{user `timestamper`}}",
"Name": "TIER-Shibb Build: {{user `build_number`}}"
}
}
]
Expand Down