From 625360a6735c235f3fd1ca19466cc5d611b47565 Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Wed, 31 Jan 2024 18:41:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 8 ++++---- internal/cmd/cmd.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1444958..55e0b7f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,7 @@ pipeline { } stage('项目构建') { steps { - sh 'echo "部署项目"' + echo '部署项目' sh 'export GOARCH=amd64' sh 'export GOOS=linux' sh '/usr/local/go/bin/go build -o personalMain' @@ -30,10 +30,10 @@ pipeline { } stage('项目部署至服务器') { steps { - sh 'echo "部署项目至服务器"' - sshPublisher(publishers: [sshPublisherDesc(configName: 'XiaoLFengBlogServer', sshCredentials: [encryptedPassphrase: '{AQAAABAAAAAQrXydf4kWME+M5r1FJeIC7y3P7e+14xuo5oNTQ6wxhrw=}', key: '', keyPath: '/var/jenkins_home/general-key', username: 'ecs-user'], transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''cd ./blog-main + echo '部署项目至服务器' + sshPublisher(publishers: [sshPublisherDesc(configName: 'XiaoLFengBlogServer', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''cd ./blog-main chmod +x ./personalMain - 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)]) + nohup ./personalMain > logger.log 2>&1 &''', execTimeout: 120000, flatten: false, keepFilePermissions: true, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'blog-main', remoteDirectorySDF: false, removePrefix: '', sourceFiles: './personalMain')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)]) } } } diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index c2bfb5f..a918273 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -83,7 +83,7 @@ var ( ) }) }) - s.SetServerRoot("resource/public") + //s.SetServerRoot("resource/public") s.Run() return nil },