From 912d8a55ab99bad361433d39a4a2246d710cf7dd Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Wed, 31 Jan 2024 16:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 19 ++++++++++++++++++- .../LinkServiceImpl/FriendServiceImpl.go | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8cec9f9..7746f2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,10 +12,27 @@ pipeline { } } stages { - stage('Qodana') { + stage('Qodana代码检查') { + when { + branch 'feature' + } steps { sh '''qodana''' } } + stage('项目部署') { + steps { + sh '''echo "部署项目"''' + sh '''set GOARCH=amd64''' + sh '''set GOOS=linux''' + sh '''go build -o personalMain''' + } + } + stage('项目部署至服务器') { + steps { + sh '''echo "部署项目至服务器"''' + sshPublisher(publishers: [sshPublisherDesc(configName: 'XiaoLFengBlogServer', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''cd ./blog-main + nohup ./personalMain > logger.log 2>&1 &''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'blog-main', remoteDirectorySDF: false, removePrefix: '', sourceFiles: './personalMain')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)]) + } } } \ No newline at end of file diff --git a/internal/logic/LinkServiceImpl/FriendServiceImpl.go b/internal/logic/LinkServiceImpl/FriendServiceImpl.go index 95c1fda..8ea1b40 100644 --- a/internal/logic/LinkServiceImpl/FriendServiceImpl.go +++ b/internal/logic/LinkServiceImpl/FriendServiceImpl.go @@ -8,7 +8,7 @@ import ( "PersonalMain/utility/ErrorCode" "PersonalMain/utility/ResultUtil" "github.com/gogf/gf/v2/net/ghttp" - regexp "regexp" + "regexp" ) // GetLinkFriend