-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
45 lines (44 loc) · 1.56 KB
/
Jenkinsfile
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
pipeline {
agent none
environment {
CI = 'true'
}
stages {
stage('init') {
agent any
steps {
echo "Remove all files..."
//deleteDir()
sh 'rm -rf *' //可能不太适合。
}
}
stage('SCM Checkout') { //从SVN中检出代码。
agent any
steps {
echo "Check out the project from github..."
checkout([$class: 'GitSCM', branches: [[name: '*/uat']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'http://github.com/wengchanghe-ray/utilities']]])
}
}
stage('Build/Launch Test') { //这个的意思是:直接启动一个container进行相关
agent { //编译、单元测试、打包的工作。
docker { image 'maven:3-alpine' }
}
steps {
dir('myapp') {
echo "Begin to test..."
sh 'mvn -B package'
}
}
}
stage('Deploy') {
agent any
steps {
// sleep time: 20, unit: "SECONDS"
sh './build/deploy_uat.sh' //这个脚本包括docker的构建(装配代码)和启动
echo 'Deploy finished!'
sh './build/test_uat.sh' //这个脚本包括测试(可以集成测试,界面测试等)
echo 'Test finished!'
}
}
}
}