diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index abffd0aa..16b7de30 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -818,18 +818,18 @@ class ShixunsController < ApplicationController ShixunServiceConfig.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror) end end - # 自动构建版本库 - # repository = Repository.new - # repository.shixun = @shixun - # repository.type = 'Repository::Gitlab' - # repository.identifier = @shixun.identifier.downcase - # repository.project_id = -1 - # repository.save! - # s = Trustie::Gitlab::Sync.new - # gproject = s.create_shixun(@shixun, repository) - # raise "版本库创建失败" if @shixun.gpid.blank? # 若和gitlab没同步成功,则抛出异常 - # g = Gitlab.client - # @shixun.update_column(:git_url, g.project(@shixun.gpid).path_with_namespace) + 自动构建版本库 + repository = Repository.new + repository.shixun = @shixun + repository.type = 'Repository::Gitlab' + repository.identifier = @shixun.identifier.downcase + repository.project_id = -1 + repository.save! + s = Trustie::Gitlab::Sync.new + gproject = s.create_shixun(@shixun, repository) + raise "版本库创建失败" if @shixun.gpid.blank? # 若和gitlab没同步成功,则抛出异常 + g = Gitlab.client + @shixun.update_column(:git_url, g.project(@shixun.gpid).path_with_namespace) # g = Gitlab.client # hook_url = Setting.protocol + "://" + Setting.host_name + "/shixuns/#{@shixun.identifier}" + "/ghook" # g.add_project_hook(@shixun.gpid, hook_url) diff --git a/app/views/shixuns/_form.html.erb b/app/views/shixuns/_form.html.erb index f6bc11a7..337ecee2 100644 --- a/app/views/shixuns/_form.html.erb +++ b/app/views/shixuns/_form.html.erb @@ -37,19 +37,19 @@ - - - - - - - - - - - - - +
+

简介

+
+
+
+ +
+

+

+
+
 
+
+

技术平台

diff --git a/app/views/shixuns/_settings_edit.html.erb b/app/views/shixuns/_settings_edit.html.erb index 70bf43f2..90efda66 100644 --- a/app/views/shixuns/_settings_edit.html.erb +++ b/app/views/shixuns/_settings_edit.html.erb @@ -33,19 +33,19 @@
- - - - - - - - - - - - - +
+

简介

+
+
+
+ +
+

+

+
+
 
+
+