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

Java BuildAgentConfiguration类代码示例

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

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



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

示例1: loadInfo

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@Nullable
public static PowerShellInfo loadInfo(@NotNull final BuildAgentConfiguration config,
                                      @Nullable final PowerShellBitness bitness) {
  if (bitness == null) {
    return null;
  }

  final Map<String, String> ps = config.getConfigurationParameters();
  final String ver = ps.get(bitness.getVersionKey());
  final String path = ps.get(bitness.getPathKey());
  final String executable = ps.get(bitness.getExecutableKey());
  final PowerShellEdition edition = PowerShellEdition.fromString(ps.get(bitness.getEditionKey()));

  if (path != null && ver != null && edition != null) {
    return new PowerShellInfo(bitness, new File(path), ver, edition, executable);
  }
  return null;
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:19,代码来源:PowerShellInfo.java


示例2: getBuildRunnerInfo

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@NotNull
@Override
public AgentBuildRunnerInfo getBuildRunnerInfo() {
    return new AgentBuildRunnerInfo() {
        @NotNull
        @Override
        public String getType() {
            return HELM_RUN_TYPE;
        }

        @Override
        public boolean canRun(@NotNull BuildAgentConfiguration buildAgentConfiguration) {
            return buildAgentConfiguration.getConfigurationParameters().containsKey(HELM_PATH_CONFIG_PARAM);
        }
    };
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:17,代码来源:HelmBuildServiceFactory.java


示例3: UserUIDAndGIDImpl

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public UserUIDAndGIDImpl(@NotNull final EventDispatcher<AgentLifeCycleListener> events) {

    events.addListener(new AgentLifeCycleAdapter(){
      @Override
      public void afterAgentConfigurationLoaded(@NotNull final BuildAgent agent) {
        final BuildAgentConfiguration configuration = agent.getConfiguration();

        if (configuration.getConfigurationParameters().get(VMConstants.DOCKER_PROPERTY) == null) return;
        if (!configuration.getSystemInfo().isUnix()) return;
        if (configuration.getSystemInfo().isWindows()) return;
        if (configuration.getSystemInfo().isMac()) return;

        detectSidAndGid();
      }
    });
  }
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:17,代码来源:UserUIDAndGIDImpl.java


示例4: PowerShellInfoProvider

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public PowerShellInfoProvider(@NotNull final BuildAgentConfiguration config,
                              @NotNull final EventDispatcher<AgentLifeCycleListener> events,
                              @NotNull final List<PowerShellDetector> detectors) {
  myConfig = config;
  events.addListener(new AgentLifeCycleAdapter(){

    @Override
    public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) {
      registerDetectedPowerShells(detectors, new DetectionContext(agent.getConfiguration()));
    }
  });
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:13,代码来源:PowerShellInfoProvider.java


示例5: canRun

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public boolean canRun(@NotNull final BuildAgentConfiguration agentConfiguration) {     
  if (!myInfoProvider.anyPowerShellDetected()) {
    LOG.info("PowerShell runner is disabled: PowerShell was not found.");
    return false;
  }
  return true;
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:8,代码来源:PowerShellServiceFactory.java


示例6: testSaveLoad

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@Test(dataProvider = "editionProvider")
public void testSaveLoad(@NotNull final PowerShellEdition edition) throws IOException {
  PowerShellInfo info = new PowerShellInfo(PowerShellBitness.x64, createTempDir(), "1.0", edition, "powershell.exe");

  final Mockery m = new Mockery();
  final BuildAgentConfiguration conf = m.mock(BuildAgentConfiguration.class);

  final Map<String, String> confParams = new HashMap<String, String>();
  m.checking(new Expectations(){{
    allowing(conf).getConfigurationParameters(); will(returnValue(Collections.unmodifiableMap(confParams)));
    allowing(conf).addConfigurationParameter(with(any(String.class)), with(any(String.class)));
    will(new Action() {
      public Object invoke(final Invocation invocation) throws Throwable {
        final String key = (String) invocation.getParameter(0);
        final String value = (String) invocation.getParameter(1);
        Assert.assertNotNull(key);
        Assert.assertNotNull(value);
        confParams.put(key, value);
        return null;
      }

      public void describeTo(final Description description) {
        description.appendText("add Parameters");
      }
    });
  }});

  info.saveInfo(conf);

  PowerShellInfo i = PowerShellInfo.loadInfo(conf, PowerShellBitness.x64);

  Assert.assertNotNull(i);
  Assert.assertEquals(i.getBitness(), info.getBitness());
  Assert.assertEquals(i.getHome(), info.getHome());
  Assert.assertEquals(i.getExecutablePath(), info.getExecutablePath());
  Assert.assertEquals(i.getVersion(), info.getVersion());
  Assert.assertEquals(i.getEdition(), info.getEdition());
  Assert.assertEquals(i.getExecutable(), info.getExecutable());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:40,代码来源:PowerShellInfoTest.java


示例7: setUp

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@Override
@BeforeMethod
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
  super.setUp();
  m = new Mockery() {{
    setImposteriser(ClassImposteriser.INSTANCE);
  }};
  myEvents = m.mock(EventDispatcher.class);
  myConfig = m.mock(BuildAgentConfiguration.class);
  m.checking(new Expectations() {{
    allowing(myEvents);
  }});
  myProvider = new PowerShellInfoProvider(myConfig, myEvents, Collections.<PowerShellDetector>emptyList());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:16,代码来源:PowerShellInfoProviderTest.java


示例8: getRunnerInfo

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@Override
public AgentBuildRunnerInfo getRunnerInfo() {
    return new AgentBuildRunnerInfo() {
        @Override
        public boolean canRun(final BuildAgentConfiguration arg0) {
            return true;
        }

        @Override
        public String getType() {
            return HubBundle.RUNNER_TYPE;
        }
    };
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:15,代码来源:HubBuildRunner.java


示例9: agentInitialized

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@Override
public void agentInitialized(@NotNull BuildAgent agent) {
  final BuildAgentConfiguration config = agent.getConfiguration();
  if (!config.getSystemInfo().isWindows()) return;
  LOG.info("Searching WinDbg installation...");

  LOG.info("Searching the WinDbg as part of Windows 10 SDK");
  File winDbgHomeDir = searchSDK8AndLater(WIN_DBG_10_ROOT_ENTRY_NAME, WIN_SDK_10_ROOT_ENTRY_NAME, "10");
  if(winDbgHomeDir == null){
    LOG.info("Searching the WinDbg as part of Windows 8.1 SDK");
    winDbgHomeDir = searchSDK8AndLater(WIN_DBG_81_ROOT_ENTRY_NAME, WIN_SDK_81_ROOT_ENTRY_NAME, "8.1");
    if(winDbgHomeDir == null) {
      LOG.info("Searching the WinDbg as part of Windows 8 SDK");
      winDbgHomeDir = searchSDK8AndLater(WIN_DBG_8_ROOT_ENTRY_NAME, WIN_SDK_8_ROOT_ENTRY_NAME, "8");
    } if(winDbgHomeDir == null) {
      LOG.info("Searching the WinDbg as part of Windows 7 SDK");
      winDbgHomeDir = searchSDK7x();
    }
  }

  if(winDbgHomeDir == null) LOG.info("WinDbg tools were not found on this machine.");
  else{
    final String winDbgHomeDirAbsolutePath = winDbgHomeDir.getAbsolutePath();
    LOG.info("WinDbg tools were found on path " + winDbgHomeDirAbsolutePath);
    config.addConfigurationParameter(WIN_DBG_PATH, winDbgHomeDirAbsolutePath);
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-symbol-server,代码行数:28,代码来源:WinDbgToolsDetector.java


示例10: PathsServiceImpl

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public PathsServiceImpl(
  @NotNull final FileService fileService,
  @NotNull final BuildAgentConfiguration buildAgentConfiguration,
  @NotNull final BuildAgentConfigurablePaths buildAgentConfigurablePaths) {
  myFileService = fileService;
  myBuildAgentConfiguration = buildAgentConfiguration;
  myBuildAgentConfigurablePaths = buildAgentConfigurablePaths;
}
 
开发者ID:JetBrains,项目名称:teamcity-runas-plugin,代码行数:9,代码来源:PathsServiceImpl.java


示例11: agentInitialized

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@Override
public void agentInitialized(@NotNull final BuildAgent agent) {
    BuildAgentConfiguration conf = agent.getConfiguration();

    readXMLFile(conf.getServerUrl());
    createAgentParameters(conf);
}
 
开发者ID:AccusoftCorporation,项目名称:Teamcity-Parameter-Plugin,代码行数:8,代码来源:AppAgent.java


示例12: createAgentParameters

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
private void createAgentParameters(BuildAgentConfiguration conf) {
    Iterator it = values.entrySet().iterator();

    while (it.hasNext()) {
        Map.Entry pair = (Map.Entry)it.next();
        conf.addEnvironmentVariable(pair.getKey().toString(), pair.getValue().toString());
        it.remove();
    }
}
 
开发者ID:AccusoftCorporation,项目名称:Teamcity-Parameter-Plugin,代码行数:10,代码来源:AppAgent.java


示例13: AgentTorrentsSeeder

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public AgentTorrentsSeeder(@NotNull final BuildAgentConfiguration agentConfiguration,
                           @NotNull final TorrentConfiguration torrentConfiguration) {
  myExecutorService = Executors.newScheduledThreadPool(1);
  myTorrentsSeeder = new TorrentsSeeder(agentConfiguration.getCacheDirectory(Constants.TORRENTS_DIRNAME), TeamCityProperties.getInteger("teamcity.torrents.agent.maxSeededTorrents", 5000), new ParentDirConverter() {
    @NotNull
    @Override
    public File getParentDir() {
      return agentConfiguration.getSystemDirectory();
    }
  }, myExecutorService, torrentConfiguration);
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:12,代码来源:AgentTorrentsSeeder.java


示例14: TorrentFilesFactoryImpl

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public TorrentFilesFactoryImpl(@NotNull BuildAgentConfiguration agentConfiguration,
                               @NotNull TorrentConfiguration configuration,
                               @NotNull AgentIdleTasks agentIdleTasks,
                               @NotNull final AgentTorrentsSeeder torrentsSeeder) {
  myConfiguration = configuration;
  myTorrentFilesDir = agentConfiguration.getCacheDirectory(Constants.TORRENTS_DIRNAME);
  myRandom = new Random(System.currentTimeMillis());
  agentIdleTasks.addRecurringTask(new AgentIdleTasks.Task() {
    @NotNull
    public String getName() {
      return "Torrent files cleaner";
    }

    public void execute(@NotNull InterruptState interruptState) {
      Set<File> registeredTorrentFiles = torrentsSeeder.getRegisteredTorrentFiles();

      File[] dirs = myTorrentFilesDir.listFiles();
      if (dirs != null) {
        for (File dir: dirs) {
          if (interruptState.isInterrupted()) return;
          if (!dir.isDirectory()) continue;
          File[] files = dir.listFiles();
          if (files != null) {
            for (File f: files) {
              if (interruptState.isInterrupted()) return;
              if (registeredTorrentFiles.contains(f)) continue;
              FileUtil.delete(f);
            }
          }
        }
      }
    }
  });
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:35,代码来源:TorrentFilesFactoryImpl.java


示例15: setUp

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public BuildAgentConfiguration setUp() throws IOException {
  myTmpFiles = new TempFiles();
  final File systemDir = myTmpFiles.createTempDir();
  final File torrentsDir = myTmpFiles.createTempDir();

  Mockery m = new Mockery();
  final BuildAgentConfiguration agentConfiguration = m.mock(BuildAgentConfiguration.class);
  m.checking(new Expectations() {{
    allowing(agentConfiguration).getServerUrl(); will(returnValue("http://localhost:8111/bs"));
    allowing(agentConfiguration).getSystemDirectory(); will(returnValue(systemDir));
    allowing(agentConfiguration).getCacheDirectory(with(Constants.TORRENTS_DIRNAME)); will(returnValue(torrentsDir));
  }});

  return agentConfiguration;
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:16,代码来源:BuildAgentConfigurationFixture.java


示例16: setUp

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@BeforeMethod
public void setUp() throws Exception {
  super.setUp();
  EventDispatcher<AgentLifeCycleListener> dispatcher = EventDispatcher.create(AgentLifeCycleListener.class);

  BuildAgentConfiguration agentConfiguration = myAgentConfigurationFixture.setUp();
  final TorrentConfiguration trackerConfiguration = new FakeTorrentConfiguration();

  Mockery m = new Mockery();
  final LeechSettings leechSettings = m.mock(LeechSettings.class);
  final SeedSettings seedingSettings = m.mock(SeedSettings.class);
  final ArtifactCacheProvider cacheProvider = m.mock(ArtifactCacheProvider.class);
  m.checking(new Expectations() {{
    allowing(cacheProvider).addListener(with(any(TorrentArtifactCacheListener.class)));
    allowing(leechSettings).isDownloadEnabled(); will(returnValue(true));
    allowing(seedingSettings).isSeedingEnabled(); will(returnValue(true));
  }});
  final ArtifactsWatcher artifactsWatcher = m.mock(ArtifactsWatcher.class);

  AgentTorrentsSeeder seeder = new AgentTorrentsSeeder(agentConfiguration, trackerConfiguration);
  TorrentFilesFactoryImpl tff = new TorrentFilesFactoryImpl(agentConfiguration, trackerConfiguration, new FakeAgentIdleTasks(), seeder);

  myTorrentsDownloadStatistic = new TorrentsDownloadStatistic();
  myTorrentsManager = new AgentTorrentsManager(dispatcher,
          cacheProvider,
          new CurrentBuildTrackerImpl(dispatcher),
          trackerConfiguration,
          seeder,
          tff,
          artifactsWatcher,
          myTorrentsDownloadStatistic, leechSettings, agentConfiguration, seedingSettings);
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:33,代码来源:AgentTorrentsManagerTest.java


示例17: setUp

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
@BeforeMethod
@Override
protected void setUp() throws Exception {
  super.setUp();

  myTorrentsDir = createTempDir();
  final BuildAgentConfiguration agentConfiguration = myAgentConfigurationFixture.setUp();

  final TorrentConfiguration configuration = new FakeTorrentConfiguration();

  myFakeAgentIdleTasks = new FakeAgentIdleTasks();
  mySeeder = new AgentTorrentsSeeder(agentConfiguration, configuration);
  myTorrentFilesFactory = new TorrentFilesFactoryImpl(agentConfiguration, configuration, myFakeAgentIdleTasks, mySeeder);
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:15,代码来源:TorrentFilesFactoryTest.java


示例18: saveInfo

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public void saveInfo(@NotNull final BuildAgentConfiguration config) {
  config.addConfigurationParameter(myBitness.getVersionKey(), myVersion);
  config.addConfigurationParameter(myBitness.getPathKey(), myHome.toString());
  config.addConfigurationParameter(myBitness.getEditionKey(), myEdition.getValue());
  config.addConfigurationParameter(myBitness.getExecutableKey(), myExecutable);
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:7,代码来源:PowerShellInfo.java


示例19: CommandLinePowerShellDetector

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public CommandLinePowerShellDetector(@NotNull final BuildAgentConfiguration configuration,
                                     @NotNull final DetectionRunner runner) {
  myConfiguration = configuration;
  myRunner = runner;
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:6,代码来源:CommandLinePowerShellDetector.java


示例20: DetectionContext

import jetbrains.buildServer.agent.BuildAgentConfiguration; //导入依赖的package包/类
public DetectionContext(@NotNull final BuildAgentConfiguration configuration) {
  final Map<String, String> params = configuration.getConfigurationParameters();
  myPredefinedPaths = loadPredefinedPaths(params);
  mySearchPaths = loadSearchPaths(params);
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:6,代码来源:DetectionContext.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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