# jenkins-api-redux.rs [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/mockersf/jenkins-api-redux.rs.svg?branch=master)](https://travis-ci.org/mockersf/jenkins-api-redux.rs) [![Coverage Status](https://coveralls.io/repos/github/mockersf/jenkins-api-redux.rs/badge.svg?branch=main)](https://coveralls.io/github/mockersf/jenkins-api-redux.rs?branch=main) [![Realease Doc](https://docs.rs/jenkins_api_redux/badge.svg)](https://docs.rs/jenkins_api_redux) [![Crate](https://img.shields.io/crates/v/jenkins_api_redux.svg)](https://crates.io/crates/jenkins_api_reduxß) ## **ATTENTION**: This crate is a fork of [jenkins-api.rs](https://github.com/mockersf/jenkins-api.rs). It is an attempt to fully flesh out Jenkins compatiblity (Jenkins api key and async support). ## **CURRENTLY IN DEVELOPMENT** --- This crate provides bindings to [Jenkins JSON API](https://wiki.jenkins.io/display/JENKINS/Remote+access+API). ## Example ```rust use jenkins_api_redux::JenkinsBuilder; use jenkins_api_redux::build::BuildStatus; use jenkins_api_redux::job::BuildableJob; fn main() { let jenkins = JenkinsBuilder::new("http://localhost:8080") .with_user("user", Some("password")) .build().unwrap(); let job = jenkins.get_job("job name").unwrap(); let to_build = if let Some(short_build) = job.last_build.clone() { let build = short_build.get_full_build(&jenkins).unwrap(); println!( "last build for job {} at {} was {:?}", job.name, build.timestamp, build.result ); if let Some(result) = build.result { result != BuildStatus::Success } else { true } } else { println!("job {} was never built", job.name); true }; if to_build { println!("triggering a new build"); job.as_variant::().unwrap() .build(&jenkins).unwrap(); } } ```