From 8936b9ff9c89501ed998755a8c56ccb7d4bf587b Mon Sep 17 00:00:00 2001 From: zhangzhe Date: Tue, 25 Jun 2024 14:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CodeRelease/Controllers/PublishController.cs | 5 ++++- src/CodeRelease/CodeRelease/appsettings.json | 11 ++++++++++- test/makefile | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/makefile 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