diff --git a/lib/manager/ansible-galaxy/__fixtures__/requirements01.yml b/lib/manager/ansible-galaxy/__fixtures__/requirements01.yml index 8f89b8d529533e9b13812cbe5447a02963f1930a..ea0ff5a7d43e06214eec19bd8d50e8122233cf18 100644 --- a/lib/manager/ansible-galaxy/__fixtures__/requirements01.yml +++ b/lib/manager/ansible-galaxy/__fixtures__/requirements01.yml @@ -16,6 +16,20 @@ src: git@gitlab.company.com:mygroup/ansible-base.git version: "0.1" +# Git repo, url with protocol prefix +## with user +- scm: git + src: ssh://git@gitlab.company.com/testGroup/testProject.git + version: "0.1" +## without user +- scm: git + src: ssh://gitlab.company.com/testGroup/testProject2.git + version: "0.1" +## with custom port +- scm: git + src: ssh://git@gitlab.company.com:23/testGroup/testProject3.git + version: "3.1" + # include - include: <path_to_requirements>/webserver.yml diff --git a/lib/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap b/lib/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap index 9b5076412787ea535e9caf5a19ab6dde6da3a366..929c35432d6360d2f65d3048ef9499b9c8edd466 100644 --- a/lib/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap @@ -43,6 +43,24 @@ Array [ "depName": "mygroup/ansible-base", "lookupName": "git@gitlab.company.com:mygroup/ansible-base.git", }, + Object { + "currentValue": "0.1", + "datasource": "git-tags", + "depName": "testGroup/testProject", + "lookupName": "ssh://git@gitlab.company.com/testGroup/testProject.git", + }, + Object { + "currentValue": "0.1", + "datasource": "git-tags", + "depName": "testGroup/testProject2", + "lookupName": "ssh://gitlab.company.com/testGroup/testProject2.git", + }, + Object { + "currentValue": "3.1", + "datasource": "git-tags", + "depName": "testGroup/testProject3", + "lookupName": "ssh://git@gitlab.company.com:23/testGroup/testProject3.git", + }, Object { "currentValue": "0.14", "datasource": "git-tags", diff --git a/lib/manager/ansible-galaxy/extract.spec.ts b/lib/manager/ansible-galaxy/extract.spec.ts index 18264580ddead08e2eb3f61a265175adefed529d..830f13184f85af2e3df716d866c30ad12ee21bff 100644 --- a/lib/manager/ansible-galaxy/extract.spec.ts +++ b/lib/manager/ansible-galaxy/extract.spec.ts @@ -22,7 +22,7 @@ describe('lib/manager/ansible-galaxy/extract', () => { it('extracts multiple dependencies from requirements.yml', () => { const res = extractPackageFile(yamlFile1); expect(res.deps).toMatchSnapshot(); - expect(res.deps).toHaveLength(6); + expect(res.deps).toHaveLength(9); }); it('extracts dependencies from a not beautified requirements file', () => { const res = extractPackageFile(yamlFile2); diff --git a/lib/manager/ansible-galaxy/extract.ts b/lib/manager/ansible-galaxy/extract.ts index d299cbf4c0c90f6a3d3d471f345691406f4d94c5..3fb5ccc06d11155b04bf72f8c8d9480d8071f1e8 100644 --- a/lib/manager/ansible-galaxy/extract.ts +++ b/lib/manager/ansible-galaxy/extract.ts @@ -47,7 +47,7 @@ function finalize(dependency: PackageDependency): boolean { const source: string = dep.managerData.src; const sourceMatch: RegExpMatchArray = new RegExp( - /^(git|http|git\+http)s?(:\/\/|@).*(\/|:)(.+\/[^.]+)\/?(\.git)?$/ + /^(git|http|git\+http|ssh)s?(:\/\/|@).*(\/|:)(.+\/[^.]+)\/?(\.git)?$/ ).exec(source); if (sourceMatch) { dep.datasource = datasourceGitTags.id;