Search in sources :

Example 1 with BuildComposer

use of com.thoughtworks.go.server.domain.BuildComposer in project gocd by gocd.

the class BuildComposerTest method build.

private void build(String jobXml, String pipelineName, boolean fetchMaterials, boolean cleanWorkingDir) throws Exception {
    BuildAssignment assignment = getAssigment(jobXml, pipelineName, fetchMaterials, cleanWorkingDir);
    final BuildCommand buildCommand = new BuildComposer(assignment).compose();
    buildSession = newBuildSession();
    buildSession.setEnv("GO_SERVER_URL", SERVER_URL);
    buildSession.build(buildCommand);
}
Also used : BuildComposer(com.thoughtworks.go.server.domain.BuildComposer) BuildAssignment(com.thoughtworks.go.remote.work.BuildAssignment)

Example 2 with BuildComposer

use of com.thoughtworks.go.server.domain.BuildComposer in project gocd by gocd.

the class BuildAssignmentService method createBuildSettings.

private BuildSettings createBuildSettings(BuildAssignment assignment) {
    // generate path only url
    URLService urlService = new URLService("");
    JobPlan plan = assignment.getPlan();
    JobIdentifier jobIdentifier = plan.getIdentifier();
    BuildSettings buildSettings = new BuildSettings();
    buildSettings.setBuildId(String.valueOf(jobIdentifier.getBuildId()));
    buildSettings.setBuildLocatorForDisplay(jobIdentifier.buildLocatorForDisplay());
    buildSettings.setBuildLocator(jobIdentifier.buildLocator());
    buildSettings.setBuildCommand(new BuildComposer(assignment).compose());
    buildSettings.setConsoleUrl(urlService.getUploadUrlOfAgent(plan.getIdentifier(), getConsoleOutputFolderAndFileNameUrl()));
    buildSettings.setArtifactUploadBaseUrl(urlService.getUploadBaseUrlOfAgent(plan.getIdentifier()));
    buildSettings.setPropertyBaseUrl(urlService.getPropertiesUrl(plan.getIdentifier(), ""));
    return buildSettings;
}
Also used : BuildComposer(com.thoughtworks.go.server.domain.BuildComposer) URLService(com.thoughtworks.go.util.URLService)

Aggregations

BuildComposer (com.thoughtworks.go.server.domain.BuildComposer)2 BuildAssignment (com.thoughtworks.go.remote.work.BuildAssignment)1 URLService (com.thoughtworks.go.util.URLService)1