Currently I have to hard code the Docker image name and manually trigger the deployment in Octopus
My questions are
How can I have Bitbucket Pipelines trigger the deployment in Octopus Cloud? Is this simply a case of calling the Octopus API from Bitbucket Pipeliens?
How can I pass in the Docker image name from Bitbucket Pipelines to be used by Octopus Cloud? My thinking is that this should be passed in externally and then used by Octopus to ensure the same image is deployed to all environments as it’s promoted
Greetings @PeterBridgerKaptio, thanks for reaching out! For the first question, we have an example BitBucket pipeline that you can refer to Bitbucket, I’ve included the specific YAML here for brevity.
There’s a couple of different ways I think we might be able to achieve this. Script tasks have the ability to reference packages, do you think you can use a package reference pulling from a docker container registry and get the image that way?
If not, the second option would be a prompted variable, however, it does come with challenges. The prompted variable would need to be provided each time it ran, so when it goes from environment to environment, it would need to be provided again. There is some API wizardry we could do for this, but it would make the process much more complex.
I’m using GitVersion to generate a SemVer based version in Bitbucket Pipelines and using this to tag the container image.
As this version number is also being used in the create release call to Octopus, I’m then able to reserve engineer the container image name based upon this within Octopus from the Octopus.Release.Number variable as you suggest.