|
|
@ -335,6 +335,9 @@ class ShixunsController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 将实训标志为该云上实验室建立
|
|
|
|
|
|
|
|
Laboratory.current.laboratory_shixuns.create!(shixun: @shixun, ownership: true)
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
uid_logger_error("copy shixun failed ##{e.message}")
|
|
|
|
uid_logger_error("copy shixun failed ##{e.message}")
|
|
|
|
# 删除版本库
|
|
|
|
# 删除版本库
|
|
|
@ -430,6 +433,9 @@ class ShixunsController < ApplicationController
|
|
|
|
GitService.add_repository(repo_path: repo_path)
|
|
|
|
GitService.add_repository(repo_path: repo_path)
|
|
|
|
# todo: 为什么保存的时候要去除后面的.git呢??
|
|
|
|
# todo: 为什么保存的时候要去除后面的.git呢??
|
|
|
|
@shixun.update_column(:repo_name, repo_path.split(".")[0])
|
|
|
|
@shixun.update_column(:repo_name, repo_path.split(".")[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 将实训标志为该云上实验室建立
|
|
|
|
|
|
|
|
Laboratory.current.laboratory_shixuns.create!(shixun: @shixun, ownership: true)
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
uid_logger_error(e.message)
|
|
|
|
uid_logger_error(e.message)
|
|
|
|
tip_exception("实训创建失败")
|
|
|
|
tip_exception("实训创建失败")
|
|
|
|