need FE code deploy back to old build

Sarath July 21, 2020

Hi Team,

am using bitbucket pipeline for code build and deployment.

Is there any way to deploy back the old build based on environment.

Ex : I have build #52 in DEV, TEST , UAT and DEMO. If I want to go #51 I can run the old commit again but it should pass through all the environments.

I need to goback to #51 only in DEMO environment, is this possible.

Please let me know how we can achieve this for frontend code where used angular code or for the backend java microservices.

 

Thanks in advance.

Regards,

Sarath

1 answer

0 votes
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2020

This might be possible by the REST api. It allows to specify a pipeline to run from a distinct revision on a distinct revision.

E.g. if the pipelines file didn't have any option at #51 revision to deploy to DEMO only, creating a (new) revision of bitbucket-pipelines.yml file with a pipeline (e.g. a custom pipeline for starters) that does this and then using the REST API to refer to that pipeline definition revision running the pipeline for the #51 commit.

Alternatively (but that is might more vague from your point of view) you can try to do this from a working directory with a local pipeline runner providing the needed environment variables (shameless plug as I'm the author of it, there are other ones e.g. bbrun if you prefer a node runtime, there is also one written in python I at least know of), but I sometimes trigger remote services from my very own shell like that to do the more extraordinary stuff, and curl for the REST API works very well from shell, too, don't forget to push then to the bitbucket repository as otherwise the revision is not available and the pipeline execution will fail, it can be a [temporary] branch for that).  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events