Coder Social home page Coder Social logo

gocd-monitor's Introduction

GoCD monitor Build Status Dependencies

Build monitor for Go cd build server https://www.go.cd/

Pipeline status

  • Blue - Pipeline is building
  • Green - Pipeline build passed
  • Red - Pipeline has failed
  • Yellow - Pipeline has been paused
  • Orange - Pipeline build been cancelled

Pipelines

Pipeline attributes

Pipeline explanation

Setup

Open app-config.js and change the three lines

// Url for your go server
goServerUrl: 'https://ci.example.com',
// Go user to use for communication with go server
goUser: 'xxx',
// Password for go user
goPassword: 'xxx',

Alternatively you can configure via environment variables, these will override values within the config.js file:

gocdmonitor_gocd_host=https://ci.example.com
gocdmonitor_gocd_user=xxx
gocdmonitor_gocd_password=xxx

Optional environment variables:

gocdmonitor_gocd_poll_interval=60
gocdmonitor_gocd_check_pipelines_interval=60
gocdmonitor_gocd_switch_pages_interval=60
gocdmonitor_gocd_grouppipelines=true
gocdmonitor_default_sort_order=buildtime
gocdmonitor_default_hidden_pipelines=foo,bar
gocdmonitor_default_pipeline_filter_regex=pipeline.*-[0-9]+
gocdmonitor_enable_dark_theme=true
gocdmonitor_gocd_showbuildlabels=true
gocdmonitor_gocd_linktopipelineingo=true
gocdmonitor_gocd_hide_weather_icons=true
gocdmonitor_db_file_path=server/data.db

Enabling HTTPS of the server

Use env variables or config to enable https and define needed private and public keys. Example for environment variables:

gocdmonitor_use_https=true
gocdmonitor_key_path=path/to/your/publicKey
gocdmonitor_certificate_path=path/to/your/privateKey

This can be extremely useful for configuring in Docker environments.

Optionally set the following variables in app-config.js.
Group pipelines by their pipeline groups:

groupPipelines: true

Click on a pipeline to open its history in GoCD:

linkToPipelineInGo: true

Hide the weather icons:

hideWeatherIcons: true

Then open a terminal and enter

npm install
npm start

Go to http://localhost:3000

Enjoy :)

Configuration

Go to http://localhost:3000?admin and click the settings button in the bottom-right corner to open the configuration dialog.

  • Sort Order - Sort pipelines by status or latest build time
  • Dark Theme - Enables dark theme
  • Filter Pipelines - Disable/enable pipelines to retrieve from go server. It's also possible to write a regex with the pipelines you want. Configuration

Using multiple configuration profiles

Add the profile attribute to your URL, e.g. http://localhost:3000?admin&profile=team1. Then continue to configure as usual.

Test reports

To configure test reports, go to http://localhost:3000/test-results?admin. Click the '+'-button and choose the pipeline you want to generate test reports for. The system then retrieves all test files and creates graph and possible error table for all tests found in that pipeline. For now only cucumber tests are supported. If defined, the system will switch between monitor and test report page every switchBetweenPagesInterval seconds. Test reports

How it works

The server polls the go server every goPollingInterval seconds. The results are then reported to the client using socket.io. The pipelines and its pause info are refreshed once every day.

Development

gocd-trial-launcher can be used to setup GoCD locally with sample piplines. Download and extract the appropriate archive for your development environment. Enter ./run-gocd to start the setup.

To run the application in development mode, open a terminal and enter npm run dev-start. The server and client will be rebuilt when a js or jsx-file changes. By default, it points to the GoCD server started by gocd-trial-launcher (refer).

To run tests, enter npm test.

Troubleshooting

If the project has been installed with root user or by using sudo npm install there might be problems with the postinstall script since npm tries to downgrade its priviligies when running scripts. More information about this problem and how to fix it can be found here (hint, add the --unsafe-perm flag when running npm install)

gocd-monitor's People

Contributors

anton-krasnoshchok avatar antonos avatar arunvelsriram avatar bzumhagen avatar dependabot[bot] avatar flosell avatar gkumar7 avatar karmats avatar maxhaertwig avatar maxisir avatar rb2610 avatar refinedcranberry avatar tegud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gocd-monitor's Issues

Make package.json postinstall scripts compatible with Windows shell

add-flexbox, add-roboto-font, and add-material-icons (at least) all fail on Windows. Please, modify package.json scripts to make them platform agnostic.

"add-flexbox": "cp node_modules/flexboxgrid/css/index.min.css assets/stylesheets/flexboxgrid.min.css",
"add-roboto-font": "cp node_modules/roboto-font/fonts/Roboto/* assets/fonts",
"add-material-icons": "cp node_modules/mdi/css/materialdesignicons.min.css* assets/stylesheets/ && cp node_modules/mdi/fonts/* assets/fonts"

Unable to use development build.

As per readme I start the server using npm run dev-start , but there seems to be no web server running. The process end with webpack: Compiled successfully, but nothing is running on port 30000 or 30001.

Can you please update the documentation so that we can better contribute to the development of this project?
image

Regex-Filters don't apply to new pipelines

In my current team, we are only interested in a few of the pipelines in GoCD (our our own teams' pipelines plus a few shared ones, not other teams' pipelines) so we set up a regex to filter out whatever we aren't interested in, expecting it would also filter any new pipelines that might pop up in the future (which happens quite regularly in our case).
Unfortunately, digging deeper into the code, I found that this doesn't happen. The regex is only used in the actual configuration step to determine disabledPipelines.

I'm happy to submit a fix for this but I'm wondering what the intended behaviour should be.
My intuition would say filter by regex, then remove any left-over disabled pipelines. However, you could also do either regex or disabled pipelines.

Any opinions?
Apart fom that, any good ideas how to make the behaviour more obvious to the user?

404 when Retrieving pipeline names

Hi there,

some months ago, we used to have a older version of GoCD server running with the then-current version of gocd-monitor and could monitor our pipelines with it. In the meantime, the GoCD server has been updated several times (now 21.2.0 (12498-16e1ac6956cd5177a99dc3fe33503661881c354f)) and things stopped working. The log repeats every second:

[2021-09-07T09:57:26.416Z] INFO Retrieving pipeline names
[2021-09-07T09:57:26.788Z] ERROR Failed to retrieve pipeline names
[2021-09-07T09:57:26.789Z] ERROR Failed to retrieve pipeline names, retrying
[2021-09-07T09:57:26.789Z] ERROR StatusCodeError: 404 - ""

Updating to the latest gocd-monitor didn't help. Any ideas what might be causing this? We were thinking of permission problems, but that doesn't seem to be the problem...

Thanks!

Show pipeline Duration time

Hi there, first of all, great tool, it would be great to show the Duration of the pipeline, maybe next to when was build

if you want I can try to PR

thanks!

Only one column and other layout problems

2017-02-01_15-10-25

I have tried building with a lot of different node versions in different docker images, but I always get the same problem.

Dockerfile variants I have tried:

FROM nodesource/centos7:5.8.0
# cache package.json and node_modules to speed up builds
ADD package.json package.json
RUN NODE_ENV="" npm install
# Add your source files
ADD . .
CMD ["npm","start"]
FROM node:onbuild
EXPOSE 3000
FROM node:6-onbuild
EXPOSE 3000
FROM node:4-onbuild
EXPOSE 3000

Suggestion: Support multiple teams

I'm currently working in a set-up where multiple teams are using the same GoCD instance but are responsible for different parts of the system and therefore interested in different pipelines. Some pipelines are of interest for multiple teams while other pipelines are only interesting for a single team.

At the moment, we deploy one instance of gocd-monitor for each team. This works OK but is a big overhead, esp. as the number of teams grow. Therefore, it would be nice if gocd-monitor would support multiple teams out of the box.

Two approaches I can think of:

  • Store settings for multiple teams and give them a way of selecting their set of settings. This is more or less straightforward to implement since it extends the current concept quite nicely. However, it's still shared state: ones change influences others, teams need to know who is using which settings-set, ...; Also, the state needs to be persistent, making immutable infrastructure a bit harder.
  • Define settings in URL: This seems to be more complex since the current code-base isn't really intended to do this so probably needs some refactoring. Also, if this is added to the existing, persistent settings mechanism it becomes quite hard to reason about (both for developers and users): What happens if I have one setting in the URL but then change it in the UI? What if some settings are defined in the URL and others aren't? What if something is defined in both?

Doesn't work without "operate" permissions.

When the configured user only has "view" permissions, but not "operate", all of the pipelines appear paused. The monitor determines whether or not the pipeline is paused by looking at the "can_run" key from the pipelines API, but this key is never true if the user doesn't have operate permissions. So as a result, all of the pipelines are displayed as paused.

As a matter of security, it would be preferable to function with as few permissions as possible.

The authoritative way to determine if a pipeline is paused would be via the dashboard or pipeline status API.

Great monitor btw. Thanks!

Suggestion: Electron Support

Using Electron to develop a desktop-end version, I think it should be easier to use than running the command to build and run the server then open URL in the browser.

  • Use Electron to host the server
  • Use Electron to display the dashboard
  • Config gocd url and user/password in UI.

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.