Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,529
Community Members
 
Community Events
176
Community Groups

Can we use pipe inside custom pipe ?

Narendra I'm New Here Dec 14, 2022

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  

1 answer

0 votes

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

Narendra I'm New Here Dec 18, 2022

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 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Atlassian Community Events