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?
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: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/deployments/%7Bdeployment_uuid%7D
Generate an App Password in the BitBucket settings and store it as a secured variable for Auth.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.