-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathJenkinsfile
More file actions
55 lines (49 loc) · 1.24 KB
/
Jenkinsfile
File metadata and controls
55 lines (49 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pipeline {
// 在任何代理节点运行
agent any
tools {
// maven3.6.0 要在 jenkins全局工具配置中提前配置好
maven 'maven3.6.0'
}
stages {
stage('GitPull') {
steps {
// 从Gitee的master分支获取代码
git url: "https://gitee.com/lakernote/easy-admin.git", branch: "master"
}
}
stage('Build') {
steps {
// 运行Maven 跳过单元测试
sh 'mvn clean package -Dmaven.test.skip=true'
}
}
stage('Archive') {
steps {
// 会把target/*.jar文件归档到Jenkins的工作目录中的 archive 目录下
archiveArtifacts 'target/*.jar'
}
}
stage('Deploy') {
steps {
sh """
echo '开始部署'
pwd
date
"""
}
}
}
post {
// 构建后的操作
success {
sh "echo '构建成功'"
}
failure {
sh "echo '构建失败'"
}
always {
sh "echo '[构建完成]'"
}
}
}