Search in sources :

Example 6 with URLService

use of com.thoughtworks.go.util.URLService 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

URLService (com.thoughtworks.go.util.URLService)6 File (java.io.File)3 ChecksumFileHandler (com.thoughtworks.go.domain.ChecksumFileHandler)2 Before (org.junit.Before)2 GoAgentServerHttpClient (com.thoughtworks.go.agent.common.ssl.GoAgentServerHttpClient)1 FakeBuildRepositoryRemote (com.thoughtworks.go.agent.testhelpers.FakeBuildRepositoryRemote)1 DirHandler (com.thoughtworks.go.domain.DirHandler)1 FileHandler (com.thoughtworks.go.domain.FileHandler)1 UploadEntry (com.thoughtworks.go.matchers.UploadEntry)1 AgentIdentifier (com.thoughtworks.go.remote.AgentIdentifier)1 BuildComposer (com.thoughtworks.go.server.domain.BuildComposer)1 AgentRuntimeInfo (com.thoughtworks.go.server.service.AgentRuntimeInfo)1 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)1 TestingClock (com.thoughtworks.go.util.TestingClock)1 ZipUtil (com.thoughtworks.go.util.ZipUtil)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)1 HttpGet (org.apache.http.client.methods.HttpGet)1 BasicStatusLine (org.apache.http.message.BasicStatusLine)1 Test (org.junit.Test)1