diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a63d7904b..e7d562f30 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -886,8 +886,12 @@ class ProjectsController < ApplicationController jobName = @project.forked_from_project_id @training_task = TrainingTask.find(taskId) step = @training_task.position + original_project = Project.find(jobName) + rep_identify = Repository.where(:project_id => jobName, :type => "Repository::Gitlab").first.try(:identifier) + gitlab_address = Redmine::Configuration['gitlab_address'] + gitUrl = gitlab_address.to_s+"/"+original_project.owner.to_s+"/"+ rep_identify + "."+"git" if @training_task.status == 0 - params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}"} + params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}", :gitUrl => "#{gitUrl}"} uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") begin res = uri_exec uri, params @@ -939,7 +943,7 @@ class ProjectsController < ApplicationController def training_task_status status = params[:status].to_i task_id = params[:taskId] - message = params[:msg] + message = Base64.decode64(params[:msg]) begin @training_task = TrainingTask.find(task_id) # 如果已经执行成功过,则不重复执行