提交代码
This commit is contained in:
parent
48811946e3
commit
90476c250d
|
|
@ -1,4 +1,4 @@
|
|||
using CodeRelease.BLL;
|
||||
using CodeRelease.BLL;
|
||||
using CodeRelease.Model;
|
||||
using CodeRelease.Utile;
|
||||
|
||||
|
|
@ -8,6 +8,8 @@ using Newtonsoft.Json;
|
|||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
namespace CodeRelease.Controllers
|
||||
|
|
@ -80,7 +82,26 @@ namespace CodeRelease.Controllers
|
|||
return obj;
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(releaseAction.Release.TargetCommitish))
|
||||
{
|
||||
var version = releaseAction.Release.TagName;
|
||||
|
||||
var download = giteaWebhookConfig.BrowserDownloadFileUrl + version + "/";
|
||||
if (!Directory.Exists(download))
|
||||
{
|
||||
Directory.CreateDirectory(download);
|
||||
}
|
||||
FileDownloader fileDownloader = new FileDownloader();
|
||||
//giteaWebhookConfig.BrowserDownloadFileUrl.Replace("{version}", version);
|
||||
var mingling = giteaWebhookConfig.MakeFile
|
||||
.Replace("{version}", version)
|
||||
.Replace("{dir_file_path}", download + "/")
|
||||
.Replace("{target_commitish}", releaseAction.Release.TargetCommitish);
|
||||
LinuxExecuteCommand linuxExecuteCommand = new LinuxExecuteCommand();
|
||||
//make public version=0.0.1 dir_file_path=/
|
||||
var obj = await linuxExecuteCommand.ExecuteCommand(mingling);
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
//make 文件位置
|
||||
"MakeFile": "make public version={version} dir_file_path={dir_file_path} -f /disk/CodeRelease/test/makefile",
|
||||
//发布文件下载位置
|
||||
"BrowserDownloadFileUrl": "I:/Gitea/test/disk/aiweb/"
|
||||
"BrowserDownloadFileUrl": ""
|
||||
//
|
||||
},
|
||||
{
|
||||
|
|
@ -30,6 +30,14 @@
|
|||
//发布文件下载位置
|
||||
"BrowserDownloadFileUrl": "I:/Gitea/test/disk/aiweb/"
|
||||
//
|
||||
},
|
||||
{
|
||||
"Name": "miaoyu",
|
||||
//make 文件位置 make public version=0.0.2 target_commitish=dev -f /disk/Public/miaoyu/makefile
|
||||
"MakeFile": "make public version={version} target_commitish={target_commitish} -f /disk/Public/miaoyu/makefile",
|
||||
//发布文件下载位置
|
||||
"BrowserDownloadFileUrl": ""
|
||||
//
|
||||
}
|
||||
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user