hudson.model.Hudson.getGlobalNodeProperties()方法的使用及代码示例

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

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

Hudson.getGlobalNodeProperties介绍

暂无

代码示例

代码示例来源:origin: org.hudsonci.plugins/subversion

static String getUrlWithoutRevision(
    String remoteUrlPossiblyWithRevision) {
    String remoteUrlWithoutRevision = remoteUrlPossiblyWithRevision;
            if (Hudson.getInstance() != null) {
      for (NodeProperty n: Hudson.getInstance().getGlobalNodeProperties()) {
        EnvironmentVariablesNodeProperty gnp = (EnvironmentVariablesNodeProperty)n;
        for (Entry e : gnp.getEnvVars().entrySet()) {
          if (remoteUrlWithoutRevision.contains("${" + e.getKey().toString() + "}")) {
            remoteUrlWithoutRevision = remoteUrlWithoutRevision.replace("${" + e.getKey().toString() + "}", e.getValue().toString()); 
          }
        }
      }
    }
    int idx = remoteUrlWithoutRevision.lastIndexOf('@');
    if (idx > 0) {
      String n = remoteUrlWithoutRevision.substring(idx + 1);
      SVNRevision r = SVNRevision.parse(n);
      if ((r != null) && (r.isValid())) {
        return remoteUrlWithoutRevision.substring(0, idx);
      }
    }
    return remoteUrlWithoutRevision;
  }

代码示例来源:origin: org.jvnet.hudson.plugins/m2-extra-steps

public void buildEnvVars(AbstractBuild<?, ?> build, EnvVars env) {
    for (NodeProperty nodeProperty: Hudson.getInstance().getGlobalNodeProperties()) {
      if (nodeProperty instanceof EnvironmentVariablesNodeProperty) {
        env.overrideAll(((EnvironmentVariablesNodeProperty)nodeProperty).getEnvVars());
      }
    }
    for (NodeProperty nodeProperty: Computer.currentComputer().getNode().getNodeProperties()) {
      if (nodeProperty instanceof EnvironmentVariablesNodeProperty) {
        env.overrideAll(((EnvironmentVariablesNodeProperty)nodeProperty).getEnvVars());
      }
    }
  }
}

代码示例来源:origin: org.jvnet.hudson.plugins/git

for (NodeProperty nodeProperty : Hudson.getInstance().getGlobalNodeProperties()) {
  Environment environment = nodeProperty.setUp(b, launcher, (BuildListener) buildListener);
  if (environment != null) {

代码示例来源:origin: org.hudsonci.plugins/git

for (NodeProperty nodeProperty : Hudson.getInstance().getGlobalNodeProperties()) {
  Environment environment = nodeProperty.setUp(b, launcher, (BuildListener) buildListener);
  if (environment != null) {

相关文章

微信公众号

最新文章

更多

Hudson类方法