loblaw-sre/backstage-plugin-gitlab

To use self hosted Gitlab instance instead of gitlab.com

Closed this issue · 6 comments

Hi Team,

May I please know if it's possible to use annotation with self-hosted Gitlab in place of gitlab.com
For instance,

annotations:
      gitlab.xyz.com/project-id: 'project-id' 

Many Thanks!

Hi @enajain24

The annotation is standard, so it will be as below but the plugin is supported for self hosted too.

annotations: 
  gitlab.com/project-id: 'project-id' #1234. This must be in quotes and can be found under Settings --> General 
      or 
  gitlab.com/project-slug: 'project-slug' #group_name/project_name

Thanks for your response.

So, the configuration would be like this:

integrations:
  gitlab:
    - host: **gitlab.domain**
      token: ${GITLAB_TOKEN}
annotations: 
 **gitlab.com**/project-id: 'project-id' #1234. This must be in quotes and can be found under Settings --> General 
     or 
 **gitlab.com**/project-slug: 'project-slug' #group_name/project_name

@enajain24 Below are the changes to be done on app-config.yaml

integrations:
  gitlab:
    - host: gitlab.xyz.com
      apiBaseUrl: https://gitlab.xyz.com/api/v4 #Required for self-hosted
      token: ${GITLAB_TOKEN}

proxy:
  '/gitlabci':
    target: 'https://gitlab.xyz.com/api/v4'
    allowedMethods: ['GET']
    headers:
      PRIVATE-TOKEN: '${GITLAB_TOKEN}'

changes on catalog-info.yaml

annotations: 
  gitlab.com/project-id: 'project-id' #1234. This must be in quotes and can be found under Settings --> General 
      or 
  gitlab.com/project-slug: 'project-slug' #group_name/project_name

Thank you so much for the quick check.

@enajain24 do you got it working, can we close this issue?.

yes please, thanks so much for your help