Use SQL to query jobs, builds, nodes, plugin and more from Jenkins.
- Get started →
- Documentation: Table definitions & examples
- Community: Slack Channel
- Get involved: Issues
Download and install the latest Steampipe plugin:
steampipe plugin install jenkinsConfigure 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.ABCRun steampipe:
steampipe queryList 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/ |
+----------+----------------------+----------+---------------------------------------------------------+
Prerequisites:
Clone:
git clone https://github.com/turbot/steampipe-plugin-jenkins.git
cd steampipe-plugin-jenkinsBuild, 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:
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:
