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,298,257
Community Members
 
Community Events
165
Community Groups

Is it possible to skip a push if image already exists in ECR?

I have a pipe which pushes to Amazon ECR. The repository is immutable. Can I configure the plugin, so that the pipeline skips pushing the image, if it already exists in ECR?

1 answer

0 votes
Mark C Atlassian Team Jun 02, 2022

Hi @Tom Müller

Welcome to the community.

Unfortunately, it's not possible to skip the entire build for validating if an ECR image exists.
However, I do believe it would be possible if you could validate if an ECR image exists first then do a signal through an environment variable and lastly, do an if/else against the result.

Here's an example YAML configuration:

pipelines:
  default:
    - step:
        name: Test
        script:
          - export ECR_PUSH=0
          - echo "Validation here" # Validate if an ECR exists here then change the ECR_PUSH to 1 if it exists
          - if [ $ECR_PUSH = 1 ]; then echo "Proceed"; else exit 0; fi
          - pipe: some/pipes_here:1.0.1
            variables:
              VAR_TEST: "TEST"

Hope it helps and let me know if you have further questions that I can help with.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,225 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you