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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

Get context of a deploying step "Redeploying"


Is it possible to determine if the step is performing a regular deployment or a redeployment?

I need this context to be able to perform custom functionality if the step is redeploying instead of just a regular deploy.

Checking all the environment variables, Bitbucket doesn't seem to expose anything. Best I think I could do is check the current build number or commit hash and determine if it's a redeploy based on that.

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 08, 2022

Hey @Alan Dragicevich ,

Thank you for reaching out to Atlassian Community!

I'm afraid there's currently no direct way of identifying if a given step is a re-deployment. I do understand how this feature could benefit your use case to build custom logic based on this information, so I went ahead and created a feature request to include an environment variable that exposes if the step is a normal deploy or a re-deploy : 

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

While this feature is not implemented, one of the workarounds would be for you to manually check within your step's script if the commit being deployed is the same commit that is already currently in the target deployment environment, which would confirm it's a re-deploy.

Let me know if you have any questions.

Thank you, @Alan Dragicevich .

Kind regards,

Patrik S

For you workaround solution, would I need to use the Bitbucket API for this?

I will give it a go.

Thanks heaps!

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 13, 2022

Hey @Alan Dragicevich .

To get the commit currently running in the pipeline, you can use the default environment variable BITBUCKET_COMMIT.

As for the commit currently deployed to the destination environment, you would have to implement this manually, for example, by saving a file in the destination server with the last commit deployed, and checking for that file every time you do a new deploy to confirm if the commit is the same (which would configure a re-deploy) or different.

Thank you, @Alan Dragicevich .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events