jenkins-actions

1.0.0 • Public • Published

jenkins-actions

Build Status Coverage Status

Get an object containing all actions from a jenkins api result set

Install

$ npm install [--save] jenkins-actions

Test

$ npm test

Usage

const jenkins = require('jenkins-actions')
const input = {
  actions: [
    { parameters: [
        { name: 'TARGET_GITHUB_ORG', value: 'nodejs' }
      , { name: 'TARGET_REPO_NAME', value: 'node' }
      , { name: 'PR_ID', value: '4793' }
      , { name: 'POST_STATUS_TO_PR', value: true }
      , { name: 'REBASE_ONTO', value: '<pr base branch>' }
      ]
    }
  , { causes: [
        { shortDescription: 'Started by user Evan Lucas'
        , userId: 'evanlucas'
        , userName: 'Evan Lucas'
        }
      ]
    }
  , {}
  , {}
  , { failCount: 0
    , skipCount: 7
    , totalCount: 1079
    , urlName: 'aggregatedTestReport'
    }
  ]
}
 
console.log(jenkins(input))

Will output the following:

{
  parameters: {
    TARGET_GITHUB_ORG: 'nodejs'
  , TARGET_REPO_NAME: 'node'
  , PR_ID: '4793'
  , POST_STATUS_TO_PR: true
  , REBASE_ONTO: '<pr base branch>'
  }
, startedBy: 'Evan Lucas (@evanlucas)'
, results: {
    failCount: 0
  , skipCount: 7
  , totalCount: 1079
  , urlName: 'aggregatedTestReport'
  }
}

Author

Evan Lucas

License

MIT (See LICENSE for more info)

Readme

Keywords

none

Package Sidebar

Install

npm i jenkins-actions

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • evanlucas