Git Product home page Git Product logo

mozaik-ext-jenkins's Introduction

Mozaïk jenkins widgets

License Travis CI NPM version Dependencies Coverage Status widget count

Jenkins Client Configuration

In order to use the Mozaïk jenkins widgets, you must configure its client.

parameters

key env key required description notes
baseUrl JENKINS_API_BASE_URL yes jenkins base url
basicAuthUser JENKINS_API_BASIC_AUTH_USER yes jenkins auth user
basicAuthPassword JENKINS_API_BASIC_AUTH_PASSWORD yes jenkins auth password
customCa JENKINS_API_CUSTOM_CA no jenkins certificate require mozaik-ext-jenkins >= 1.1.0

usage

{
  //…
  api: {
    jenkins: {
      baseUrl: 'https://my-jenkins.ci',
        basicAuthUser:     'user',
        basicAuthPassword: 'password'
    }
  }
}

Jenkins Job Builds

jenkins job builds

Show jenkins job builds.

parameters

key required description
job yes jenkins job identifier
title no Widget title (Jenkins job builds if none provided)

usage

{
  type: 'jenkins.job_builds', job: 'my-job',
  columns: 1, rows: 1, x: 0, y: 0
}

Jenkins Job Builds Histogram

jenkins job builds histogram

Show jenkins job builds histogram.

parameters

key required description
job yes jenkins job identifier

usage

{
  type: 'jenkins.job_builds_histogram', job: 'my-job',
  columns: 1, rows: 1, x: 0, y: 0
}

Jenkins Job Status

jenkins job status

jenkins job status bold

Display job current build status.

parameters

key required description notes
job yes jenkins job identifier
layout no widget layout (none for default or 'bold') require mozaik-ext-jenkins >= 1.1.0

usage

{
  type: 'jenkins.job_status', job: 'my-job',
  columns: 1, rows: 1, x: 0, y: 0
}

Jenkins Job Status With Progress

jenkins job status

Display job current build status with progress % - based on Job Status - bold.

parameters

key required description notes
job yes jenkins job identifier

usage

{
  type: 'jenkins.job_status_progress', job: 'my-job',
  columns: 1, rows: 1, x: 0, y: 0
}

Jenkins View

jenkins view

List view jobs

parameters

key required description
view yes jenkins view identifier
title no widget title (view name used if none provided)

usage

{
    type: 'jenkins.view', view: 'dev-env',
    columns: 2, rows: 1, x: 0, y: 0
}

mozaik-ext-jenkins's People

Contributors

arturgajowy avatar plouc avatar przemuh avatar tomav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mozaik-ext-jenkins's Issues

error: [jenkins] undefined - how do i run mozaik in debug mode?

I tried setting up mozaik-ext-jenkins (using mozaik v1) setup seems alright:

mozaik-demo/
    /config.js
        api
            jenkins: {
                baseUrl: 'https://...',
                basicAuthUser:     'usr',
                basicAuthPassword: 'pwd'
            }
        widgets
            {
                type: 'jenkins.job_builds', job: 'Feature-Branch-Pipeline-SEO',
                columns: 1, rows: 1, x: 0, y: 0
            },

    /App.jsx
        import jenkins from 'mozaik-ext-jenkins';
        Mozaik.Registry.addExtensions({jenkins});

    /server.js
        import jenkins from 'mozaik-ext-jenkins/client';
        mozaik.bus.registerApi('jenkins', jenkins);

Above seems to work, i am however greeted with a empty widget and below output in in stdout:

info: Added subscription 'jenkins.job.Feature-Branch-Pipeline-SEO '
info: Calling 'jenkins.job.Feature-Branch-Pipeline-SEO '
info: [jenkins] fetching from https://.../job/Feature-Branch-Pipeline-SEO/api/json?pretty=true&depth=10&tree=builds[number,duration,result,builtOn,timestamp,id,building]: [object Object]
info: Setting timer for 'jenkins.job.Feature-Branch-Pipeline-SEO '
error: [jenkins] undefined
error: [jenkins] jenkins.job.Feature-Branch-Pipeline-SEO  - status code: undefined

I have suspicion that its my self-signed certificate that is making a fuss, how can i debug this?
Are you aiming at converting the jenkins extension for mozaik v2, pointers on how i can do it myself?

Using multiple Jenkins servers

Is there a way to configure multiple Jenkins instance?
I tried to change jenkins to jenkinsA and jenkinsB in the config file and calling jenkinsA.job_status, but it doesn't work.
Before digging more, I was wondering if you know an existing solution.

Thank you.

Widgets look bad

item info notes
node version 4.6.0
npm version 3.10.8
mozaik-ext-jenkins version 1.2.0
jenkins version 1.609.2
mozaik version 1.4.4
mozaik-demo version current
component name of the extension's component or client if it's related to the extension's client
browser Chrome, firefox

Expected behavior

Actual behavior

Description of the actual behavior.
image

Steps to reproduce

Followed the install instructions.

Currently building jobs are not displayed in JobBuilds widget

item info notes
node version v5.9.1 output from node --version
npm version 3.7.2 output from npm --version
mozaik-ext-jenkins version 1.655 available in project's package.json
jenkins version 1.655 your jenkins server version
mozaik version ^1.1.0 available in project's package.json
mozaik-demo version N/A version of the demo used, depends on which method you used to setup your Mozaïk dashboard
component jenkins.job_builds name of the extension's component or client if it's related to the extension's client
browser Chrome 49.0.2623.87 browser used, applyable if the issue is not related to the client

Expected behavior

While a job is building, display the job in the list of job builds with the status building.

Actual behavior

The building job is not displayed in the list.

Steps to reproduce

(This is somewhere between a bug report and a feature request and would like your feedback.)

Trigger a Jenkins job and refresh your dashboard. This requires a little bit of timing, depending on how long your Jenkins job runs. I've found in certain conditions that visiting the dashboard while a certain job is building prevents any JobBuild components from being displayed in the JobBuilds widget.

In this case, I see:

2016-03-29 at 3 10 pm

When no jobs are building, I see all job builds in the list, as expected.

2016-03-29 at 3 10 pm success

I noticed that the JobBuild component takes the build.result and displays it with toLowerCase() ([code is here(https://github.com/plouc/mozaik-ext-jenkins/blob/v1.1.0/src/components/JobBuild.jsx#L9))

According to the Jenkins API endpoints I am hitting, which I believe to be the case for all versions of the Jenkins API:

Building job object

{
  "building" : true,
  "duration" : 0,
  "id" : "1",
  "number" : 1,
  "result" : null,
  "timestamp" : 1459278308034,
  "builtOn" : ""
}

Completed job object

{
  "building" : false,
  "duration" : 10025,
  "id" : "1",
  "number" : 1,
  "result" : "SUCCESS",
  "timestamp" : 1459278308034,
  "builtOn" : ""
}

For a building job, result == null, where I think the weird behavior is happening where no jobs are shown when build.result.toLowerCase() is called in JobBuild. I don't see any logs for this, though, so this is a guess.

So long story short, I guess this is a feature request for properly displaying the pending build status of a JobBuild. I would be glad to look into this, as I would like this for my company's dashboard.

Let me know if you have any questions or input about this behavior/idea.

Jenkins auth and pass config

Hi @plouc, how are you mate?

Really nice work on Mozaïk. I'm currently trying it because I need an Enterprise dashboard.
Just a question regarding the Jenkins configuration.
The README says:

{
  //… 
  api: {
    jenkins: {
      baseUrl: 'https://my-jenkins.ci',
      auth: {
        user:     'user',
        password: 'password'
      }
    }
  }
}

But I think it should be:

{
  //… 
  api: {
      jenkins: {
          baseUrl: 'https://my-jenkins.ci',
          basicAuthUser:     'user',
          basicAuthPassword: 'password'
      }
  },  
}

When I use your config, the server doesn't start and I see:

  error: jenkins.basicAuthUser: must be of type String
  jenkins.basicAuthPassword: must be of type String

Let me know, I'll be happy to PR this!

Cannot call `toUpperCase` on `null` result

I use jenkins 2.19.3.

I want to display build status but I get an error "cannot call toUpperCase on null". This is because you add className based on result "FAILURE" "SUCCESS"...The problem is when build is in "in-progress" state "result" attribute is null.

Possible solution:

Jenkins returns flag "building":

"building" : true,
"displayName" : "#4333",
"duration" : 0,
"estimatedDuration" : 1384140,
"id" : "4333",
"result" : null,

We can base on that flag and add different className for "in-progress" builds.

Expected behavior

No errors in browser console + new style for "in-progress" builds.

Actual behavior

Error in browser console. Empty list of build. Unknown status of build.

jenkins.view not working

module.exports.jobBuild in ./src/client.js line 65 is undefined

When I tried moving jobBuild outside of the returned object it worked.

Not sure how you wanna address this @plouc, related issue is that jobs returns literally all jobs, not only for the requested view (this might be jenkins' fault though, not sure)

unable to verify the first certificate

Hello!

When trying to use this plugin I get this error [jenkins] Error: unable to verify the first certificate. This is because of a custom CA provided to me by my company, but superagent is not used by mozaik in a way that it is configurable to pick up a specific certificate.

Since I need this certificate when I deploy my dashboard I think it would be nice to share my solution to this problem, see coming pull request.

Uncaught Error: No component defined for type "jenkins.jobs"

Added extention using npm i mozaik-ext-jenkins --save and module if physically installed.

In app.js, added mozaik.bus.registerApi('jenkins', require('mozaik-ext-jenkins/client'));
I can see info: registered API "jenkins" when starting server.

But nothing appears, and I can see this message in my browser console:
Uncaught Error: No component defined for type "jenkins.jobs"

Tried with other widget and same problem.

Am I missing something?

Thank you @plouc

Cannot make a simple jenkins.view work "out of the box"

item info notes
node version v8.10.0 output from node --version
npm version 5.6.0 output from npm --version
mozaik-ext-jenkins version 1.2.0 available in project's package.json
jenkins version 1.3.3 your jenkins server version
mozaik version 1.4.4 available in project's package.json
mozaik-demo version latest on github today version of the demo used, depends on which method you used to setup your Mozaïk dashboard
component name of the extension's component or client if it's related to the extension's client
browser Chromium browser used, applyable if the issue is not related to the client

Expected behavior

Display of a jenkins widget

Actual behaviour

"Uncaught Error: No component defined for type 'jenkins.view' in the debug console and nothing displayed on the dashboard. I'm sure this is something trivial that's missing that will be obvious to a seasoned Mozaik user, but it's not immediately clear as someone who's never used it before. I had assumed that the API endpoints would all show up automatically after installing the jenkins module.

Steps to reproduce

  • git clone http://github.com/plouc/mozaik-demo
  • cd mozaik-demo
  • npm install
  • cd node_modules
  • npm install mozaik-ext-jenkins
  • Edit config.js to add section pointing to my server
  • Edit grid replacing the entry for x0y2 with the following::
type: jenkins.view,
view: 'Tooling',
columns: 1, rows: 1, x: 0, y: 2

Also one further question - is it valid to leave the user/password options unset to allow the module to access a jenkins instance which can be viewed without authentication?

status code: undefined

I'm testing Mozaik with 2 different Jenkins, both having the rest json enabled and exposing data to my jenkins user.

I'm getting a status code: undefined error on one of them.
Before I dig inside, I was wondering:

  • is there a particular jenkins version requirement?
  • do the client works on untrusted HTTPS connection?

Thank you.

New 1.3.0 tag and release?

Any chance of a new 1.3.0 tag and an updated npm package?

I'd love to help out but not exactly sure how to do either (nodejs novice).

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.