Skip to content

Commit 3291677

Browse files
Update 34003900_aws_retagging.up.sql
1 parent ce5b4e6 commit 3291677

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/sql/34003900_aws_retagging.up.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ INSERT INTO "plugin_pipeline_script" ("id", "script","type","deleted","created_o
2424
else
2525
echo "No Tags Provided for retagging"
2626
fi
27+
echo $Tag
2728
AwsAccessKey="${AwsAccessEcrKey:-$(echo "$CI_CD_EVENT" | jq -r \'.commonWorkflowRequest.accessKey\')}"
2829
AwsSecretKey="${AwsSecretEcrKey:-$(echo "$CI_CD_EVENT" | jq -r \'.commonWorkflowRequest.secretKey\')}"
2930
mkdir -p ~/.aws
@@ -39,12 +40,12 @@ INSERT INTO "plugin_pipeline_script" ("id", "script","type","deleted","created_o
3940
image_repo=$(echo $CI_CD_EVENT | jq -r .commonWorkflowRequest.dockerRepository)
4041
image_tag=$(echo $CI_CD_EVENT | jq -r .commonWorkflowRequest.dockerImageTag)
4142
MANIFEST=$(aws ecr batch-get-image --repository-name $image_repo --image-ids imageTag=$image_tag --region $Region --output text --query \'images[].imageManifest\')
42-
aws ecr put-image --repository-name $image_repo --image-tag=$AwsEcrFixedTag --image-manifest "$MANIFEST" --region $Region
43+
aws ecr put-image --repository-name $image_repo --image-tag=$Tag --image-manifest "$MANIFEST" --region $Region
4344
elif [[ "$pipeline_type" == "CD" ]]; then
4445
image_repo=$(echo $CI_CD_EVENT | jq -r .commonWorkflowRequest.ciArtifactDTO.image | cut -d\'/\' -f2 | cut -d\':\' -f1)
4546
image_tag=$(echo $CI_CD_EVENT | jq -r .commonWorkflowRequest.ciArtifactDTO.image | cut -d \':\' -f2)
4647
MANIFEST=$(aws ecr batch-get-image --repository-name $image_repo --image-ids imageTag=$image_tag --region $Region --output text --query \'images[].imageManifest\')
47-
aws ecr put-image --repository-name $image_repo --image-tag=$AwsEcrFixedTag --image-manifest "$MANIFEST" --region $Region
48+
aws ecr put-image --repository-name $image_repo --image-tag=$Tag --image-manifest "$MANIFEST" --region $Region
4849
fi
4950
if [ $? -ne 0 ]; then
5051
echo "*************Failed to Retag the image****************"
@@ -61,4 +62,4 @@ INSERT INTO plugin_step_variable (id,plugin_step_id,name,format,description,is_e
6162
VALUES (nextval('id_seq_plugin_step_variable'),(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='AWS ECR Retag' and p.plugin_version='1.0.0' and ps."index"=1 and ps.deleted=false),'AwsEcrFixedTag','STRING','Provide the fixed tag for retagging','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1),
6263
(nextval('id_seq_plugin_step_variable'),(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='AWS ECR Retag' and p.plugin_version='1.0.0' and ps."index"=1 and ps.deleted=false),'AwsEcrTagPrefix','STRING','Provide the tag prefix','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1),
6364
(nextval('id_seq_plugin_step_variable'),(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='AWS ECR Retag' and p.plugin_version='1.0.0' and ps."index"=1 and ps.deleted=false),'AwsAccessEcrKey','STRING','Provide the access key with ECR permission','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1),
64-
(nextval('id_seq_plugin_step_variable'),(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='AWS ECR Retag' and p.plugin_version='1.0.0' and ps."index"=1 and ps.deleted=false),'AwsSecretEcrKey','STRING','Provide the secret key with ECR permission','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1);
65+
(nextval('id_seq_plugin_step_variable'),(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='AWS ECR Retag' and p.plugin_version='1.0.0' and ps."index"=1 and ps.deleted=false),'AwsSecretEcrKey','STRING','Provide the secret key with ECR permission','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1);

0 commit comments

Comments
 (0)