How can I integrate Octopus Deploy with GitLab?

Though Octopus doesn’t have an official integration with GitLab, you can easily install the Octopus CLI and run octo commands to package, push, create releases and even initiate deployments. Below is an example of what would need to be included

image: ubuntu:latest

stages:
    - deploy

before_script:
    - apt update && apt install -y
    - apt-get install curl -y
    - apt update && apt install -y --no-install-recommends gnupg curl ca-certificates apt-transport-https
    - curl -sSfL https://apt.octopus.com/public.key | apt-key add -
    - sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list"
    - apt update && apt install octopuscli -y


deploy:
    stage: deploy
    script:
        - octo version

At this time, the octopusdeploy/octo image will not work with GitLab because of how the ENTRYPOINT is configured within the container.

Hi Shawn Sesna,

Do you have any update for Octopus deploy integration with Gitlab ?

Could you please share the procedure in detailed if any.

I could see there is a related topic-

Thanks,
Vinod

Good afternoon @vinodracherla,

As far as I am aware we have no plans currently to create an official integration with GitLab.

For a GitLab integration, you would need to set up your package as a specific feed following the guides on GitLab (if you click on one of the supported feeds it tells you how to set that feed up in GitLab).

You would then set that feed up as an external feed within the Octopus UI.

The two easiest feeds to use are linked below (we recommend Nuget) but it does depend on your requirements and if your package supports those feed settings.

Maven Feed
NuGet Feed

I hope that helps, let me know if you have any further questions,

Kind Regards,

Clare Martin

Hey there @vinodracherla! While not an official integration, Octopus Labs has created a compatible image that works quite well. The image is regularly built whenever new versions of the Octopus CLI is released, it should contain all the functionality that the CLI has to offer.

Regards,

Shawn