firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.03k stars 115 forks source link

hierarchy of servers and group configs #1265

Closed alexey-vostrikov closed 2 weeks ago

alexey-vostrikov commented 2 weeks ago

something like this

---
group:
  192.168.0.5/:
    CI_SERVER_PROTOCOL: "http"
    CI_SERVER_PORT: "80"
    AUTHORIZATION_PASSWORD: "glpat-XxXxXxXxXxXxXxXxXxX"
    CI_TEMPLATE_REGISTRY_HOST: "registry.gitlab.local:5050"
    extra_hosts:
      - "registry.gitlab.local:192.168.0.5"
  gitlab.example.com/:
    CI_SERVER_PROTOCOL: "https"
    CI_SERVER_PORT: "443"
    AUTHORIZATION_PASSWORD: "glpat-yYyYyYyYyYyYyYyYyYy"
    extra_hosts:
      - "registry.gitlab.example.com:10.10.10.5"

  192.168.0.5/localgroup/:
    LG_SSH_KEY:
      type: "file"
      values:
        "*": |
          -----BEGIN OPENSSH PRIVATE KEY-----
          UAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZWb3BlbnNzaC1rZXktdjEAAAAABG5vbm
          ABAAAAMwAAAAtzc2gtZWb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAA
          MwAAAAtzc2gtZWb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAA
          Ebm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZWb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAA
          ZXktd=
          -----END OPENSSH PRIVATE KEY-----

project:
  192.168.0.5/localgroup/ci-cd:
    CI_PROJECT_ID: 211

global:
  CI_SERVER_URL: "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}"
  CI_REGISTRY: "${CI_TEMPLATE_REGISTRY_HOST}"
  CI_API_V4_URL: "${CI_SERVER_URL}/api/v4"
  CI_JOB_URL: "${CI_SERVER_URL}/${CI_PROJECT_PATH}/-/jobs/${CI_JOB_ID}"
  CI_PIPELINE_URL: "${CI_SERVER_URL}/${CI_PROJECT_PATH}/pipelines/${CI_PIPELINE_IID}"
  CI_JOB_TOKEN: "${AUTHORIZATION_PASSWORD}"
  PRIVILEGED: true
  NEEDS: true
  extra_hosts:
    - "gitlab.example.com:10.10.10.5"
firecow commented 2 weeks ago

I have no idea, what I'm looking at here :smile: Could you elaborate, what this is about?

alexey-vostrikov commented 2 weeks ago

Settings for server, settings for localgroup, settings for subgroup and settings for project shold be combined

firecow commented 2 weeks ago

Oh, and that doesn't work or what ? Is this a bug report?

alexey-vostrikov commented 2 weeks ago

Yes it does not work hierarchially

Currently only full "server/group/subgroup" match and a project settings are combined But no way to define common settings for "server/group" and a "server"

I had no idea that should work, so maybe it is bugreport

But i made with issue as feature request

firecow commented 2 weeks ago

I doubt anyone, would know what to implement or fix based of your example and lack of description and expectations.

alexey-vostrikov commented 2 weeks ago

Sorry, lack of testing