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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is it possible to get previously deployed branch name in pipeline stage? Edited

So, we're using a staging server to test different branches before going to production.

And upon pipeline success we provide QA engineer possibility to deploy this new branch on staging. Then he might deploy another branch to test it.

What we want to do is revert DB state to what it was at commit from which both branches grow before applying current branch db state.

We use django migrations so it's easy to revert things if we know previously deployed commit/branch name.

So... is it possible to get previous deployment branch/commit while doing new deployment in a pipeline?

1 answer

0 votes

To manually see the deployment history in Bitbucket, click the "Deployment"-Tab on the left and then for each deployment there is an info-button on the right side of the heading that contains the Deployment environment name. Clicking that gives you the full history for that environment.

As far as I know, there is no easy automated way to do this. The variable '$BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID' gives you the uuid of the environment. With that uuid you could use the Bitbucket API to get details about that environment:

Generate an App Password in the BitBucket settings and store it as a secured variable for Auth.

Suggest an answer

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

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

441 views 4 4
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