Skip to content

Commit

Permalink
fix: add check, update bucket name
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjydev committed May 1, 2024
1 parent 86ec838 commit 5dfad62
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
ami_bucket := "altf4llc-hayden-test-nix-amis"
ami_bucket := "altf4llc-nix-ami-uploads"

check:
nix flake check

build profile:
nix build --json --print-build-logs --no-link '.#{{profile}}'
Expand All @@ -17,7 +20,7 @@ publish-ami profile:
aws s3 cp "$OUTPUT/$IMAGE_PATH" "s3://{{ami_bucket}}/$IMAGE_NAME.vhd"

echo "Starting snapshot import."
TASK_ID=$(aws ec2 import-snapshot --disk-container "Format=VHD,UserBucket={S3Bucket=altf4llc-hayden-test-nix-amis,S3Key=$IMAGE_NAME.vhd}" --output json | jq -r ".ImportTaskId")
TASK_ID=$(aws ec2 import-snapshot --disk-container "Format=VHD,UserBucket={S3Bucket={{ami_bucket}},S3Key=$IMAGE_NAME.vhd}" --output json | jq -r ".ImportTaskId")

echo "Waiting for snapshot import to complete."
until [[ $(aws ec2 describe-import-snapshot-tasks --import-task-ids "$TASK_ID" --output json | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.Status') == "completed" ]]; do
Expand Down

0 comments on commit 5dfad62

Please sign in to comment.