Skip to content

Commit 7410baf

Browse files
authored
chore: use soci-wrapper v0.2.8 (#69)
This version enables immutable release to prevent replacement of binary after the release.
1 parent ba20e66 commit 7410baf

File tree

14 files changed

+29
-29
lines changed

14 files changed

+29
-29
lines changed

src/soci-index-build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class SociIndexBuild extends Construct {
4646
constructor(scope: Construct, id: string, props: SociIndexBuildProps) {
4747
super(scope, id);
4848

49-
const sociWrapperVersion = 'v0.2.3';
49+
const sociWrapperVersion = 'v0.2.8';
5050

5151
const binaryUrl = `https://github.com/tmokmss/soci-wrapper/releases/download/${sociWrapperVersion}/soci-wrapper-${sociWrapperVersion}-linux-amd64.tar.gz`;
5252

src/soci-index-v2-build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class SociIndexV2Build extends Construct {
5353
constructor(scope: Construct, id: string, props: SociIndexV2BuildProps) {
5454
super(scope, id);
5555

56-
const sociWrapperVersion = 'v0.2.3';
56+
const sociWrapperVersion = 'v0.2.8';
5757
const outputImageTagKey = 'outputImageTag';
5858

5959
const binaryUrl = `https://github.com/tmokmss/soci-wrapper/releases/download/${sociWrapperVersion}/soci-wrapper-${sociWrapperVersion}-linux-amd64.tar.gz`;

test/integ.soci-index-build.js.snapshot/SociIndexBuildIntegTest.assets.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@
1515
}
1616
}
1717
},
18-
"46609e7040f8fc916921cdec9665cb2417ae801ef6880b81c01644e695cb0456": {
18+
"76195c38eaf557c67ea70599b5dda4b410341e3d8c399a62982da3b8939bc096": {
1919
"displayName": "SociIndexBuildIntegTest Template",
2020
"source": {
2121
"path": "SociIndexBuildIntegTest.template.json",
2222
"packaging": "file"
2323
},
2424
"destinations": {
25-
"current_account-current_region-73a859b6": {
25+
"current_account-current_region-c4474572": {
2626
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
27-
"objectKey": "46609e7040f8fc916921cdec9665cb2417ae801ef6880b81c01644e695cb0456.json",
27+
"objectKey": "76195c38eaf557c67ea70599b5dda4b410341e3d8c399a62982da3b8939bc096.json",
2828
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2929
}
3030
}
3131
}
3232
},
3333
"dockerImages": {
34-
"e1555cac621b51df07a3be311fb40203615c77b74beddebe9903793bfa83f87c": {
34+
"b5b2e806ac7e624cdeff2f17c2d32395f79223a11c6b7158c086c5444edc6f5f": {
3535
"displayName": "Image1/Image",
3636
"source": {
37-
"directory": "asset.e1555cac621b51df07a3be311fb40203615c77b74beddebe9903793bfa83f87c",
37+
"directory": "asset.b5b2e806ac7e624cdeff2f17c2d32395f79223a11c6b7158c086c5444edc6f5f",
3838
"dockerBuildArgs": {
39-
"DUMMY_FILE_SIZE_MB": "10"
39+
"DUMMY_FILE_SIZE_MB": "11"
4040
}
4141
},
4242
"destinations": {
43-
"current_account-current_region-5f91a38f": {
43+
"current_account-current_region-b9bd9bdb": {
4444
"repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}",
45-
"imageTag": "e1555cac621b51df07a3be311fb40203615c77b74beddebe9903793bfa83f87c",
45+
"imageTag": "b5b2e806ac7e624cdeff2f17c2d32395f79223a11c6b7158c086c5444edc6f5f",
4646
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}"
4747
}
4848
}

test/integ.soci-index-build.js.snapshot/SociIndexBuildIntegTest.template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
]
1111
},
1212
"type": "SociIndexBuild",
13-
"imageTag": "e1555cac621b51df07a3be311fb40203615c77b74beddebe9903793bfa83f87c",
13+
"imageTag": "b5b2e806ac7e624cdeff2f17c2d32395f79223a11c6b7158c086c5444edc6f5f",
1414
"repositoryName": {
1515
"Fn::Sub": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}"
1616
},
@@ -310,7 +310,7 @@
310310
]
311311
},
312312
"Source": {
313-
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"current_dir=$(pwd)\",\n \"wget --quiet -O soci-wrapper.tar.gz https://github.com/tmokmss/soci-wrapper/releases/download/v0.2.3/soci-wrapper-v0.2.3-linux-amd64.tar.gz\",\n \"tar -xvzf soci-wrapper.tar.gz\",\n \"\",\n \"export AWS_ACCOUNT=$(aws sts get-caller-identity --query \\\"Account\\\" --output text)\",\n \"export REGISTRY_USER=AWS\",\n \"export REGISTRY_PASSWORD=$(aws ecr get-login-password --region $AWS_REGION)\",\n \"export REGISTRY=$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com\",\n \"aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REGISTRY\",\n \"REPO_NAME=$repositoryName\",\n \"IMAGE_TAG=$imageTag\",\n \"DIGEST=$(aws ecr describe-images --repository-name $REPO_NAME --image-ids imageTag=$IMAGE_TAG --query imageDetails[0].imageDigest --output text)\",\n \"./soci-wrapper --repo $REPO_NAME --digest $DIGEST --region $AWS_REGION --account $AWS_ACCOUNT\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"echo Build completed on `date`\",\n \"\\nSTATUS='SUCCESS'\\nif [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ] # Test if the build is failing\\nthen\\nSTATUS='FAILED'\\nREASON=\\\"deploy-time-build failed. See CloudWatch Log stream for the detailed reason: \\nhttps://$AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$AWS_REGION#logsV2:log-groups/log-group/\\\\$252Faws\\\\$252Fcodebuild\\\\$252F$projectName/log-events/$CODEBUILD_LOG_PATH\\\"\\nfi\\ncat <<EOF > payload.json\\n{\\n \\\"StackId\\\": \\\"$stackId\\\",\\n \\\"RequestId\\\": \\\"$requestId\\\",\\n \\\"LogicalResourceId\\\":\\\"$logicalResourceId\\\",\\n \\\"PhysicalResourceId\\\": \\\"$imageTag\\\",\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"Reason\\\": \\\"$REASON\\\"\\n}\\nEOF\\ncurl -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}",
313+
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"current_dir=$(pwd)\",\n \"wget --quiet -O soci-wrapper.tar.gz https://github.com/tmokmss/soci-wrapper/releases/download/v0.2.8/soci-wrapper-v0.2.8-linux-amd64.tar.gz\",\n \"tar -xvzf soci-wrapper.tar.gz\",\n \"\",\n \"export AWS_ACCOUNT=$(aws sts get-caller-identity --query \\\"Account\\\" --output text)\",\n \"export REGISTRY_USER=AWS\",\n \"export REGISTRY_PASSWORD=$(aws ecr get-login-password --region $AWS_REGION)\",\n \"export REGISTRY=$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com\",\n \"aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REGISTRY\",\n \"REPO_NAME=$repositoryName\",\n \"IMAGE_TAG=$imageTag\",\n \"DIGEST=$(aws ecr describe-images --repository-name $REPO_NAME --image-ids imageTag=$IMAGE_TAG --query imageDetails[0].imageDigest --output text)\",\n \"./soci-wrapper --repo $REPO_NAME --digest $DIGEST --region $AWS_REGION --account $AWS_ACCOUNT\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"echo Build completed on `date`\",\n \"\\nSTATUS='SUCCESS'\\nif [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ] # Test if the build is failing\\nthen\\nSTATUS='FAILED'\\nREASON=\\\"deploy-time-build failed. See CloudWatch Log stream for the detailed reason: \\nhttps://$AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$AWS_REGION#logsV2:log-groups/log-group/\\\\$252Faws\\\\$252Fcodebuild\\\\$252F$projectName/log-events/$CODEBUILD_LOG_PATH\\\"\\nfi\\ncat <<EOF > payload.json\\n{\\n \\\"StackId\\\": \\\"$stackId\\\",\\n \\\"RequestId\\\": \\\"$requestId\\\",\\n \\\"LogicalResourceId\\\":\\\"$logicalResourceId\\\",\\n \\\"PhysicalResourceId\\\": \\\"$imageTag\\\",\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"Reason\\\": \\\"$REASON\\\"\\n}\\nEOF\\ncurl -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}",
314314
"Type": "NO_SOURCE"
315315
}
316316
}

test/integ.soci-index-build.js.snapshot/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"validateOnSynth": false,
1919
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2020
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
21-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/46609e7040f8fc916921cdec9665cb2417ae801ef6880b81c01644e695cb0456.json",
21+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/76195c38eaf557c67ea70599b5dda4b410341e3d8c399a62982da3b8939bc096.json",
2222
"requiresBootstrapStackVersion": 6,
2323
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2424
"additionalDependencies": [

test/integ.soci-index-build.js.snapshot/tree.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

test/integ.soci-index-build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestStack extends Stack {
1515
const parent = new Construct(this, 'Image1');
1616
const asset = new DockerImageAsset(parent, 'Image', {
1717
directory: '../example/example-image',
18-
buildArgs: { DUMMY_FILE_SIZE_MB: '10' },
18+
buildArgs: { DUMMY_FILE_SIZE_MB: '11' },
1919
});
2020
new SociIndexBuild(parent, 'Index', { imageTag: asset.assetHash, repository: asset.repository });
2121
}

test/integ.soci-index-v2-build.js.snapshot/SociIndexBuildIntegTest.assets.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@
1515
}
1616
}
1717
},
18-
"c7ba3d11950563a1b1d8cfd9e5b9a8cdafd3b4968588d5c2b1bdad37396e98fd": {
18+
"671fd67999ea8d2a0faccca65f99e4e3992509a09fba9e8b2986022f55a1bf08": {
1919
"displayName": "SociIndexBuildIntegTest Template",
2020
"source": {
2121
"path": "SociIndexBuildIntegTest.template.json",
2222
"packaging": "file"
2323
},
2424
"destinations": {
25-
"current_account-current_region-144197d1": {
25+
"current_account-current_region-b484a72e": {
2626
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
27-
"objectKey": "c7ba3d11950563a1b1d8cfd9e5b9a8cdafd3b4968588d5c2b1bdad37396e98fd.json",
27+
"objectKey": "671fd67999ea8d2a0faccca65f99e4e3992509a09fba9e8b2986022f55a1bf08.json",
2828
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2929
}
3030
}
3131
}
3232
},
3333
"dockerImages": {
34-
"1c77e03c6438a0ad32761c65360c7503408a3f52ff35b9e3a42424a53ddebd50": {
34+
"ab5f508a32d9a54cc5ef4fce0f1fc903ea92d9855fab266412129dd4a0b0d45f": {
3535
"displayName": "Image1/Image",
3636
"source": {
37-
"directory": "asset.1c77e03c6438a0ad32761c65360c7503408a3f52ff35b9e3a42424a53ddebd50",
37+
"directory": "asset.ab5f508a32d9a54cc5ef4fce0f1fc903ea92d9855fab266412129dd4a0b0d45f",
3838
"dockerBuildArgs": {
39-
"DUMMY_FILE_SIZE_MB": "10",
39+
"DUMMY_FILE_SIZE_MB": "11",
4040
"HASH": "2b2834c69e12688b5211141adea6ccad"
4141
}
4242
},
4343
"destinations": {
44-
"current_account-current_region-5ef7b1a6": {
44+
"current_account-current_region-40c0e7ad": {
4545
"repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}",
46-
"imageTag": "1c77e03c6438a0ad32761c65360c7503408a3f52ff35b9e3a42424a53ddebd50",
46+
"imageTag": "ab5f508a32d9a54cc5ef4fce0f1fc903ea92d9855fab266412129dd4a0b0d45f",
4747
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}"
4848
}
4949
}

test/integ.soci-index-v2-build.js.snapshot/SociIndexBuildIntegTest.template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
]
1111
},
1212
"type": "SociIndexV2Build",
13-
"inputImageTag": "1c77e03c6438a0ad32761c65360c7503408a3f52ff35b9e3a42424a53ddebd50",
14-
"outputImageTag": "1c77e03c6438a0ad32761c65360c7503408a3f52ff35b9e3a42424a53ddebd50-soci",
13+
"inputImageTag": "ab5f508a32d9a54cc5ef4fce0f1fc903ea92d9855fab266412129dd4a0b0d45f",
14+
"outputImageTag": "ab5f508a32d9a54cc5ef4fce0f1fc903ea92d9855fab266412129dd4a0b0d45f-soci",
1515
"repositoryName": {
1616
"Fn::Sub": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}"
1717
},
@@ -311,7 +311,7 @@
311311
]
312312
},
313313
"Source": {
314-
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"current_dir=$(pwd)\",\n \"wget --quiet -O soci-wrapper.tar.gz https://github.com/tmokmss/soci-wrapper/releases/download/v0.2.3/soci-wrapper-v0.2.3-linux-amd64.tar.gz\",\n \"tar -xvzf soci-wrapper.tar.gz\",\n \"\",\n \"export AWS_ACCOUNT=$(aws sts get-caller-identity --query \\\"Account\\\" --output text)\",\n \"export REGISTRY_USER=AWS\",\n \"export REGISTRY_PASSWORD=$(aws ecr get-login-password --region $AWS_REGION)\",\n \"export REGISTRY=$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com\",\n \"aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REGISTRY\",\n \"REPO_NAME=$repositoryName\",\n \"IMAGE_TAG=$inputImageTag\",\n \"DIGEST=$(aws ecr describe-images --repository-name $REPO_NAME --image-ids imageTag=$IMAGE_TAG --query imageDetails[0].imageDigest --output text)\",\n \"./soci-wrapper --repo $REPO_NAME --digest $DIGEST --region $AWS_REGION --account $AWS_ACCOUNT --soci-version V2 --output-tag $outputImageTag\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"echo Build completed on `date`\",\n \"\\nSTATUS='SUCCESS'\\nif [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ] # Test if the build is failing\\nthen\\nSTATUS='FAILED'\\nREASON=\\\"deploy-time-build failed. See CloudWatch Log stream for the detailed reason: \\nhttps://$AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$AWS_REGION#logsV2:log-groups/log-group/\\\\$252Faws\\\\$252Fcodebuild\\\\$252F$projectName/log-events/$CODEBUILD_LOG_PATH\\\"\\nfi\\ncat <<EOF > payload.json\\n{\\n \\\"StackId\\\": \\\"$stackId\\\",\\n \\\"RequestId\\\": \\\"$requestId\\\",\\n \\\"LogicalResourceId\\\":\\\"$logicalResourceId\\\",\\n \\\"PhysicalResourceId\\\": \\\"$outputImageTag\\\",\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"Reason\\\": \\\"$REASON\\\",\\n \\\"Data\\\": {\\n \\\"outputImageTag\\\": \\\"$outputImageTag\\\"\\n }\\n}\\nEOF\\ncurl -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}",
314+
"BuildSpec": "{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"current_dir=$(pwd)\",\n \"wget --quiet -O soci-wrapper.tar.gz https://github.com/tmokmss/soci-wrapper/releases/download/v0.2.8/soci-wrapper-v0.2.8-linux-amd64.tar.gz\",\n \"tar -xvzf soci-wrapper.tar.gz\",\n \"\",\n \"export AWS_ACCOUNT=$(aws sts get-caller-identity --query \\\"Account\\\" --output text)\",\n \"export REGISTRY_USER=AWS\",\n \"export REGISTRY_PASSWORD=$(aws ecr get-login-password --region $AWS_REGION)\",\n \"export REGISTRY=$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com\",\n \"aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REGISTRY\",\n \"REPO_NAME=$repositoryName\",\n \"IMAGE_TAG=$inputImageTag\",\n \"DIGEST=$(aws ecr describe-images --repository-name $REPO_NAME --image-ids imageTag=$IMAGE_TAG --query imageDetails[0].imageDigest --output text)\",\n \"./soci-wrapper --repo $REPO_NAME --digest $DIGEST --region $AWS_REGION --account $AWS_ACCOUNT --soci-version V2 --output-tag $outputImageTag\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"echo Build completed on `date`\",\n \"\\nSTATUS='SUCCESS'\\nif [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ] # Test if the build is failing\\nthen\\nSTATUS='FAILED'\\nREASON=\\\"deploy-time-build failed. See CloudWatch Log stream for the detailed reason: \\nhttps://$AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$AWS_REGION#logsV2:log-groups/log-group/\\\\$252Faws\\\\$252Fcodebuild\\\\$252F$projectName/log-events/$CODEBUILD_LOG_PATH\\\"\\nfi\\ncat <<EOF > payload.json\\n{\\n \\\"StackId\\\": \\\"$stackId\\\",\\n \\\"RequestId\\\": \\\"$requestId\\\",\\n \\\"LogicalResourceId\\\":\\\"$logicalResourceId\\\",\\n \\\"PhysicalResourceId\\\": \\\"$outputImageTag\\\",\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"Reason\\\": \\\"$REASON\\\",\\n \\\"Data\\\": {\\n \\\"outputImageTag\\\": \\\"$outputImageTag\\\"\\n }\\n}\\nEOF\\ncurl -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}",
315315
"Type": "NO_SOURCE"
316316
}
317317
}

0 commit comments

Comments
 (0)