-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathJenkinsfile
39 lines (36 loc) · 1.05 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
void setBuildStatus(String jsUrl, String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: jsUrl],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/sampleCode"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}
pipeline {
agent none
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr:'20'))
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('build') {
agent any
steps {
sh 'pwd'
echo 'build'
}
}
stage('Test') {
agent {
label 'slave1'
}
steps {
sh 'pwd'
sh 'echo run test at slave1'
sh 'python ./src/test2.py'
}
}
}
}