Skip to content

Commit

Permalink
chore: update soci-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
tmokmss committed Feb 26, 2024
1 parent 9129f46 commit a38af22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/soci-index-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export class SociIndexBuild extends Construct {
constructor(scope: Construct, id: string, props: SociIndexBuildProps) {
super(scope, id);

const binaryUrl = 'https://github.com/tmokmss/soci-wrapper/releases/download/v0.1.1/soci-wrapper-v0.1.1-linux-amd64.tar.gz';
const sociWrapperVersion = 'v0.1.2';

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

const handler = new SingletonFunction(this, 'CustomResourceHandler', {
// Use raw string to avoid from tightening CDK version requirement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
]
},
"Source": {
"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.1.1/soci-wrapper-v0.1.1-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_NAME $DIGEST $AWS_REGION $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 -vv -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}",
"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.1.2/soci-wrapper-v0.1.2-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_NAME $DIGEST $AWS_REGION $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 -vv -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}",
"Type": "NO_SOURCE"
},
"Cache": {
Expand Down
2 changes: 1 addition & 1 deletion test/soci-index-build.integ.snapshot/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
},
"source": {
"type": "NO_SOURCE",
"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.1.1/soci-wrapper-v0.1.1-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_NAME $DIGEST $AWS_REGION $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 -vv -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}"
"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.1.2/soci-wrapper-v0.1.2-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_NAME $DIGEST $AWS_REGION $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 -vv -i -X PUT -H 'Content-Type:' -d \\\"@payload.json\\\" \\\"$responseURL\\\"\\n \"\n ]\n }\n }\n}"
},
"cache": {
"type": "NO_CACHE"
Expand Down

0 comments on commit a38af22

Please sign in to comment.