-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
63 lines (63 loc) · 2.95 KB
/
Jenkinsfile
File metadata and controls
63 lines (63 loc) · 2.95 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
56
57
58
59
60
61
62
63
pipeline {
agent {
node {
label 'master'
}
}
tools {
maven 'maven'
}
options { timeout(time: 4, unit: 'MINUTES') }
stages {
stage('Pull') {
options{
timeout(time:20,unit:'SECONDS')
}
steps {
echo 'Pulling..'
git 'https://gitee.com/pgh1038/gobang.git'
}
}
stage('Build') {
steps {
echo 'Building..'
sh label: 'mvn构建', script: 'mvn clean && mvn install'
}
}
stage('Test') {
steps {
echo 'Testing..'
jacoco(
buildOverBuild: false,
changeBuildStatus: true,
classPattern: '**/target/classes/com',
execPattern: '**/target/coverage-reports/jacoco-ut.exec',
sourcePattern: '**/app',
exclusionPattern: '**/repositories/**,**/ForecastDealListTopic*,**/RedisProxy,**/SqlProvider,**/javascript/**,**/Reverse*,**/routes*,**/*$*,**/RedisConnector,**/RedisProxy,**/RedisUtil*,**/dao/**,**/OAuthTokenVerification*,**/dbpool/**,**/module/**,**/modules/**',
minimumMethodCoverage: '0',
maximumMethodCoverage: '0',
minimumClassCoverage: '0',
maximumClassCoverage: '0',
minimumLineCoverage: '0',
maximumLineCoverage: '0'
)
}
}
// stage('Deploy jar') {
// steps {
// sshPublisher(publishers: [sshPublisherDesc(configName: '119.91.143.195', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/', remoteDirectorySDF: false, removePrefix: 'target', sourceFiles: 'target/*.jar')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
// sshPublisher(publishers: [sshPublisherDesc(configName: '119.91.143.195', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'JENKINS_NODE_COOKIE=dontkillme sh pipeline_node.sh restart', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'pipeline_node.sh')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
// }
// }
stage('Run') {
steps{
sh"""JENKINS_NODE_COOKIE=dontkillme sh fivechess.sh restart """
}
}
stage('Send Email'){
steps {
emailext body: '${DEFAULT_CONTENT}', mimeType: 'text/html', subject: '自动化构建通知:${PROJECT_NAME} - Build # ${BUILD_NUMBER} - ${BUILD_STATUS}!', to: '${DEFAULT_RECIPIENTS}'
}
}
}
}