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


Java MacroEvaluationException类代码示例

本文整理汇总了Java中org.jenkinsci.plugins.tokenmacro.MacroEvaluationException的典型用法代码示例。如果您正苦于以下问题:Java MacroEvaluationException类的具体用法?Java MacroEvaluationException怎么用?Java MacroEvaluationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> build, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException {
    EnforcePublisher enforcePublisher = (EnforcePublisher) build.getProject().getPublishersList().get(EnforcePublisher.DESCRIPTOR);
    PieChartData pieChartData = enforcePublisher.getPieChartData(build, listener);
    if (null == pieChartData) {
        return "";
    }
    StringBuilder coverageResult = new StringBuilder();
    if (pieChartData.coverageDataExists()) {
        coverageResult.append("Coverage Result: ");
        coverageResult.append(pieChartData.getRoundedPercentage(2));
        coverageResult.append("% of code coverage, ");
        coverageResult.append(pieChartData.getCoveragePercentStatus());
        coverageResult.append(" status.");
    }
    return coverageResult.toString();
}
 
开发者ID:fundacionjala,项目名称:enforce-jenkins-plugin,代码行数:18,代码来源:EnforceCoverageResultTokenMacro.java

示例2: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> context, TaskListener listener, String macroName) 
        throws MacroEvaluationException, IOException, InterruptedException {
    GhprcCause cause = (GhprcCause) context.getCause(GhprcCause.class);
    if (cause == null) {
        return "";
    }

    if (macroName.equals("PR_Title")) {
        return cause.getTitle();
    } else if (macroName.equals("PR_Email")) {
        return cause.getAuthorEmail();
    } else {
        return "";
    }
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:17,代码来源:GhprcTokenMacro.java

示例3: replacedCopy

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
/**
 * Copy Factory
 *
 * @param r replacer
 * @return replaced copy
 */
public AWSEBDeploymentConfig replacedCopy(Utils.Replacer r) throws MacroEvaluationException, IOException, InterruptedException {
  return new AWSEBDeploymentConfig(
      r.r(this.getCredentialId()),
      r.r(this.getAwsRegion()),
      r.r(this.getApplicationName()),
      r.r(this.getEnvironmentName()),
      r.r(this.getBucketName()),
      r.r(this.getKeyPrefix()),
      r.r(this.getVersionLabelFormat()),
      r.r(this.getVersionDescriptionFormat()),
      r.r(this.getRootObject()),
      r.r(this.getIncludes()),
      r.r(this.getExcludes()),
      this.isZeroDowntime(),
      this.getSleepTime(),
      this.isCheckHealth(),
      this.getMaxAttempts(),
      this.credentials
  );
}
 
开发者ID:ingenieux,项目名称:awseb-deployment-plugin,代码行数:27,代码来源:AWSEBDeploymentConfig.java

示例4: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> build, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException {
    AbstractTestResultAction<?> testResultContainer = build.getAction(AbstractTestResultAction.class);
    StringBuilder testResult = new StringBuilder();
    if (testResultContainer != null) {
        String testResultDescription = testResultContainer.getBuildHealth().getDescription();
        testResult.append(testResultDescription);
        Integer failedUnitTests = testResultContainer.getFailedTests().size();
        if (failedUnitTests > 0) {
            testResult.append("\nFailures:");
            Integer processedUnitTests = 0;
            for (TestResult testResultItem : testResultContainer.getFailedTests()) {
                testResult.append(Constants.LINE_SEPARATOR).append("\n").append(testResultItem.getFullName());
                if ((null != testResultItem.getErrorDetails()) && !testResultItem.getErrorDetails().trim().isEmpty()) {
                    testResult.append("\n-------- Message --------\n").append(testResultItem.getErrorDetails().trim());
                }
                if ((null != testResultItem.getStderr()) && !testResultItem.getStderr().trim().isEmpty()) {
                    testResult.append("\n-------- Stacktrace --------\n").append(testResultItem.getStderr().trim());
                }
                processedUnitTests++;
                if (processedUnitTests.equals(failedUnitTests)) {
                    testResult.append(Constants.LINE_SEPARATOR);
                }
            }
        }
    }
    return testResult.toString();
}
 
开发者ID:fundacionjala,项目名称:enforce-jenkins-plugin,代码行数:29,代码来源:EnforceTestResultTokenMacro.java

示例5: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> build, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException {
    EnforcePublisher enforcePublisher = (EnforcePublisher) build.getProject().getPublishersList().get(EnforcePublisher.DESCRIPTOR);
    PieChartData pieChartData = enforcePublisher.getPieChartData(build, listener);
    if (null == pieChartData) {
        return "";
    }
    StringBuilder coverageStatus = new StringBuilder();
    if (pieChartData.dataExists()) {
        coverageStatus.append("Coverage Status: ");
        coverageStatus.append(pieChartData.getFileCoverageStatus());
    }
    return coverageStatus.toString();
}
 
开发者ID:fundacionjala,项目名称:enforce-jenkins-plugin,代码行数:15,代码来源:EnforceCoverageStatusTokenMacro.java

示例6: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> context, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException {
    if (value == null || regex == null) {
        return value == null ? "" : value;
    }

    Matcher matcher = Pattern.compile(regex).matcher(value);
    return matcher.find() ? matcher.group() : value;
}
 
开发者ID:jimgolfgti,项目名称:graphite-events-plugin,代码行数:10,代码来源:ValueRegExMacro.java

示例7: expand

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
private static String expand(AbstractBuild<?, ?> build, BuildListener listener, String template) {
    try {
        return TokenMacro.expandAll(build, listener, template, false, null);
    } catch (MacroEvaluationException | IOException | InterruptedException mee) {
        throw new RuntimeException(mee);
    }
}
 
开发者ID:jimgolfgti,项目名称:graphite-events-plugin,代码行数:8,代码来源:GraphiteEventNotifier.java

示例8: expandAllMacros

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
public static String expandAllMacros(AbstractBuild<?, ?> context, TaskListener listener,
                                     String stringPerhapsWithMacro) throws
        MacroEvaluationException, IOException, InterruptedException {
    if (StringUtils.isBlank(stringPerhapsWithMacro)) {
        return stringPerhapsWithMacro;
    }
    int index = stringPerhapsWithMacro.indexOf("${");
    if (index == -1) {
        return stringPerhapsWithMacro;
    }
    return TokenMacro.expandAll(context, listener, stringPerhapsWithMacro);
}
 
开发者ID:jenkinsci,项目名称:deployer-framework-plugin,代码行数:13,代码来源:DeployTarget.java

示例9: DeploymentInfo

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
/**
 * Constructor for reading the manifest.yml file.
 * Takes an appInfo Map that is created from a ManifestReader.
 */
public DeploymentInfo(AbstractBuild build, TaskListener listener, PrintStream logger, Map<String, Object> appInfo,
                      String jenkinsBuildName, String defaultDomain, String manifestPath)
        throws IOException, ManifestParsingException, InterruptedException, MacroEvaluationException {

    readManifestFile(logger, appInfo, jenkinsBuildName, defaultDomain, manifestPath);
    expandTokenMacros(build, listener);
}
 
开发者ID:hpcloud,项目名称:cloudfoundry-jenkins,代码行数:12,代码来源:DeploymentInfo.java

示例10: expandTokenMacros

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
private void expandTokenMacros(AbstractBuild build, TaskListener listener)
        throws InterruptedException, MacroEvaluationException, IOException {

    this.appName = TokenMacro.expandAll(build, listener, this.appName);
    this.hostname = TokenMacro.expandAll(build, listener, this.hostname);
    this.appPath = TokenMacro.expandAll(build, listener, this.appPath);
    this.buildpack = TokenMacro.expandAll(build, listener, this.buildpack);
    this.command = TokenMacro.expandAll(build, listener, this.command);
    this.domain = TokenMacro.expandAll(build, listener, this.domain);

    Map<String, String> expandedEnvVars = new HashMap<String, String>();
    for (String envVarName : this.envVars.keySet()) {
        try {
            String expandedEnvVarName = TokenMacro.expandAll(build, listener, envVarName);
            String expandedEnvVarValue = TokenMacro.expandAll(build, listener, this.envVars.get(envVarName));
            expandedEnvVars.put(expandedEnvVarName, expandedEnvVarValue);
        } catch (MacroEvaluationException e) {
            // If a token exists but isn't recognized, then it's probably an environment variable
            // meant for the CF target, so leave it alone.
            expandedEnvVars.put(envVarName, this.envVars.get(envVarName));
        }
    }
    this.envVars = expandedEnvVars;

    List<String> expandedServicesNames = new ArrayList<String>();
    for (String serviceName : this.servicesNames) {
        String expandedServiceName = TokenMacro.expandAll(build, listener, serviceName);
        expandedServicesNames.add(expandedServiceName);
    }
    this.servicesNames = expandedServicesNames;
}
 
开发者ID:hpcloud,项目名称:cloudfoundry-jenkins,代码行数:32,代码来源:DeploymentInfo.java

示例11: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> abstractBuild, TaskListener taskListener, String s) throws MacroEvaluationException, IOException, InterruptedException {
    Node node = abstractBuild.getBuiltOn();
    if( node instanceof DockerTransientNode) {
        return ((DockerTransientNode) node).getContainerId();
    }

    return null;
}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:10,代码来源:DockerHostTokenMacro.java

示例12: perform

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public void perform(hudson.model.Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException {

    List<String> expandedTags;

    expandedTags = expandTags(run, workspace, launcher, listener);
    String expandedDockerFileDirectory = dockerFileDirectory;
    try {
        expandedDockerFileDirectory = TokenMacro.expandAll(run, workspace, listener, this.dockerFileDirectory);
    } catch (MacroEvaluationException e) {
        listener.getLogger().println("Couldn't macro expand docker file directory " + dockerFileDirectory);
    }
    new Run(run, launcher, listener, new FilePath(workspace, expandedDockerFileDirectory), expandedTags, getCloud(launcher)).run();

}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:16,代码来源:DockerBuilderPublisher.java

示例13: expandTags

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
private List<String> expandTags(hudson.model.Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) {
    List<String> eTags = new ArrayList<>(tags.size());
    for (String tag : tags) {
        try {
            eTags.add(TokenMacro.expandAll(build, workspace, listener, tag));
        } catch (MacroEvaluationException | IOException | InterruptedException e) {
            listener.getLogger().println("Couldn't macro expand tag " + tag);
        }
    }
    return eTags;
}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:12,代码来源:DockerBuilderPublisher.java

示例14: evaluateMacro

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
private String evaluateMacro(Run<?, ?> build, FilePath workspace, TaskListener listener, String value) throws InterruptedException, IOException {
    try {
        return TokenMacro.expandAll(build, workspace, listener, value);
    } catch (MacroEvaluationException e) {
        log(listener, String.format("Could not evaluate macro '%s': %s", value, e.getMessage()));
    }
    return value;
}
 
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:9,代码来源:CucumberReportPublisher.java

示例15: evaluate

import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; //导入依赖的package包/类
@Override
public String evaluate(AbstractBuild<?, ?> context, TaskListener listener, String macroName)
        throws MacroEvaluationException, IOException, InterruptedException {
    Map<String, String> env = context.getEnvironment(listener);
    if (env.containsKey(NAME)) {
        if (stripSnapshot) {
            String version = env.get(NAME);
            return version.replace("-SNAPSHOT", "");
        } else {
            return env.get(NAME);
        }
    }
    return "";
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:15,代码来源:EnvVersionTokenMacro.java


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