2 Star 3 Fork 0

xiaozhao32 / oner365-springboot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
xiaozhao32 提交于 2023-03-17 16:37 . update pom.xml springboot2.7.9
#!/usr/bin/env groovy
def branchName = "oner365-springboot-2.0.2"
def credentialsId = "gitee auth id"
def gitUrl = "https://gitee.com/xiaozhao32/oner365-springboot.git"
def sshName = "sshServer"
def sshExecTimeout = 600000
def sshSourceFiles = "target/*.jar"
def sshRemovePrefix = "target/"
def sshRemoteDirectory = "oner365-springboot"
def sshExecCommand = "oner365-springboot/start.sh"
pipeline {
agent any
stages {
stage('Pull Git') {
steps {
checkout scmGit(
branches: [[name: "${branchName}"]], extensions: [],
userRemoteConfigs: [
[credentialsId: "${credentialsId}", url: "${gitUrl}"]
]
)
echo '拉取git仓库代码 - SUCCESS'
}
}
stage('Maven Build') {
steps {
sh 'mvn clean package -DskipTests'
echo '通过 maven 构建项目 - SUCCESS'
}
}
stage('Docker Build') {
steps {
// TODO
echo '通过 docker 制作自定义镜像 - SUCCESS'
}
}
stage('Publish Server') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(
configName: "${sshName}",
transfers: [sshTransfer(
cleanRemote: false, excludes: '', execTimeout: "${sshExecTimeout}",
flatten: false, makeEmptyDirs: false, noDefaultExcludes: false,
patternSeparator: '[, ]+', remoteDirectorySDF: false,
sourceFiles: "${sshSourceFiles}",
removePrefix: "${sshRemovePrefix}",
remoteDirectory: "${sshRemoteDirectory}",
execCommand: "${sshExecCommand}",
)],
usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false
)
])
echo '通过 Publish Over SSH 目标服务器 - SUCCESS'
}
}
}
}
Java
1
https://gitee.com/xiaozhao32/oner365-springboot.git
git@gitee.com:xiaozhao32/oner365-springboot.git
xiaozhao32
oner365-springboot
oner365-springboot
master

搜索帮助