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

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

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

Jenkins.getNodeProperties介绍

暂无

代码示例

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

/**
 * Accepts submission from the node configuration page.
 */
@RequirePOST
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  checkPermission(ADMINISTER);
  BulkChange bc = new BulkChange(this);
  try {
    JSONObject json = req.getSubmittedForm();
    ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json);
    getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
  } finally {
    bc.commit();
  }
  updateComputerList();
  rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl());  // back to the computer page
}

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

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

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

/**
 * Accepts submission from the node configuration page.
 */
@RequirePOST
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  checkPermission(ADMINISTER);
  BulkChange bc = new BulkChange(this);
  try {
    JSONObject json = req.getSubmittedForm();
    MasterBuildConfiguration mbc = MasterBuildConfiguration.all().get(MasterBuildConfiguration.class);
    if (mbc!=null)
      mbc.configure(req,json);
    getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
  } finally {
    bc.commit();
  }
  updateComputerList();
  rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl());  // back to the computer page
}

相关文章

Jenkins类方法