Skip to content

add AMI name with product and build #18

Merged
merged 13 commits into from
Feb 11, 2017
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
12 changes: 4 additions & 8 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,19 +63,15 @@
"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`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `region`}}",
"s3_bucket_name": "internet2-ami-import-us-west-1",
"tags": {
"Description": "packer amazon-import-comanage-appliance {{user `timestamper`}}"
"Description": "packer amazon-import-comanage-appliance {{user `timestamper`}}",
"Name": "TIER-Shibb Build: {{user `build_number`}}"
}
}
]
Expand Down
8 changes: 2 additions & 6 deletions grouper-appliance.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,15 @@
"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`}}",
"s3_bucket_name": "internet2-tier-ami-import-us-west-1",
"tags": {
"Description": "packer amazon-import-grouper-appliance {{user `timestamper`}}"
"Description": "packer amazon-import-grouper-appliance {{user `timestamper`}}",
"Name": "TIER-Shibb Build: {{user `build_number`}}"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions scripts/cleanup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash -eux

# Remove Ansible and its dependencies.
yum -y remove ansible

# Zero out the rest of the free space using dd, then delete the written file.
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
11 changes: 4 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,15 @@
"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`}}",
"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