Giter Site home page Giter Site logo

backstage-plugin-gitlab's Introduction

Backstage Gitlab Plugin

Version Contributions welcome Downloads License Stars Badge Maintenance

Build Status

Language Repo Size Hits

Website: https://gitlab.com/

Contributors Languages Pipeline Status

Merge Request Information

Setup

  1. If you have a standalone app (you didn't clone this repo), then do
# From your Backstage root directory
cd packages/app
yarn add @loblaw/backstage-plugin-gitlab
  1. Add the EntityGitlabContent extension to the entity page in your app:
// In packages/app/src/components/catalog/EntityPage.tsx

import { isGitlabAvailable, EntityGitlabContent } from '@loblaw/backstage-plugin-gitlab';
// Farther down at the serviceEntityPage declaration
const serviceEntityPage = (
<EntityLayout>
    {/* Place the following section where you want the tab to appear */}
    <EntityLayout.Route if={isGitlabAvailable} path="/gitlab" title="Gitlab">
       <EntityGitlabContent />
    </EntityLayout.Route>
  1. Add integration: In app-config.yaml add the integration for gitlab:
integrations:
  gitlab:
    - host: gitlab.com
      token: ${GITLAB_TOKEN}
  1. Add proxy config:
  '/gitlabci':
    target: '${GITLAB_URL}/api/v4'
    allowedMethods: ['GET']
    headers:
      PRIVATE-TOKEN: '${GITLAB_TOKEN}'
  • Default GitLab URL: https://gitlab.com
  • GitLab Token should be with of scope read_api and can be generated from this URL
  1. Add a gitlab.com/project-id annotation to your respective catalog-info.yaml files, on the format
# Example catalog-info.yaml entity definition file
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  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
spec:
  type: service
  # ...

Note: spec.type can take values in ['website','library','service'] but to render GitLab Entity, Catalog must be of type service

Features

  • List top 20 builds for a project
  • List top 20 Merge Requests for a project
  • View Contributors for a project
  • View Languages used for a project
  • View Pipeline status for a project
  • Works for both project and personal tokens
  • Pagination for builds
  • Pagination for Merge Requests
  • Merge Requests Statistics

backstage-plugin-gitlab's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.