{"id":15045327,"url":"https://github.com/jenkinsci/conditional-buildstep-plugin","last_synced_at":"2025-04-10T00:18:19.241Z","repository":{"id":544018,"uuid":"2491350","full_name":"jenkinsci/conditional-buildstep-plugin","owner":"jenkinsci","description":"Jenkins plugin that allows conditions to controls step execution","archived":false,"fork":false,"pushed_at":"2025-04-07T14:55:16.000Z","size":315,"stargazers_count":18,"open_issues_count":1,"forks_count":39,"subscribers_count":99,"default_branch":"master","last_synced_at":"2025-04-10T00:18:14.430Z","etag":null,"topics":["adopt-this-plugin","jenkins-builder","jenkins-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/conditional-buildstep","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"imod/conditional-buildstep-plugin","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.adoc","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-30T18:54:26.000Z","updated_at":"2025-04-07T14:55:20.000Z","dependencies_parsed_at":"2023-09-26T00:41:05.736Z","dependency_job_id":"c50f9b4d-4ba9-4c4e-8cac-49926332d565","html_url":"https://github.com/jenkinsci/conditional-buildstep-plugin","commit_stats":{"total_commits":199,"total_committers":30,"mean_commits":6.633333333333334,"dds":0.5979899497487438,"last_synced_commit":"faf79f9eb53df2c125106afa907fd5e61fb943c7"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fconditional-buildstep-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fconditional-buildstep-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fconditional-buildstep-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fconditional-buildstep-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/conditional-buildstep-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adopt-this-plugin","jenkins-builder","jenkins-plugin"],"created_at":"2024-09-24T20:51:44.312Z","updated_at":"2025-04-10T00:18:19.214Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Conditional Build Step Plugin for Jenkins\n\nimage:https://img.shields.io/jenkins/plugin/v/conditional-buildstep.svg[link=\"https://plugins.jenkins.io/conditional-buildstep\"]\nimage:https://img.shields.io/github/release/jenkinsci/conditional-buildstep-plugin.svg?label=changelog[link=\"https://github.com/jenkinsci/conditional-buildstep-plugin/releases/latest\"]\nimage:https://img.shields.io/jenkins/plugin/i/conditional-buildstep.svg?color=blue[link=\"https://plugins.jenkins.io/conditional-buildstep\"]\n\nA buildstep wrapping any number of other buildsteps, controlling their execution based on a defined condition.\n\n== Info\n\nThis plugin requires the\nhttps://plugins.jenkins.io/token-macro/[TokenMacro Plugin] and the \nhttps://plugins.jenkins.io/run-condition/[Run Condition Plugin] to be installed!\n\n* Ever wanted to have more control whether a step should be executed or not?\n* Want to reduce the number of jobs doing nearly the same thing?\n\nAdd a conditional buildstep which acts as a container.\nIt will allow you to define a condition controling the execution of the step(s).\n\n== Conditions\n\nThere are multiple conditions one can choose of, these are all defined by the\nhttps://plugins.jenkins.io/run-condition/[Run Condition Plugin]\n\nMissing builder\n\nIf you're not able to add the builder of your choice within a\nconditional build step (because it's not available within the dropdown),\nthen this is likely because the builder does not provide a\n`@DataBoundConstructor` constructor and/or the Descriptor does not\nextend `hudson.tasks.BuildStepDescriptor`.\nFor non programmers: the plugin you would like to use does not yet follow the newest Jenkins coding guidelines.\nWithout this, the conditional buildstep plugin is not able to work with it.\n\n== Conditional step (single)\n\n// TODO: Move https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=59507542 to the documentation\n\nThis build step allows you to select any build step and define a\ncondition to control whether the step should be executed.\n\n=== Freedom to re-order\n\nAs there is only one build step within the builder, they can all be re-ordered independantly - in the multiple step, they can only be re-ordered within that step.\nThis also gives the ability to add build steps in the middle of the current list of steps, where the new step may run on every build, or use a different condition from the steps surrounding it.\nObviously, the Conditional step (multiple) itself can be moved around.\n\n=== Move a step from one condition to another\n\nIf you have several steps that are controlled by two conditions (via EnvInject), then you can easily swith the boolean condition for a single step to use the other condition.\nWith the multiple, all contained steps use the same condition, so again the step would have to be deleted and then added to the other conditional step.\n\n=== Multiple steps can still be controlled by a single condition (EnvInject)\n\nYou can still run multiple build steps based on the result of a single evaluation of a run condition.\nConfigure a run condition and in the action choose 'Inject environment variables' provied by the EnvInject Plugin.\nIn the 'Properties Content' set a variable that will evaluate to true by the Boolean run condition e.g. `CONDITION_X=y`.\nNow, for all the build steps that you want to run depending on that condition, use the Boolean run condition with `${ENV,var=\"CONDITION_X\"}`.\n\n=== Multiple steps can still be controlled by a single condition (EnvInject)\n\nThis still requires extra configuration, and even an extra build step.\n\n=== GUI space\n\nMany Conditional step (single) build steps will take up a very large area of the configure page which can make the configuration more difficult to read.\n\nimage:docs/images/screen-capture-1.jpg[image]\n\n== Conditional steps (multiple)\n\nA _Conditional steps (multiple)_ container is able to contain any number\nof any other buildsteps (e.g. Shell, Ant, Maven,...) and you can have\nany number of 'Conditional Steps' containers, each configured with a\ndifferent condition.\n\nimage:docs/images/screen-capture-2.jpg[image]\n\n== Examples\n\nPlease check out the examples at the https://plugins.jenkins.io/run-condition/[Run Condition Plugin]\n\n== Move steps inside conditional steps\n\nTo move all of the current build steps within a freestyle project into a conditional step (single) you can call a utility method from the script console.\nThe project build will not be affected in any way (other than some extra text in the build console), as the order of the build steps is preserved, and all of the run conditions will be 'Always'.\nBuild steps that cannot be moved into a conditional step will not be moved.\n\nFrom Manage Jenkins, Script console, enter the following to update a project called 'My Project'\n\n[source,groovy]\n----\nimport static org.jenkinsci.plugins.conditionalbuildstep.singlestep.JobUpdater.*\n\ndef job = hudson.model.Hudson.instance.getItem('My Project')\nupdateBuilders job\n----\n\nAfter running, go to the configure page, check everything looks ok, then save the configuration.\n\nYou can now easily enable and disable the build steps without losing the configuration.\n\n== Changelog\n\n* For recent versions, see https://github.com/jenkinsci/conditional-buildstep-plugin/releases[GitHub Releases]\n* For versions 1.3.6 and older, see the link:https://github.com/jenkinsci/conditional-buildstep-plugin/blob/master/CHANGELOG.adoc[legacy CHANGELOG].\n\n== Reporting issues\n\nPlease report issues and enhancements through the link:Please report issues and enhancements through the [Jenkins issue tracker](https://www.jenkins.io/participate/report-issue/redirect/#15947)[Jenkins issue tracker].\n\n== Getting Help\n\nFor help please use the https://community.jenkins.io[community forum], https://www.jenkins.io/mailing-lists/[Jenkins users mailing list], or link:https://www.jenkins.io/chat/[chat channels].\n\n== License\n\n// TODO: Add License File to the repo\nLicensed under the https://opensource.org/licenses/MIT[MIT Licence].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fconditional-buildstep-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fconditional-buildstep-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fconditional-buildstep-plugin/lists"}