gocd-contrib / gocd-groovy-dsl-config-plugin

Plugin to declare GoCD pipelines and environments configuration using a Groovy DSL
Apache License 2.0
11 stars 13 forks source link

How to specify an SSH GitLab repository URL in the PR support #358

Closed asavchkov closed 2 years ago

asavchkov commented 2 years ago

I am trying to follow the example to support merge requests in our self-hosted GitLab. The configuration Groovy script loads successfully but when the pipeline starts an error occurs:

2022-10-02 04:42:47,665 ERROR [86@MessageListener for MaterialUpdateStatusNotifier] BuildCauseProducerService:353 - not scheduling pipeline yet-another-pr-merge-requests_2 after manual-trigger because update of material failed with reason Failed to run git clone command STDERR: Cloning into '/var/lib/go-server/pipelines/flyweight/eb3ad25e-f7ba-49b1-b473-165448c5d716'...
STDERR: fatal: could not read Username for 'https://our.gitlab.domain': No such device or address. Cause: Failed to run git clone command

As I understand GoCD uses serverBaseUrl not only for scanning merge requests but also for cloning the matched repository. Can I tell GoCD that cloning should be done using an SSH URL? This is how I would like my GoCD agent to clone from our GitLab.

chadlwilson commented 2 years ago

You should be able to override the materialUrl in the gitlab { } block to achieve this.