wemakecustom / gitlab-composer

Gitlab Composer repository
163 stars 44 forks source link

Allow to integrate multiple gitlabs #10

Open kaystrobach opened 9 years ago

kaystrobach commented 9 years ago

would be really awesome to change the code to allow access multiple gitlab instances.

IMHO there are several steps to take:

The yaml file may look like:

m4tthumphrey:
  php-gitlab-api:
    instances:
      -
        apiToken: 'ASDFGHJKL12345678'
        endpointUri: 'http://gitlab.example.com/api/v3/'
      -
        apiToken: 'ASDFGHJKL12345678'
        endpointUri: 'http://gitlab.example.com/api/v3/'
      -
        apiToken: 'ASDFGHJKL12345678'
        endpointUri: 'http://gitlab.example.com/api/v3/'
kaystrobach commented 9 years ago

yaml files can be read easily within PHP with http://php.net/manual/de/function.yaml-parse-file.php

lemoinem commented 9 years ago

I think the major conceptual issue would be in case of name collision (What to do if two packages in first and second Gitlab have the same name?).

I see two options:

To parse YAML, I think https://github.com/symfony/Yaml would be a better option.

kaystrobach commented 9 years ago

Same would happen, if you setup multiple instances of gitlab-composer with different gitlabs and use both into one composer.json :D

lemoinem commented 9 years ago

Sounds good to me. We will try to provide an implementation for this ASAP. Of course, a PR is always welcome ;)