jenkins.model.Jenkins.getNodeProperties()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(233)

本文整理了Java中jenkins.model.Jenkins.getNodeProperties()方法的一些代码示例,展示了Jenkins.getNodeProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getNodeProperties()方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getNodeProperties

Jenkins.getNodeProperties介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Accepts submission from the node configuration page.
  3. */
  4. @RequirePOST
  5. public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  6. checkPermission(ADMINISTER);
  7. BulkChange bc = new BulkChange(this);
  8. try {
  9. JSONObject json = req.getSubmittedForm();
  10. ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json);
  11. getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
  12. } finally {
  13. bc.commit();
  14. }
  15. updateComputerList();
  16. rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page
  17. }

代码示例来源:origin: jenkinsci/configuration-as-code-plugin

  1. @Test
  2. @Issue("Issue #173")
  3. @ConfiguredWithCode("SetEnvironmentVariable.yml")
  4. public void shouldSetEnvironmentVariable() throws Exception {
  5. final DescribableList<NodeProperty<?>, NodePropertyDescriptor> properties = Jenkins.getInstance().getNodeProperties();
  6. EnvVars env = new EnvVars();
  7. for (NodeProperty<?> property : properties) {
  8. property.buildEnvVars(env, TaskListener.NULL);
  9. }
  10. assertEquals("BAR", env.get("FOO"));
  11. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. /**
  2. * Accepts submission from the node configuration page.
  3. */
  4. @RequirePOST
  5. public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  6. checkPermission(ADMINISTER);
  7. BulkChange bc = new BulkChange(this);
  8. try {
  9. JSONObject json = req.getSubmittedForm();
  10. MasterBuildConfiguration mbc = MasterBuildConfiguration.all().get(MasterBuildConfiguration.class);
  11. if (mbc!=null)
  12. mbc.configure(req,json);
  13. getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
  14. } finally {
  15. bc.commit();
  16. }
  17. updateComputerList();
  18. rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page
  19. }

相关文章

Jenkins类方法