GithubHelp home page GithubHelp logo

zheyuye / gitlab-badges Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sebbo2002/gitlab-badges

0.0 2.0 0.0 194 KB

It's like a very tiny shields.io (without website) for your private GitLab instance…

License: MIT License

JavaScript 97.03% Dockerfile 2.97%

gitlab-badges's Introduction

GitLab Badges

License Pipeline

This server acts like a very tiny shields.io to generate SVG badges for your private GitLab instance. Uses shield.io's gh-badges to generate them.

Quick Start

Directly

You'll need node.js to run this.

git clone https://github.com/sebbo2002/gitlab-badges.git
cd ./gitlab-badges
npm install
GITLAB_URL=https://gitlab.example.com GITLAB_TOKEN=**** npm start

Docker

You can also use the docker container to run this script:

docker run -e GITLAB_URL=https://gitlab.example.com -e GITLAB_TOKEN=**** sebbo2002/gitlab-badges

Configuration

Use environment variables to set login credentials and pushover tokens:

GITLAB_URL GitLab URL (https://gitlab.example.com)
GITLAB_TOKEN A private Token which is used to query the GitLab API
PORT Port to listen to, default to 8888
BADGE_STYLE Optional, allows to specify the used [badge style](http://shields.io/#styles)
MAX_CACHE_SIZE Optional, to setup the living cache size, defaults to 50

Example

GITLAB_URL=https://gitlab.example.com \
GITLAB_TOKEN=******************** \
BADGE_STYLE=flat-square \
npm start
or
docker run --rm \
  -p 8888 \
  -e 'GITLAB_URL=https://gitlab.example.com' \
  -e 'GITLAB_TOKEN=********************' \
  -e 'BADGE_STYLE=flat-square' \
  sebbo2002/gitlab-badges

API

/:projectId/:branch/build

Generates a badge with the current build state of the latest commit in the given branch. You'll find your project's ID in the GitLab project settings.

Example
https://gitlab-badges.example.com/1337/master/build

/:projectId/:branch/coverage

Generates a badge with the current build coverage of the latest commit in the given branch. You'll find your project's ID in the GitLab project settings.

Example
https://gitlab-badges.example.com/1337/master/coverage

/cache

Returns all currently cached data as a JSON object.

/ping

Returns pong. Usually helpful to monitor the server in a very basic way.

Todo

  • Unit Tests 🙈
  • In Code Documentation ✏️

gitlab-badges's People

Contributors

sebbo2002 avatar

Watchers

 avatar  avatar

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.