You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.