mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 12:38:11 +00:00
Added changes to support nightly builds for AWS
This commit is contained in:
parent
8683f7119c
commit
8f87c5c223
@ -16,6 +16,8 @@ export AWS_DEFAULT_REGION=$(current_instance_region)
|
|||||||
|
|
||||||
# TODO(nathanleclaire): This device could be calculated dynamically to avoid conflicts.
|
# TODO(nathanleclaire): This device could be calculated dynamically to avoid conflicts.
|
||||||
EBS_DEVICE=/dev/xvdb
|
EBS_DEVICE=/dev/xvdb
|
||||||
|
CHANNEL=${CHANNEL:-editions}
|
||||||
|
DAY=$(date +"%m_%d_%Y")
|
||||||
|
|
||||||
bake_image()
|
bake_image()
|
||||||
{
|
{
|
||||||
@ -26,7 +28,7 @@ bake_image()
|
|||||||
--size 20 \
|
--size 20 \
|
||||||
--availability-zone $(current_instance_az) | jq -r .VolumeId)
|
--availability-zone $(current_instance_az) | jq -r .VolumeId)
|
||||||
|
|
||||||
tag ${VOLUME_ID}
|
tag ${VOLUME_ID} ${DAY} ${CHANNEL}
|
||||||
|
|
||||||
aws ec2 wait volume-available --volume-ids ${VOLUME_ID}
|
aws ec2 wait volume-available --volume-ids ${VOLUME_ID}
|
||||||
|
|
||||||
@ -48,7 +50,7 @@ bake_image()
|
|||||||
--volume-id ${VOLUME_ID} \
|
--volume-id ${VOLUME_ID} \
|
||||||
--description "Snapshot of Moby device for AMI baking" | jq -r .SnapshotId)
|
--description "Snapshot of Moby device for AMI baking" | jq -r .SnapshotId)
|
||||||
|
|
||||||
tag ${SNAPSHOT_ID}
|
tag ${SNAPSHOT_ID} ${DAY} ${CHANNEL}
|
||||||
|
|
||||||
arrowecho "Waiting for snapshot completion"
|
arrowecho "Waiting for snapshot completion"
|
||||||
|
|
||||||
@ -70,7 +72,7 @@ bake_image()
|
|||||||
}
|
}
|
||||||
]" | jq -r .ImageId)
|
]" | jq -r .ImageId)
|
||||||
|
|
||||||
tag ${IMAGE_ID}
|
tag ${IMAGE_ID} ${DAY} ${CHANNEL}
|
||||||
|
|
||||||
# Boom, now you (should) have a Moby AMI.
|
# Boom, now you (should) have a Moby AMI.
|
||||||
arrowecho "Created AMI: ${IMAGE_ID}"
|
arrowecho "Created AMI: ${IMAGE_ID}"
|
||||||
@ -137,9 +139,9 @@ case "$1" in
|
|||||||
bake_image
|
bake_image
|
||||||
;;
|
;;
|
||||||
clean)
|
clean)
|
||||||
arrowecho "Cleaning resources from previous build tag if applicable..."
|
arrowecho "Cleaning resources from previous build tag (${TAG_KEY_PREV}) if applicable..."
|
||||||
clean_tagged_resources "${TAG_KEY_PREV}"
|
clean_tagged_resources "${TAG_KEY_PREV}"
|
||||||
arrowecho "Cleaning resources from current build tag if applicable..."
|
arrowecho "Cleaning resources from current build tag (${TAG_KEY}) if applicable..."
|
||||||
clean_tagged_resources "${TAG_KEY}"
|
clean_tagged_resources "${TAG_KEY}"
|
||||||
;;
|
;;
|
||||||
clean-mount)
|
clean-mount)
|
||||||
|
@ -29,6 +29,8 @@ current_instance_id()
|
|||||||
# cleaned up later.
|
# cleaned up later.
|
||||||
tag()
|
tag()
|
||||||
{
|
{
|
||||||
arrowecho "Tagging $1"
|
arrowecho "Tagging $1 with ${TAG_KEY}, $2, and $3"
|
||||||
aws ec2 create-tags --resources "$1" --tags "Key=${TAG_KEY},Value=" >/dev/null
|
aws ec2 create-tags --resources "$1" --tags "Key=${TAG_KEY},Value=" >/dev/null
|
||||||
|
aws ec2 create-tags --resources "$1" --tags "Key=date,Value=$2" >/dev/null
|
||||||
|
aws ec2 create-tags --resources "$1" --tags "Key=channel,Value=$3" >/dev/null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user