Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
✨ support for multibranch pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Nov 5, 2019
1 parent cc9cf62 commit a9f96c3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/job/mod.rs
Expand Up @@ -28,6 +28,8 @@ mod multijob;
pub use self::multijob::MultiJobProject;
mod external;
pub use self::external::ExternalJob;
mod multibranch_pipeline;
pub use multibranch_pipeline::WorkflowMultiBranchProject;

impl Jenkins {
/// Get a `Job` from it's `job_name`
Expand Down
42 changes: 42 additions & 0 deletions src/job/multibranch_pipeline.rs
@@ -0,0 +1,42 @@
use serde::Deserialize;

use crate::helpers::Class;

use super::{Job, ShortJob};
use crate::action::CommonAction;

/// A pipeline project
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowMultiBranchProject {
/// Name of the job
pub name: String,
/// Display Name of the job
pub display_name: String,
/// Full Display Name of the job
pub full_display_name: Option<String>,
/// Full Name of the job
pub full_name: Option<String>,
/// Display Name of the job
pub display_name_or_null: Option<String>,
/// URL for the job
pub url: String,
/// Description of the job
pub description: String,
/// Actions of a job
pub actions: Vec<Option<CommonAction>>,
/// List of the jobs
pub jobs: Vec<ShortJob>,
}

register_class!("org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" => WorkflowMultiBranchProject);

impl Job for WorkflowMultiBranchProject {
fn url(&self) -> &str {
&self.url
}

fn name(&self) -> &str {
&self.name
}
}

0 comments on commit a9f96c3

Please sign in to comment.