Hi Team,
We are creating our custom pipe using Python/Bash.
We want push images to ecr as one of task which we have in our custom pipe, there is aws-ecr-push pipe is available.
Can I use existing pipe inside my custom pipe. If yes, Can you please point me.
Appreciate your help.
Thanks
Narendra
Hi @Narendra
Thank you for your question!
If I understand you correct, there could be the next cases:
1) implement your workflow logic in multiple files and combine them with the pipe accordingly:
- step: oidc: true script:
# <do some pre-build logic> # build the image - docker build -t my-docker-image .
# <do some additional logic here>
# <./run.sh execute some shell scripts here> # use the pipe to push the image to AWS ECR - pipe: atlassian/aws-ecr-push-image:1.6.2 variables: AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/role_name' IMAGE_NAME: my-docker-image
2) or if you want to extend/modify the pipe functionality you could write own custom pipe and use inheritance. A good example is here.
Welcome to share your experience with the community.
Best regards,
Oleksandr Kyrdan
Hi Oleksandr,
Thank you for your response, Im looking in following way as my custom pipe.
1. bitbucket-pipeline.yml
====================
- pipe: <company_repo>/<company-ecr-custom-name-pipe>:<version> variables: AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/role_name' IMAGE_NAME: my-docker-image
OPERATIONS : ["PUSH", "RESTART"]
KEY1 : VALUE1
KEY2 : VALUE2
2. Custom Pipe should able to do push when user:
Ex:
My custom pipe should use internally, aws-ecr-push-image:1.6.1 pipe, if user given PUSH in OPERATIONS variable.
- pipe: atlassian/aws-ecr-push-image:1.6.2
I hope above example gives what I'm looking. Please let me know in case if you require more details.
Appreciate your pointers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.