Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alinadima committed Sep 12, 2023
1 parent 469205a commit 4c464e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion lib/demo-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { Bucket, IBucket } from 'aws-cdk-lib/aws-s3';
import { SourceRepo, ProjectKind } from './constructs/source-repo';
import { VMImportBucket } from './vm-import-bucket';
import { Asset } from 'aws-cdk-lib/aws-s3-assets';
import { IAsset } from 'aws-cdk-lib';

const MAX_ALLOWED_LENGTH = 50;

Expand Down
2 changes: 1 addition & 1 deletion source-repo/poky-ami/build.buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ phases:
- aws s3 cp ${SCRIPT_URL} $CODEBUILD_SRC_DIR/create-ec2-ami.sh
# - chmod +x $CODEBUILD_SRC_DIR/create-ec2-ami.sh
- chmod +x $CODEBUILD_SRC_DIR/create-ec2-ami.sh
- $CODEBUILD_SRC_DIR/$SCRIPT $IMPORT_BUCKET 16 core-image-minimal aws-ec2-arm64 $TMP_DIR/tmp $ROLE_NAME
- $CODEBUILD_SRC_DIR/create-ec2-ami.sh $IMPORT_BUCKET 16 core-image-minimal aws-ec2-arm64 $TMP_DIR/tmp $ROLE_NAME
artifacts:
discard-paths: true
files:
Expand Down
10 changes: 4 additions & 6 deletions source-repo/poky-ami/create-ec2-ami.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,17 @@ echo TARGET_ARCH=$TARGET_ARCH
echo IMAGE_ROOTFS_SIZE=$IMAGE_ROOTFS_SIZE
echo AMI_DISK_SIZE_GB=$AMI_DISK_SIZE_GB

echo "Converting ${IMAGE_NAME}.wic.vhdx to raw format"
qemu-img convert -f vhdx -O raw ${IMG_DIR}/${IMAGE_NAME}.wic.vhdx ${IMG_DIR}/${IMAGE_NAME}.rootfs.raw

echo "Pushing image ${IMAGE_NAME}.rootfs.raw to s3://${IMPORT_BUCKET_NAME}"
aws s3 cp ${IMG_DIR}/${IMAGE_NAME}.rootfs.raw s3://${IMPORT_BUCKET_NAME}
echo "Pushing image ${IMAGE_NAME}.wic.vhd to s3://${IMPORT_BUCKET_NAME}"
aws s3 cp ${IMG_DIR}/${IMAGE_NAME}.wic.vhd s3://${IMPORT_BUCKET_NAME}

cat <<EOF > image-import.json
{
"Description": "ewaol docker image",
"Format": "raw",
"Format": "vhd",
"UserBucket": {
"S3Bucket": "${IMPORT_BUCKET_NAME}",
"S3Key": "${IMAGE_NAME}.rootfs.raw"
"S3Key": "${IMAGE_NAME}.wic.vhd"
}
}
EOF
Expand Down

0 comments on commit 4c464e2

Please sign in to comment.