-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_jenkins
More file actions
46 lines (46 loc) · 1.48 KB
/
example_jenkins
File metadata and controls
46 lines (46 loc) · 1.48 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
stages {
stage('PkgName') {
stages {
stage('Roxygen') {
steps {
sh 'R -q -e \'roxygen2::roxygenize("PkgName")\''
}
}
stage('Build') {
steps {
sh 'R CMD build PkgName'
}
}
stage('Check') {
steps {
script() {
switch(sh(script: 'ls PkgName_*.tar.gz && R CMD check PkgName_*.tar.gz --no-manual --no-tests', returnStatus: true)) {
case 0: currentBuild.result = 'SUCCESS'
default: currentBuild.result = 'FAILURE'; error('script exited with failure status')
}
}
}
}
stage('Install') {
steps {
sh 'R -q -e \'install.packages(list.files(".","PkgName_.*.tar.gz"), repos = NULL)\''
sh 'R -q -e \'install.packages("tinytest2JUnit")\''
}
}
stage('Test') {
steps {
dir('PkgName') {
sh 'R -q -e \'tinytest2JUnit::testPackage(pkgname ="PkgName", file = file.path(getwd(), "results.xml"))\''
}
}
post {
always {
dir('PkgName') {
junit 'results.xml'
}
}
}
}
}
}
}