项目部署
Some checks reported errors
Personal/PersonalMain-Golang/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
Personal/PersonalMain-Golang/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
parent
912d8a55ab
commit
9e6c5a21e2
36
Jenkinsfile
vendored
36
Jenkinsfile
vendored
|
@ -2,37 +2,37 @@ pipeline {
|
|||
environment {
|
||||
QODANA_TOKEN=credentials('qodana-token')
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
args '''
|
||||
-v "${WORKSPACE}":/data/project
|
||||
--entrypoint=""
|
||||
'''
|
||||
image 'jetbrains/qodana-go'
|
||||
}
|
||||
}
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Qodana代码检查') {
|
||||
when {
|
||||
branch 'feature'
|
||||
}
|
||||
steps {
|
||||
sh '''qodana'''
|
||||
script {
|
||||
docker.image('jetbrains/qodana-go').run('''
|
||||
-v "${WORKSPACE}":/data/project
|
||||
--entrypoint=""
|
||||
''') {
|
||||
sh 'qodana'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('项目部署') {
|
||||
steps {
|
||||
sh '''echo "部署项目"'''
|
||||
sh '''set GOARCH=amd64'''
|
||||
sh '''set GOOS=linux'''
|
||||
sh '''go build -o personalMain'''
|
||||
sh 'echo "部署项目"'
|
||||
sh 'export GOARCH=amd64'
|
||||
sh 'export 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)])
|
||||
sh 'echo "部署项目至服务器"'
|
||||
// 这里放置部署至服务器的代码
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user