Module: Cigale::Property
- Defined in:
- lib/cigale/property.rb,
lib/cigale/property/slack.rb,
lib/cigale/property/inject.rb,
lib/cigale/property/sidebar.rb,
lib/cigale/property/throttle.rb,
lib/cigale/property/heavy-job.rb,
lib/cigale/property/ownership.rb,
lib/cigale/property/least-load.rb,
lib/cigale/property/batch-tasks.rb,
lib/cigale/property/copyartifact.rb,
lib/cigale/property/zeromq-event.rb,
lib/cigale/property/authorization.rb,
lib/cigale/property/delivery-pipeline.rb,
lib/cigale/property/slave-utilization.rb,
lib/cigale/property/builds-chain-fingerprinter.rb
Defined Under Namespace
Classes: CustomProperty
Instance Method Summary collapse
- #property_classes ⇒ Object
- #translate_authorization_property(xml, pdef) ⇒ Object
- #translate_batch_tasks_property(xml, pdef) ⇒ Object
- #translate_builds_chain_fingerprinter_property(xml, pdef) ⇒ Object
- #translate_copyartifact_property(xml, pdef) ⇒ Object
- #translate_delivery_pipeline_property(xml, pdef) ⇒ Object
- #translate_heavy_job_property(xml, pdef) ⇒ Object
- #translate_inject_property(xml, pdef) ⇒ Object
- #translate_least_load_property(xml, pdef) ⇒ Object
- #translate_ownership_property(xml, pdef) ⇒ Object
- #translate_properties(xml, jdef) ⇒ Object
- #translate_properties_inner(xml, props) ⇒ Object
- #translate_sidebar_properties(xml, pdefs) ⇒ Object
- #translate_slack_property(xml, pdef) ⇒ Object
- #translate_slave_utilization_property(xml, pdef) ⇒ Object
- #translate_throttle_property(xml, pdef) ⇒ Object
- #translate_zeromq_event_property(xml, pdef) ⇒ Object
Instance Method Details
#property_classes ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cigale/property.rb', line 21 def property_classes @property_classes ||= { "inject" => "EnvInjectJobProperty", "least-load" => "org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty", "delivery-pipeline" => "se.diabol.jenkins.pipeline.PipelineProperty", "ownership" => "com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty", "builds-chain-fingerprinter" => "org.jenkinsci.plugins.buildschainfingerprinter.AutomaticFingerprintJobProperty", "slave-utilization" => "com.suryagaddipati.jenkins.SlaveUtilizationProperty", "authorization" => "hudson.security.AuthorizationMatrixProperty", "batch-tasks" => "hudson.plugins.batch__task.BatchTaskProperty", "heavy-job" => "hudson.plugins.heavy__job.HeavyJobProperty", "throttle" => "hudson.plugins.throttleconcurrents.ThrottleJobProperty", "zeromq-event" => "org.jenkinsci.plugins.ZMQEventPublisher.HudsonNotificationProperty", "slack" => ["jenkins.plugins.slack.SlackNotifier_-SlackJobProperty", :plugin => "[email protected]"], "copyartifact" => CustomProperty.new, } end |
#translate_authorization_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cigale/property/authorization.rb', line 3 def (xml, pdef) ||= { "job-read" => "hudson.model.Item.Read", "job-extended-read" => "hudson.model.Item.ExtendedRead", } pdef.each do |role, perms| for perm in perms pclass = [perm] or raise "Unknown authorization permission: #{perm}" xml. "#{pclass}:#{role}" end end end |
#translate_batch_tasks_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/cigale/property/batch-tasks.rb', line 3 def translate_batch_tasks_property (xml, pdef) xml.tasks do for task in pdef xml.tag! "hudson.plugins.batch__task.BatchTask" do xml.name task["name"] xml.script task["script"] end end end end |
#translate_builds_chain_fingerprinter_property(xml, pdef) ⇒ Object
3 4 5 6 |
# File 'lib/cigale/property/builds-chain-fingerprinter.rb', line 3 def translate_builds_chain_fingerprinter_property (xml, pdef) xml.isPerBuildsChainEnabled pdef["per-builds-chain"] xml.isPerJobsChainEnabled pdef["per-job-chain"] end |
#translate_copyartifact_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/cigale/property/copyartifact.rb', line 3 def translate_copyartifact_property (xml, pdef) xml.tag! "hudson.plugins.copyartifact.CopyArtifactPermissionProperty", :plugin => "copyartifact" do xml.projectNameList do xml.string pdef["projects"] end end end |
#translate_delivery_pipeline_property(xml, pdef) ⇒ Object
3 4 5 6 |
# File 'lib/cigale/property/delivery-pipeline.rb', line 3 def translate_delivery_pipeline_property (xml, pdef) xml.stageName pdef["stage"] xml.taskName pdef["task"] end |
#translate_heavy_job_property(xml, pdef) ⇒ Object
3 4 5 |
# File 'lib/cigale/property/heavy-job.rb', line 3 def translate_heavy_job_property (xml, pdef) xml.weight pdef["weight"] end |
#translate_inject_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cigale/property/inject.rb', line 3 def translate_inject_property (xml, pdef) xml.info do if props = pdef["properties-content"] xml.propertiesContent props end xml.loadFilesFromMaster false end xml.on true xml.keepJenkinsSystemVariables boolp(pdef["keep-system-variables"], true) xml.keepBuildVariables boolp(pdef["keep-build-variables"], true) xml.overrideBuildParameters boolp(pdef["override-build-parameters"], false) end |
#translate_least_load_property(xml, pdef) ⇒ Object
3 4 5 |
# File 'lib/cigale/property/least-load.rb', line 3 def translate_least_load_property (xml, pdef) xml.leastLoadDisabled pdef["disabled"] end |
#translate_ownership_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/cigale/property/ownership.rb', line 3 def translate_ownership_property (xml, pdef) xml.ownership do xml.ownershipEnabled true xml.primaryOwnerId pdef["owner"] xml.coownersIds do for co in pdef["co-owners"] xml.string co end end end end |
#translate_properties(xml, jdef) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cigale/property.rb', line 39 def translate_properties (xml, jdef) props = toa jdef["properties"] parameters = toa jdef["parameters"] if props.empty? && parameters.empty? return xml.properties end xml.properties do translate_properties_inner xml, props unless parameters.empty? xml.tag! "hudson.model.ParametersDefinitionProperty" do xml.parameterDefinitions do translate_parameters_inner xml, parameters end end end end end |
#translate_properties_inner(xml, props) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/cigale/property.rb', line 60 def translate_properties_inner (xml, props) = [] for p in props type, spec = asplode(p) case type when "sidebar" << spec else translate("property", xml, type, spec) end end # for unless .empty? xml, end end |
#translate_sidebar_properties(xml, pdefs) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cigale/property/sidebar.rb', line 3 def (xml, pdefs) xml.tag! "hudson.plugins.sidebar__link.ProjectLinks" do xml.links do for pdef in pdefs xml.tag! "hudson.plugins.sidebar__link.LinkAction" do xml.url pdef["url"] xml.text pdef["text"] xml.icon pdef["icon"] end end end end end |
#translate_slack_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cigale/property/slack.rb', line 3 def translate_slack_property (xml, pdef) xml.teamDomain pdef["team-domain"] xml.token pdef["token"] xml.room pdef["room"] notify = toh pdef["notify"] xml.startNotification boolp(notify["start"], false) xml.notifySuccess boolp(notify["success"], false) xml.notifyAborted boolp(notify["aborted"], false) xml.notifyNotBuilt boolp(notify["not-built"], false) xml.notifyUnstable boolp(notify["unstable"], false) xml.notifyFailure boolp(notify["failure"], false) xml.notifyBackToNormal boolp(notify["back-to-normal"], false) xml.notifyRepeatedFailures boolp(notify["repeated-failure"], false) xml.includeTestSummary boolp(pdef["include-test-summary"], false) xml.showCommitList boolp(notify["show-commit-list"], false) xml.includeCustomMessage !!pdef["custom-message"] xml.customMessage pdef["custom-message"] end |
#translate_slave_utilization_property(xml, pdef) ⇒ Object
3 4 5 6 7 |
# File 'lib/cigale/property/slave-utilization.rb', line 3 def translate_slave_utilization_property (xml, pdef) xml.needsExclusiveAccessToNode (false == pdef["single-instance-per-slave"]) xml.slaveUtilizationPercentage pdef["slave-percentage"] || 0 xml.singleInstancePerSlave boolp(pdef["single-instance-per-slave"], false) end |
#translate_throttle_property(xml, pdef) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cigale/property/throttle.rb', line 3 def translate_throttle_property (xml, pdef) xml.maxConcurrentPerNode 0 xml.maxConcurrentTotal pdef["max-total"] xml.throttleEnabled true xml.categories do for cat in pdef["categories"] xml.string cat end end xml.throttleOption xml.configVersion 1 end |
#translate_zeromq_event_property(xml, pdef) ⇒ Object
3 4 5 |
# File 'lib/cigale/property/zeromq-event.rb', line 3 def translate_zeromq_event_property (xml, pdef) xml.enabled true end |