Skip to content

IvenGe/steampipe-plugin-jenkins

 
 

Repository files navigation

image

Jenkins Plugin for Steampipe

Use SQL to query jobs, builds, nodes, plugin and more from Jenkins.

Quick start

Install

Download and install the latest Steampipe plugin:

steampipe plugin install jenkins

Configure your credentials and config file.

Configure your account details in ~/.steampipe/config/jenkins.spc:

connection "jenkins" {
  plugin = "jenkins"

  # Your Jenkins instance URL
  server_url = "https://ci-cd.internal.my-company.com"

  # Authentication information
  username = "admin"
  password = "aqt*abc8vcf9abc.ABC"
}

Or through environment variables:

export JENKINS_URL=https://ci-cd.internal.my-company.com
export JENKINS_USERNAME=admin
export JENKINS_PASSWORD=aqt*abc8vcf9abc.ABC

Run steampipe:

steampipe query

List FreeStyle jobs on your Jenkins instance:

select
  color,
  name,
  in_queue,
  last_completed_build  ->> 'URL' as last_completed_build
from
  jenkins_freestyle;
+----------+----------------------+----------+---------------------------------------------------------+
| color    | name                 | in_queue | last_completed_build                                    |
+----------+----------------------+----------+---------------------------------------------------------+
| blue     | stage-deploy         | false    | https://ci-cd.mycorp.com/job/stage-deploy/350/          |
| red      | build-and-unit-test  | true     | https://ci-cd.mycorp.com/job/build-and-unit-test/245/   |
| blue     | production-deploy    | true     | https://ci-cd.mycorp.com/job/build-and-unit-test/241/   |
+----------+----------------------+----------+---------------------------------------------------------+

Developing

Prerequisites:

Clone:

git clone https://github.com/turbot/steampipe-plugin-jenkins.git
cd steampipe-plugin-jenkins

Build, which automatically installs the new version to your ~/.steampipe/plugins directory:

make

Configure the plugin:

cp config/* ~/.steampipe/config
vi ~/.steampipe/config/jenkins.spc

Try it!

steampipe query
> .inspect jenkins

Further reading:

Contributing

Please see the contribution guidelines and our code of conduct. All contributions are subject to the Apache 2.0 open source license.

help wanted issues:

About

Use SQL to instantly query Jenkins resources. Open source CLI. No DB required.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 97.8%
  • PLSQL 1.9%
  • Makefile 0.3%