forked from MarkEWaite/jenkins-bugs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
38 lines (32 loc) · 1.35 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
#!groovy
@Library('globalPipelineLibraryMarkEWaite') _
import com.markwaite.Assert
import com.markwaite.Build
/* Only keep the 10 most recent builds. */
properties([[$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '10']]])
def branch = 'master'
node {
stage('Checkout') {
checkout([$class: 'GitSCM',
branches: [[name: branch]],
extensions: [[$class: 'CloneOption', honorRefspec: true, noTags: true, reference: '/var/lib/git/mwaite/bugs/jenkins-bugs.git'],
[$class: 'LocalBranch', localBranch: branch]
],
gitTool: scm.gitTool,
userRemoteConfigs: [[refspec: "+refs/heads/${branch}:refs/remotes/origin/${branch}", url: 'https://github.com/MarkEWaite/jenkins-bugs.git']]])
}
stage('Build') {
/* Call the ant build. */
def my_step = new com.markwaite.Build()
my_step.ant 'info'
}
stage('Verify') {
def my_check = new com.markwaite.Assert()
my_check.logContains(".*[*] ${branch}.*", 'Wrong branch reported')
// if (currentBuild.number > 1) { // Don't check first build
// my_check.logContains('.*Author:.*', 'Build started without a commit - no author line')
// my_check.logContains('.*Date:.*', 'Build started without a commit - no date line')
// }
}
}