preface

The company uses Gitlab for code management, and continuous integration (CI) is probably a natural fit (don’t ask me why I don’t use Jenkins).

After a period of use, the basic functions are enough, but there is a Dashboard to uniformly check the current CI status, which is quite inconvenient.

Therefore, after some searching, Gitlab-Monitor is selected. The reason is, on the one hand, it is simple and beautiful; Docker deployment, on the other hand, is possible.

Set up steps

  1. First pull the mirror image
docker pull timoschwarzer/gitlab-monitor
Copy the code
  1. Obtain gitLab access Token. After logging in to GitLab, enter user Settings, click Access Token in the left menu, you can see the following page.

Then, enter a name, set expiration time, check API and Read Repository to create a token.

Remember to copy and save well, but there is no place to see this token again! But it’s not that big a deal. Why don’t you just apply for another one

  1. Now, it’s time to start the Container for Gitlab-Monitor. It supports some custom parameters that can be queried in configuration.

According to my preference, the Settings are as follows.

{
    "gitlabApi": "https://gitlab.******.com/api/v4"."privateToken": "* * * * * * * * *"."showStagesNames": true."fetchCount": 40."pipelinesOnly": true."showUsers": true."pollingIntervalMultiplier": 0.2}Copy the code

This parameter can be passed in through the environment variable GITLAB_MONITOR_CONFIG, so the command to start docker is as follows:

docker run -d -p 11080:80 -e GITLAB_MONITOR_CONFIG='{"gitlabApi": "https://gitlab.*****.com/api/v4","privateToken": "********","showStagesNames": true,"fetchCount": 40, "pipelinesOnly" : true, "showUsers" : true, "pollingIntervalMultiplier" : 0.2} '  --name=gitlab-monitor timoschwarzer/gitlab-monitor:latest
Copy the code
  1. As a final step, type localhost:11080 in your browser.

Write in the last

One thing to note is that the configuration specified by the environment variable is stored in the LocalStorage of the browser and is in plain text. Theoretically, this AccessToken is at risk of disclosure.