Is that's possible to run release according to variable compare?

I’m asking for an advice please.
Our Octopus Deployment SW is not accessible over the Internet.

Our current pipeline is the following:
Build in GitHub > Upload docker image to ECR > pull from ECR to Harbor(autosync in Harbor) > pull from Harbor to server > run docker container

We would like to create automatic release on Octopus and we was thinking about the following:
Disable the autosync in Harbor.
Run script that compare between the latest docker image versions on ECR and Harbor and if they not the same trigger release.
I think that we should store as a variable the sha of the docker image from Harbor and ECR.
And then run some script to compare between them.

  1. Is that possible to trigger release according to false compare between variables?

  2. Does anyone have better idea on how to trigger autorelease in our current pipeline?

Thank you

Hey @andreybyhalenko,

Have you considered creating the release in your build pipeline using the Octopus CLI? So, in the build pipeline, after creating the images and uploading them to harbor, you then create a release in Octopus using the create release command in the CLI?

Thanks,
Adam

Hi @adam.close ,
Thank you for the reply.
The problem is that our build pipeline starts from GitHub action and not from Octopus.
So i need some trigger that comes from some place that new version was release.
We cannot open the Octopus to the internet, so we cannot trigger it from the GitHub Actions.
The only way to do it from our pipeline is send commands from Octopus maybe to ECR to check for a new version?

Thanks for the additional context @andreybyhalenko.

Before looking at an option in Octopus to compare release and contained versions with Harbor/ECR. Can anything in the Octopus Server network communicate outbound with the internet? If that is possible, you could have a GitHub self-hosted runner inside the Octopus network poll out for job running in the Github pipeline?

The other option is to have an Octopus Runbook run on a scheduler to check the latest Octopus release and get the package container version and check that against available versions in Harbor. If Harbor has a later version, then the runbook can create a new Octopus release.

A simple runbook to complete this would need two steps;

Step one:

Using a run a script step, call the Octopus API to check the latest release for the project, get the package container version, and set an Octopus Output Variable with the version number that can be used in the next step.

Information on getting releases via the API or Octopus CLI can be found below;

Octopus CLI
Octopus API

Step two:

Using another run a script step, call the harbor API to compare the container version from the previous step (The output variable) with the latest container version in harbor and, if greater, create a new release in Octopus and, if not, end the runbook process.

Does either of those solutions work for you?

Thanks

1 Like