新增 pipeline 流水线文件 K8s集群部署

This commit is contained in:
2024-01-25 14:24:08 +08:00
parent 2638e3b26e
commit 5b44f607ed
3 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
pipeline {
agent {
kubernetes {
inheritFrom 'maven'
containerTemplate {
name 'maven'
image 'maven:3.8.4-jdk-8'
}
}
}
stages {
stage('拉取代码') {
steps {
checkout([$class: 'GitSCM', branches: [[name: 'devops']],
extensions: [[$class: 'CloneOption', depth: 1, shallow: true]], userRemoteConfigs: [[url: 'http://gitea.hhdxw.top:3000/yovinchen/xlcs.git']]
])
}
}
stage('编译jar包') {
agent none
steps {
container('maven') {
sh 'mvn -f xlcs-parent/pom.xml -B clean package -Dmaven.test.skip=true -Dautoconfig.skip'
}
}
}
stage('保存制品') {
steps {
archiveArtifacts(artifacts: 'xlcs-parent/service/service-acl/target/service-acl.jar', followSymlinks: false)
}
}
}
}