|
|
|
@ -313,18 +313,22 @@ update
|
|
|
|
|
username = "git"
|
|
|
|
|
password = "123123"
|
|
|
|
|
##显示文件和系统版本
|
|
|
|
|
server_cmd1 = 'll'
|
|
|
|
|
server_cmd2 = 'cat /etc/issue'
|
|
|
|
|
user_name = User.find(@project.user_id).try(:login)
|
|
|
|
|
rep_name = params[:repository_id]
|
|
|
|
|
server_cmd1 = "sh gitclone.sh" + " " + user_name + " " + rep_name
|
|
|
|
|
# 连接到远程主机 foobar
|
|
|
|
|
ssh = Net::SSH.start(host, username, :port => port, :password => password) do |ssh|
|
|
|
|
|
result = ssh.exec!(server_cmd1)
|
|
|
|
|
logger.error("#################")
|
|
|
|
|
puts result
|
|
|
|
|
result = ssh.exec!(server_cmd2)
|
|
|
|
|
puts result
|
|
|
|
|
path = "/home/git/repo/" + user_name + "/" + rep_name
|
|
|
|
|
# sonar 分析
|
|
|
|
|
# server_cmd2
|
|
|
|
|
# 删除clone的版本库
|
|
|
|
|
# server_cmd3
|
|
|
|
|
end
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.html
|
|
|
|
|
format.html{
|
|
|
|
|
render :layout => "base_projects"
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -579,24 +583,6 @@ update
|
|
|
|
|
render 404
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
host = "http://192.168.0.200:8893"
|
|
|
|
|
username = "git"
|
|
|
|
|
password = "123123"
|
|
|
|
|
|
|
|
|
|
##显示文件和系统版本
|
|
|
|
|
server_cmd1 = 'ls -l'
|
|
|
|
|
server_cmd2 = 'cat /etc/issue'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 连接到远程主机 foobar
|
|
|
|
|
ssh = Net::SSH.start(host, username, :password => password) do |ssh|
|
|
|
|
|
result = ssh.exec!(server_cmd1)
|
|
|
|
|
puts result
|
|
|
|
|
result = ssh.exec!(server_cmd2)
|
|
|
|
|
puts result
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
project_id = @project.gpid
|
|
|
|
|
# @repository_id = @repository.identifier
|
|
|
|
|
# creator = params[:creator]
|
|
|
|
|