• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ConfigurationMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: checkFail

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
private boolean checkFail(ConfigurationMap config, String key, long actual) {
	
	String value = config.get(key);
	
	if (value == null || value.equals("")) {	//$NON-NLS-1$
		logger.info(key + ".none");		//$NON-NLS-1$
		return false;
	}
	
	long limit = Long.parseLong(value);
	
	if (actual > limit) {
		logger.error(key + ".fail", actual, limit); //$NON-NLS-1$
		return true;
	}
	
	logger.info(key + ".pass", actual, limit); //$NON-NLS-1$
	return false;
}
 
开发者ID:AppSecDev,项目名称:asoc-bamboo-plugin,代码行数:20,代码来源:SASTScanTask.java


示例2: processThreshold

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
private void processThreshold(ConfigurationMap config, Map<String, String> checkstyleResults, String type, BuildLogger buildLogger, TaskResultBuilder builder)
{
    String thresholdName = CheckStyleTaskConfigurator.CHECKSTYLE_ERROR_PRIORITY_THRESHOLD;
    String violationName = ICheckStyleBuildProcessor.CHECKSTYLE_ERROR_PRIORITY_VIOLATIONS;
    if ( "warning".equals( type ) )
    {
        thresholdName = CheckStyleTaskConfigurator.CHECKSTYLE_WARNING_PRIORITY_THRESHOLD;
        violationName = ICheckStyleBuildProcessor.CHECKSTYLE_WARNING_PRIORITY_VIOLATIONS;
    }

    int threshold = CheckstylePluginHelper.getThreshold( config.get( thresholdName ) );
    double violations = NumberUtils.toDouble(checkstyleResults.get(violationName), 0);

    if ( threshold >= 0 && violations > threshold )
    {
        String msg = String.format( "Checkstyle %s violations [%s] exceed threshold [%s]", type, violations, threshold );

        buildLogger.addErrorLogEntry(msg);

        builder.failed();
    }
}
 
开发者ID:javiergutites,项目名称:bamboo-checkstyle-plugin,代码行数:23,代码来源:CheckStyleTask.java


示例3: setUpCiBuild

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
private BambooCiBuild setUpCiBuild(TaskContext context, FileHandler logHandler) throws TaskException {
    ConfigurationMap configMap = context.getConfigurationMap();
    BuildContext buildContext = context.getBuildContext();
    buildContext.getBuildDefinition().getTaskDefinitions().get(0).getPluginKey();
    String testId = Utils.cutTestType(configMap.get(Constants.SETTINGS_SELECTED_TEST_ID));
    final BuildLogger logger = context.getBuildLogger();
    BlazeMeterUtils utils;
    try {
        utils = setUpBzmUtils(context, logHandler);
    } catch (Exception e) {
        logger.addBuildLogEntry("Failed to find test = " + testId + " on server.");
        throw new TaskException("");
    }
    String jmeterProps = configMap.get(Constants.SETTINGS_JMETER_PROPERTIES);
    boolean jtlReport = configMap.getAsBoolean(Constants.SETTINGS_JTL_REPORT);
    boolean junitReport = configMap.getAsBoolean(Constants.SETTINGS_JUNIT_REPORT);
    String notes = configMap.get(Constants.SETTINGS_NOTES);
    String jtlPath = configMap.get(Constants.SETTINGS_JTL_PATH);
    String junitPath = configMap.get(Constants.SETTINGS_JUNIT_PATH);

    String dd = context.getWorkingDirectory().getAbsolutePath() + "/build # "
            + context.getBuildContext().getBuildNumber();

    BambooCiPostProcess ciPostProcess = new BambooCiPostProcess(jtlReport, junitReport, jtlPath, junitPath, dd, utils.getNotifier(), utils.getLogger());
    BambooCiBuild build = new BambooCiBuild(utils, testId, jmeterProps, notes, ciPostProcess);
    return build;
}
 
开发者ID:Blazemeter,项目名称:blazemeter-bamboo-plugin,代码行数:28,代码来源:TaskType.java


示例4: execute

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
@NotNull
    @Override
    public TaskResult execute(@NotNull TaskContext taskContext) throws TaskException {
        final BuildLogger buildLogger = taskContext.getBuildLogger();
        final CurrentBuildResult currentBuildResult = taskContext.getBuildContext().getBuildResult();
        TaskResultBuilder builder = TaskResultBuilder.newBuilder(taskContext);

        try {
            final ConfigurationMap configuration = taskContext.getConfigurationMap();
            final Map<String, String> environment = getEnvironment(taskContext);


            final String gradleTask = configuration.get("gradleTask");
            Preconditions.checkNotNull(gradleTask);

            final File workingDirectory = taskContext.getWorkingDirectory();

            buildLogger.addBuildLogEntry(workingDirectory.getAbsolutePath());
            final String runnerPath = GradlewExtractor.getGradlewPath(workingDirectory.getAbsolutePath());
            buildLogger.addBuildLogEntry(runnerPath);

            final List<String> command = Lists.newArrayList(runnerPath, "tasks");

            final LoggingProcessHandler processHandler = new LoggingProcessHandler(buildLogger);
            final ExternalProcess process = new ExternalProcessBuilder()
                    .command(command, workingDirectory)
                    .handler(processHandler)
                    .addMonitor(new LoggingProcessMonitor(buildLogger))
                    .env(environment).build();

            process.execute();
//            buildLogger.addBuildLogEntry(processHandler.getOutput());

            return builder.checkReturnCode(process, 0).build();

        } finally {
            currentBuildResult.addBuildErrors(Lists.newArrayList("Irgendwas lief hier falsch"));
        }

    }
 
开发者ID:bschramke,项目名称:bamboo_plugin_gradlew,代码行数:41,代码来源:GradleBuildTask.java


示例5: getScanConfig

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
private HubScanConfig getScanConfig(final ConfigurationMap configMap, final File workingDirectory, final File toolsDir, final IntLogger logger) throws IOException {
    try {
        final String dryRun = configMap.get(HubScanConfigFieldEnum.DRY_RUN.getKey());
        final String cleanupLogsOnSuccess = configMap.get(HubScanConfigFieldEnum.CLEANUP_LOGS_ON_SUCCESS.getKey());

        final String unmapPreviousCodeLocations = configMap.get(HubScanConfigFieldEnum.UNMAP_PREVIOUS_CODE_LOCATIONS.getKey());
        final String deletePreviousCodeLocations = configMap.get(HubScanConfigFieldEnum.DELETE_PREVIOUS_CODE_LOCATIONS.getKey());

        final String excludePatternsConfig = configMap.get(HubScanConfigFieldEnum.EXCLUDE_PATTERNS.getKey());

        final String[] excludePatterns = HubBambooUtils.getInstance().createExcludePatterns(excludePatternsConfig);

        final String scanMemory = configMap.get(HubScanConfigFieldEnum.SCANMEMORY.getKey());
        final String codeLocationName = configMap.get(HubScanConfigFieldEnum.CODE_LOCATION_ALIAS.getKey()).trim();
        final String targets = configMap.get(HubScanConfigFieldEnum.TARGETS.getKey());

        final String hubWorkspaceCheckString = getPersistedValue(HubConfigKeys.CONFIG_HUB_WORKSPACE_CHECK);

        Boolean hubWorkspaceCheck = true;
        if (StringUtils.isNotBlank(hubWorkspaceCheckString)) {
            hubWorkspaceCheck = Boolean.valueOf(hubWorkspaceCheckString);
        }

        final List<String> scanTargets = HubBambooUtils.getInstance().createScanTargetPaths(targets, workingDirectory);

        if (scanTargets.isEmpty()) {
            // no targets specified assume the working directory.
            scanTargets.add(workingDirectory.getCanonicalPath());
        }

        final HubScanConfigBuilder hubScanConfigBuilder = new HubScanConfigBuilder();
        hubScanConfigBuilder.setWorkingDirectory(workingDirectory);
        hubScanConfigBuilder.setDryRun(Boolean.valueOf(dryRun));
        hubScanConfigBuilder.setCleanupLogsOnSuccess(Boolean.valueOf(cleanupLogsOnSuccess));
        hubScanConfigBuilder.setScanMemory(scanMemory);
        hubScanConfigBuilder.addAllScanTargetPaths(scanTargets);
        hubScanConfigBuilder.setExcludePatterns(excludePatterns);
        hubScanConfigBuilder.setToolsDir(toolsDir);
        hubScanConfigBuilder.setCodeLocationAlias(codeLocationName);
        hubScanConfigBuilder.setUnmapPreviousCodeLocations(Boolean.valueOf(unmapPreviousCodeLocations));
        hubScanConfigBuilder.setDeletePreviousCodeLocations(Boolean.valueOf(deletePreviousCodeLocations));
        if (hubWorkspaceCheck) {
            hubScanConfigBuilder.enableScanTargetPathsWithinWorkingDirectoryCheck();
        }
        return hubScanConfigBuilder.build();
    } catch (final IllegalStateException e) {
        logger.error(e.getMessage());
        logger.debug("", e);
    }
    return null;
}
 
开发者ID:blackducksoftware,项目名称:hub-bamboo,代码行数:52,代码来源:HubScanTask.java


示例6: ConfigurationMapCredentialsProvider

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public ConfigurationMapCredentialsProvider(ConfigurationMap configuration) {
	this.configuration = configuration;
}
 
开发者ID:KabbageInc,项目名称:bamboo-opsworks,代码行数:4,代码来源:ConfigurationMapCredentialsProvider.java


示例7: execute

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
@NotNull
@Override
public TaskResult execute(@NotNull TaskContext taskContext) throws TaskException
{
    final TaskResultBuilder builder = TaskResultBuilder.create(taskContext);
    final BuildLogger buildLogger = taskContext.getBuildLogger();

    final ConfigurationMap config = taskContext.getConfigurationMap();

    final Map<String, String> checkstyleResults = new HashMap<String, String>();

    String pathPattern = config.get( ICheckStyleBuildProcessor.CHECKSTYLE_XML_PATH_KEY );

    if ( !StringUtils.isEmpty(pathPattern) )
    {
        File workingDirectory = taskContext.getWorkingDirectory();
        FileVisitor fileVisitor = new CheckStyleFileVisitor(workingDirectory, checkstyleResults );
        try
        {
            fileVisitor.visitFilesThatMatch( pathPattern );
        }
        catch (InterruptedException e)
        {
            throw new TaskException("Could not find checkstyle files: " + e.getMessage(), e);
        }

        if ( !checkstyleResults.isEmpty() )
        {
            if (StringUtils.isNotBlank( config.get( CheckStyleTaskConfigurator.CHECKSTYLE_SITE_URL ) ) ) {
                // Transform filename in http checkstyle report
                CheckstylePluginHelper.transformFilenameInHttpURL( workingDirectory, config, checkstyleResults );
            }

            // Check for thresholds on error and warning and fail build
            // if exceeded

            processThreshold(config, checkstyleResults, "error", buildLogger, builder);
            processThreshold( config, checkstyleResults, "warning", buildLogger, builder );

            taskContext.getBuildContext().getBuildResult().getCustomBuildData().putAll(checkstyleResults);
        }
    }

    return builder.build();
}
 
开发者ID:javiergutites,项目名称:bamboo-checkstyle-plugin,代码行数:46,代码来源:CheckStyleTask.java


示例8: MonitorGetIssuesListPredefinedFilterProcess

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public MonitorGetIssuesListPredefinedFilterProcess(ConfigurationMap configMap, ExecutableHelper executableHelper)
  {
this.configMap = configMap;
this.executableHelper = executableHelper;
  }
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:6,代码来源:MonitorGetIssuesListPredefinedFilterProcess.java


示例9: ApplicationGetDetailsProcess

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public ApplicationGetDetailsProcess(ConfigurationMap configMap, ExecutableHelper executableHelper)
  {
this.configMap = configMap;
this.executableHelper = executableHelper;
  }
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:6,代码来源:ApplicationGetDetailsProcess.java


示例10: RollbackProcess

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public RollbackProcess(ConfigurationMap configMap, ExecutableHelper executableHelper)
  {
this.configMap = configMap;
this.executableHelper = executableHelper;
  }
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:6,代码来源:RollbackProcess.java


示例11: getConfigMap

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public ConfigurationMap getConfigMap() {
	return configMap;
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:4,代码来源:ProcessService.java


示例12: setConfigMap

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public void setConfigMap(ConfigurationMap configMap) {
	this.configMap = configMap;
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:4,代码来源:ProcessService.java


示例13: PackagingProcess

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public PackagingProcess(ConfigurationMap configMap, ExecutableHelper executableHelper)
  {
this.configMap = configMap;
this.executableHelper = executableHelper;
  }
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:6,代码来源:PackagingProcess.java


示例14: ApplicationGetStatusProcess

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public ApplicationGetStatusProcess(ConfigurationMap configMap, ExecutableHelper executableHelper)
  {
this.configMap = configMap;
this.executableHelper = executableHelper;
  }
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:6,代码来源:ApplicationGetStatusProcess.java


示例15: DeploymentProcess

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public DeploymentProcess(ConfigurationMap configMap)
  {
this.configMap = configMap;
  }
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:5,代码来源:DeploymentProcess.java


示例16: doExecute

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
public TaskResult doExecute(CommonTaskContext taskContext, BuildEnv buildEnv, TaskResultBuilder builder, ConfigurationMap configMap) {
	builder.success();
	
	try {
		ProcessHandler applicationGetStatus = processHandlerService.applicationGetStatus();
		applicationGetStatus.execute();
		
		ResultParserApplicationGetStatus statusParser;
		String filename = applicationGetStatus.getOutputFilename();
		statusParser = new ResultParserApplicationGetStatus(filename);
		
		String deploymentTime = statusParser.getDeploymentTime(configMap.get("app_name"));
		String deployedVersion = statusParser.getDeployedVersion(configMap.get("app_name"));
		
		buildDates(deploymentTime);
		
		ProcessHandler issuesListPeriodAfterDeploy = processHandlerService.monitorGetIssuesListPredefinedFilter(deploymentTimstamp, nowTimestamp, false);
		issuesListPeriodAfterDeploy.execute();
		ResultParserMonitorGetIssuesListPredefinedFilter parserPeriodAfterDeploy = new ResultParserMonitorGetIssuesListPredefinedFilter(issuesListPeriodAfterDeploy.getOutputFilename());
		
		ProcessHandler issuesListPeriodBeforeDeploy = processHandlerService.monitorGetIssuesListPredefinedFilter(comparisonPeriodTimestamp, deploymentTimstamp, true);
		issuesListPeriodBeforeDeploy.execute();
		ResultParserMonitorGetIssuesListPredefinedFilter parserPeriodBeforeDeploy = new ResultParserMonitorGetIssuesListPredefinedFilter(issuesListPeriodBeforeDeploy.getOutputFilename());
		
		if (issuesListPeriodAfterDeploy.getBuildEnv() instanceof Build) {
			final Map<String, String> customBuildData = errorCollatorListener.getTaskContext().getBuildContext().getBuildResult().getCustomBuildData();
            customBuildData.put(OUTPUT_FILE_KEY_ISSUES_LIST_BEFORE_DEPLOY, issuesListPeriodBeforeDeploy.getOutputFilename());
            customBuildData.put(OUTPUT_FILE_KEY_ISSUES_LIST_AFTER_DEPLOY, issuesListPeriodAfterDeploy.getOutputFilename());
            
            SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMATTER_PATTERN);
            customBuildData.put(TIME_DEPLOY, sdf.format(deploymentDate));
            customBuildData.put(TIME_START_PERIOD_BEFORE_DEPLOY, sdf.format(comparisonPeriodDate));
            customBuildData.put(TIME_END_PERIOD_BEFORE_DEPLOY, sdf.format(deploymentDate));
            customBuildData.put(TIME_START_PERIOD_AFTER_DEPLOY, sdf.format(deploymentDate));
            customBuildData.put(TIME_END_PERIOD_AFTER_DEPLOY, sdf.format(nowDate));
            
            customBuildData.put(APP_VERSION, deployedVersion);
		}
	}
	catch (Exception e) {
		buildLogger.addErrorLogEntry("Exception: " + e.getMessage());
		builder.failed();
	}
	return builder.build();
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:46,代码来源:StatisticsTask.java


示例17: calculateResult

import com.atlassian.bamboo.configuration.ConfigurationMap; //导入依赖的package包/类
private TaskResultBuilder calculateResult(TaskContext taskContext, TaskResultBuilder result) {
	
	ConfigurationMap config = taskContext.getConfigurationMap();
	
	boolean failed = checkFail(config, CFG_MAX_HIGH, scanner.getHighCount());
	failed |= checkFail(config, CFG_MAX_MEDIUM, scanner.getMediumCount()); 
	failed |= checkFail(config, CFG_MAX_LOW, scanner.getLowCount());
	
	if (failed)
		return result.failed();
	
	return result.success();
}
 
开发者ID:AppSecDev,项目名称:asoc-bamboo-plugin,代码行数:14,代码来源:SASTScanTask.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RxMenuItem类代码示例发布时间:2022-05-23
下一篇:
Java Project类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap