项目部署
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 {
|
environment {
|
||||||
QODANA_TOKEN=credentials('qodana-token')
|
QODANA_TOKEN=credentials('qodana-token')
|
||||||
}
|
}
|
||||||
agent {
|
agent any
|
||||||
docker {
|
|
||||||
args '''
|
|
||||||
-v "${WORKSPACE}":/data/project
|
|
||||||
--entrypoint=""
|
|
||||||
'''
|
|
||||||
image 'jetbrains/qodana-go'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stages {
|
stages {
|
||||||
stage('Qodana代码检查') {
|
stage('Qodana代码检查') {
|
||||||
when {
|
when {
|
||||||
branch 'feature'
|
branch 'feature'
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh '''qodana'''
|
script {
|
||||||
|
docker.image('jetbrains/qodana-go').run('''
|
||||||
|
-v "${WORKSPACE}":/data/project
|
||||||
|
--entrypoint=""
|
||||||
|
''') {
|
||||||
|
sh 'qodana'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('项目部署') {
|
stage('项目部署') {
|
||||||
steps {
|
steps {
|
||||||
sh '''echo "部署项目"'''
|
sh 'echo "部署项目"'
|
||||||
sh '''set GOARCH=amd64'''
|
sh 'export GOARCH=amd64'
|
||||||
sh '''set GOOS=linux'''
|
sh 'export GOOS=linux'
|
||||||
sh '''go build -o personalMain'''
|
sh 'go build -o personalMain'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('项目部署至服务器') {
|
stage('项目部署至服务器') {
|
||||||
steps {
|
steps {
|
||||||
sh '''echo "部署项目至服务器"'''
|
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)])
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user