jetbrains.buildServer.agent.artifacts.ArtifactsWatcher Java Examples

The following examples show how to use jetbrains.buildServer.agent.artifacts.ArtifactsWatcher. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnsibleOutputListener.java    From tc-ansible-runner with MIT License 6 votes vote down vote up
public AnsibleOutputListener(AgentRunningBuild build, BuildRunnerContext buildRunnerContext, ArtifactsWatcher artifactsWatcher) {
    this.artifactsWatcher = artifactsWatcher;
    this.buildRunnerContext = buildRunnerContext;
    File tmpDir = new File(build.getBuildTempDirectory(), "ansible-run");
    boolean exists = tmpDir.exists(); 
    if (!exists) {
        exists = tmpDir.mkdir();
    }
    if (!exists) {
        LOG.error("Cannot create a directory " + tmpDir.getAbsolutePath() + " for ansible run raw output storage");
        build.getBuildLogger().warning("Cannot create a directory for ansible run raw output storage. Ansible report will not be generated");
    } else {
        String rawFileName = "ansible-run-raw-" + buildRunnerContext.getId() + ".log";
        rawFile = new File(tmpDir, rawFileName);
        try {
            rawFile.createNewFile();
        } catch (IOException e) {
            LOG.error("Cannot create a file " + rawFileName + " for ansible run raw output writing ", e);
            build.getBuildLogger().warning("Cannot create a file for ansible run raw output writing. Ansible report will not be generated");
        }
        build.addSharedConfigParameter(AnsibleRunnerConstants.ARTIFACTS_TMP_DIR_KEY, tmpDir.getAbsolutePath());
    }
}
 
Example #2
Source File: AnsibleRunService.java    From tc-ansible-runner with MIT License 4 votes vote down vote up
public AnsibleRunService(ArtifactsWatcher artifactsWatcher) {
    this.artifactsWatcher = artifactsWatcher;
}
 
Example #3
Source File: AnsibleReportArtifatcsProvider.java    From tc-ansible-runner with MIT License 4 votes vote down vote up
public AnsibleReportArtifatcsProvider(
        @NotNull ArtifactsWatcher artifactsWatcher,
        @NotNull EventDispatcher<AgentLifeCycleListener> agentDispatcher) {
    agentDispatcher.addListener(this);
    this.artifactsWatcher = artifactsWatcher;
}
 
Example #4
Source File: AnsibleRunServiceFactory.java    From tc-ansible-runner with MIT License 4 votes vote down vote up
public AnsibleRunServiceFactory(@NotNull ArtifactsWatcher artifactsWatcher) {
    this.artifactsWatcher = artifactsWatcher;
}
 
Example #5
Source File: SonarProcessListener.java    From TeamCity.SonarQubePlugin with Apache License 2.0 4 votes vote down vote up
public SonarProcessListener(@NotNull final EventDispatcher<AgentLifeCycleListener> agentDispatcher,
                            @NotNull final ArtifactsWatcher watcher) {
    myWatcher = watcher;
    agentDispatcher.addListener(this);
}
 
Example #6
Source File: AllureBuildServiceFactory.java    From allure-teamcity with Apache License 2.0 4 votes vote down vote up
public AllureBuildServiceFactory(@NotNull final ArtifactsWatcher artifactsWatcher) {
    this.artifactsWatcher = artifactsWatcher;
}
 
Example #7
Source File: AllureBuildServiceAdapter.java    From allure-teamcity with Apache License 2.0 4 votes vote down vote up
/**
 * Creates an instance of adapter.
 */
AllureBuildServiceAdapter(@NotNull final ArtifactsWatcher artifactsWatcher) {
    this.artifactsWatcher = artifactsWatcher;
}