create-amis.sh: Change directory for AMIs
This commit is contained in:
parent
4c0cc62d29
commit
b240822cfa
|
@ -10,7 +10,7 @@ version=$(nix-instantiate --eval --strict '<nixpkgs>' -A lib.version | sed s/'"'
|
||||||
major=${version:0:5}
|
major=${version:0:5}
|
||||||
echo "NixOS version is $version ($major)"
|
echo "NixOS version is $version ($major)"
|
||||||
|
|
||||||
stateDir=/var/tmp/ec2-image-$version
|
stateDir=/home/deploy/amis/ec2-image-$version
|
||||||
echo "keeping state in $stateDir"
|
echo "keeping state in $stateDir"
|
||||||
mkdir -p $stateDir
|
mkdir -p $stateDir
|
||||||
|
|
||||||
|
@ -161,6 +161,7 @@ for type in $types; do
|
||||||
# Create a snapshot.
|
# Create a snapshot.
|
||||||
if [ -z "$snapId" ]; then
|
if [ -z "$snapId" ]; then
|
||||||
echo "creating snapshot..."
|
echo "creating snapshot..."
|
||||||
|
# FIXME: this can fail with InvalidVolume.NotFound. Eventual consistency yay.
|
||||||
snapId=$(aws ec2 create-snapshot --volume-id "$volId" --region "$region" --description "$description" | jq -r .SnapshotId)
|
snapId=$(aws ec2 create-snapshot --volume-id "$volId" --region "$region" --description "$description" | jq -r .SnapshotId)
|
||||||
if [ "$snapId" = null ]; then exit 1; fi
|
if [ "$snapId" = null ]; then exit 1; fi
|
||||||
echo -n "$snapId" > $stateDir/$region.$type.snap-id
|
echo -n "$snapId" > $stateDir/$region.$type.snap-id
|
||||||
|
|
Loading…
Reference in New Issue