From 1462e17f0cf952acb6bb0fff881b6879ec0a3646 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 27 May 2016 15:25:13 +0100 Subject: [PATCH] put the build id in the output file urls the url attribute will now give the preferred location for accessing the output file, without the url having to be constructed by the web client --- services/clsi/app/coffee/CompileController.coffee | 5 ++++- services/clsi/test/unit/coffee/CompileControllerTests.coffee | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/clsi/app/coffee/CompileController.coffee b/services/clsi/app/coffee/CompileController.coffee index 5cc9a5e2f4..478d91bfa7 100644 --- a/services/clsi/app/coffee/CompileController.coffee +++ b/services/clsi/app/coffee/CompileController.coffee @@ -33,7 +33,10 @@ module.exports = CompileController = status: status error: error?.message or error outputFiles: outputFiles.map (file) -> - url: "#{Settings.apis.clsi.url}/project/#{request.project_id}/output/#{file.path}" + url: + "#{Settings.apis.clsi.url}/project/#{request.project_id}" + + (if file.build? then "/build/#{file.build}" else "") + + "/output/#{file.path}" path: file.path type: file.type build: file.build diff --git a/services/clsi/test/unit/coffee/CompileControllerTests.coffee b/services/clsi/test/unit/coffee/CompileControllerTests.coffee index d8d6e8620f..7693799e4c 100644 --- a/services/clsi/test/unit/coffee/CompileControllerTests.coffee +++ b/services/clsi/test/unit/coffee/CompileControllerTests.coffee @@ -75,7 +75,7 @@ describe "CompileController", -> status: "success" error: null outputFiles: @output_files.map (file) => - url: "#{@Settings.apis.clsi.url}/project/#{@project_id}/output/#{file.path}" + url: "#{@Settings.apis.clsi.url}/project/#{@project_id}/build/#{file.build}/output/#{file.path}" path: file.path type: file.type build: file.build