当前位置: 首页>>代码示例>>Java>>正文


Java AbstractBuild.getEnvironment方法代码示例

本文整理汇总了Java中hudson.model.AbstractBuild.getEnvironment方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractBuild.getEnvironment方法的具体用法?Java AbstractBuild.getEnvironment怎么用?Java AbstractBuild.getEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.AbstractBuild的用法示例。


在下文中一共展示了AbstractBuild.getEnvironment方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
        BuildListener listener) throws InterruptedException, IOException {
    EnvVars envVars = build.getEnvironment(listener);
    String expandedFilename = envVars.expand(filename);
    String expandedContent = envVars.expand(content);
    
    FilePath file = build.getWorkspace().child(expandedFilename);
    file.write(expandedContent, encoding);
    return true;
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:12,代码来源:FileWriteBuilder.java

示例2: parseBuildParams

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
private void parseBuildParams(AbstractBuild<?, ?> build, BuildListener listener) throws IOException, InterruptedException {
    final EnvVars envVars = build.getEnvironment(listener);
    final VariableResolver<String> buildVariableResolver = build.getBuildVariableResolver();

    clearEvaluated();
    evaluatedJaasEndpoint = evaluate(jaasEndpoint, buildVariableResolver, envVars);
    evaluatedTestProjectUrl = evaluate(testProjectUrl, buildVariableResolver, envVars);
    evaluatedEnvId = evaluate(envId, buildVariableResolver, envVars);
    evaluatedLoadScenarioId = evaluate(loadScenarioId, buildVariableResolver, envVars);
    evaluatedTimeout = evaluate(executionStartTimeoutInSeconds, buildVariableResolver, envVars);
}
 
开发者ID:griddynamics,项目名称:jagger-jaas-jenkins-plugin,代码行数:12,代码来源:JaggerTestExecutionBuilder.java

示例3: newTelegramService

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
public TelegramService newTelegramService(AbstractBuild r, BuildListener listener) {


        String authToken = this.authToken;
        if (StringUtils.isEmpty(authToken)) {
            authToken = getDescriptor().getToken();
        }
        String chatId = this.chatId;
        if (StringUtils.isEmpty(chatId)) {
            chatId = getDescriptor().getChatId();
        }

        EnvVars env = null;
        try {
            env = r.getEnvironment(listener);
        } catch (Exception e) {
            listener.getLogger().println("Error retrieving environment vars: " + e.getMessage());
            env = new EnvVars();
        }
        authToken = env.expand(authToken);
        chatId = env.expand(chatId);

        return new StandardTelegramService(authToken, chatId);
    }
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:25,代码来源:TelegramNotifier.java

示例4: setUp

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public EphemeralDeployment setUp(AbstractBuild build, Launcher launcher, BuildListener listener)
    throws IOException, InterruptedException {
  EnvVars environment = build.getEnvironment(listener);
  FilePath workspace = requireNonNull(build.getWorkspace());

  try {
    synchronized (deployment) {
      deployment.insert(workspace, environment, listener.getLogger());
    }
  } catch (CloudManagementException e) {
    e.printStackTrace(listener.error(e.getMessage()));
    return null; // Build must be aborted
  }

  return new EphemeralDeployment(environment);
}
 
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:21,代码来源:GoogleCloudManagerBuildWrapper.java

示例5: sendNotificationToSlack

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
private void sendNotificationToSlack(AbstractBuild<?, ?> build, BuildListener listener, String url) throws Exception {
  HttpClient httpClient = HttpClientBuilder.create().build();

  EnvVars envVars = build.getEnvironment(listener);
  Request payload = new Request(Attachment.build(envVars, build.getResult()));

  HttpPost request = new HttpPost(url);
  StringEntity params = new StringEntity(GsonHelper.getCommonParser().toJson(payload));
  request.addHeader("content-type", "application/json");
  request.setEntity(params);

  httpClient.execute(request);
}
 
开发者ID:xmartlabs,项目名称:BuildSlackNotifier,代码行数:14,代码来源:BuildSlackNotifier.java

示例6: consolidateEnvVars

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
protected Map<String, String> consolidateEnvVars(TaskListener listener,
        AbstractBuild<?, ?> build,
        Launcher launcher) {
    // EnvVars extends TreeMap
    TreeMap<String, String> overrides = new TreeMap<String, String>();
    // merge from all potential sources
    if (build != null) {
        try {
            EnvVars buildEnv = build.getEnvironment(listener);
            if (isVerbose())
                listener.getLogger()
                        .println("build env vars:  " + buildEnv);
            overrides.putAll(buildEnv);
        } catch (IOException | InterruptedException e) {
            if (isVerbose())
                e.printStackTrace(listener.getLogger());
        }
    }

    try {
        EnvVars computerEnv = null;
        Computer computer = Computer.currentComputer();
        if (computer != null) {
            computerEnv = computer.getEnvironment();
        } else {
            if (launcher != null)
                computer = launcher.getComputer();
            if (computer != null) {
                computerEnv = computer.getEnvironment();
            }
        }
        if (isVerbose())
            listener.getLogger().println(
                    "computer env vars:  " + computerEnv);
        if (computerEnv != null)
            overrides.putAll(computerEnv);
    } catch (IOException | InterruptedException e2) {
        if (isVerbose())
            e2.printStackTrace(listener.getLogger());
    }

    return overrides;
}
 
开发者ID:openshift,项目名称:jenkins-client-plugin,代码行数:44,代码来源:BaseStep.java

示例7: EnvVariableResolver

import hudson.model.AbstractBuild; //导入方法依赖的package包/类
public EnvVariableResolver(AbstractBuild<?, ?> build, BuildListener listener)
        throws IOException, InterruptedException {
    environment = build.getEnvironment(listener);
    environment.overrideAll(build.getBuildVariables());
}
 
开发者ID:agovindaraju,项目名称:vmware-vrealize-orchestrator,代码行数:6,代码来源:EnvVariableResolver.java


注:本文中的hudson.model.AbstractBuild.getEnvironment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。