Skip to content

Re-factor download and merge scripts to use GLab CLI

Hello,

we have a specific problem that prevents us to use a current pull-sql and similar commands.

Namely, our GitLab URL is https://gitlab.company.net, but our URLs to the repo are:

SSH: git@git.company.net:group/project.git HTTPS: https://gitlab.company.net/group/project.git (I have no idea how it's possible, where is it configured, etc)

so it fails here: https://gitlab.lakedrops.com/docker/gitlab-drupal-ci/-/blob/main/bin/download#L82

as git.company.net is not equal to gitlab.company.net.

I have tried to use https://git.company.net as GitLab URL, but it didn't work, as API is located at https://gitlab.company.net/api/v4/projects...

So I would say we'll need some safer method for this check. I did some more research, and noticed this in the API response:

[
  {
    "id": 1,
    "description": null,
    "name": "Project",
    "name_with_namespace": "Group / Project",
    "path": "group-project",
    "path_with_namespace": "group/project",
    "created_at": "2022-09-30T13:46:02Z",
    "default_branch": "main",
    "tag_list": [
      "example",
      "project"
    ],
    "topics": [
      "example",
      "project"
    ],
    "ssh_url_to_repo": "git@git.example.net:group/project.git",
    "http_url_to_repo": "https://gitlab.example.net/group/project.git",
    "web_url": "https://gitlab.example.net/group/project",
...

so can we use ssh_url_to_repo and http_url_to_repo values to check if the current project belongs there...? If so, I can do some adjustments to the /bin/download bash script & try to make it work.

Or do you think there is a better idea/solution?

Edited by Dejan
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information