diff --git a/src/CodeRelease/CodeRelease/Controllers/PublishController.cs b/src/CodeRelease/CodeRelease/Controllers/PublishController.cs index 9979842..aa2c574 100644 --- a/src/CodeRelease/CodeRelease/Controllers/PublishController.cs +++ b/src/CodeRelease/CodeRelease/Controllers/PublishController.cs @@ -5,10 +5,13 @@ using Microsoft.AspNetCore.Mvc; namespace CodeRelease.Controllers { + [Route("api/[controller]/[Action]")] [ApiController] public class PublishController : ControllerBase { + [HttpGet] + [HttpPost] /// /// 测试 /// @@ -16,7 +19,7 @@ namespace CodeRelease.Controllers public async Task Test() { LinuxExecuteCommand linuxExecuteCommand = new LinuxExecuteCommand(); - var obj = await linuxExecuteCommand.ExecuteCommand(""); + var obj = await linuxExecuteCommand.ExecuteCommand("make test -f /disk/CodeRelease/test/makefile"); return obj; } } diff --git a/src/CodeRelease/CodeRelease/appsettings.json b/src/CodeRelease/CodeRelease/appsettings.json index 10f68b8..852425e 100644 --- a/src/CodeRelease/CodeRelease/appsettings.json +++ b/src/CodeRelease/CodeRelease/appsettings.json @@ -5,5 +5,14 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "Kestrel": { + "Endpoints": { + "Http": { + "Url": "http://*:5240" + } + + } + + } } diff --git a/test/makefile b/test/makefile new file mode 100644 index 0000000..9bb9c4c --- /dev/null +++ b/test/makefile @@ -0,0 +1,6 @@ +SHELL=/usr/bin/env bash +date_dir_name = $(shell date +"%Y%m%d-%H%M%S") +test: + @echo $(date_dir_name) + + \ No newline at end of file