-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
40 lines (40 loc) · 1.03 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
pipeline {
agent any
parameters {
choice(name: 'NUMBER',
choices: [10,20,30,40,50,60,70,80,90],
description: 'Select the value for F(n) for the Fibonnai sequence.')
}
options {
buildDiscarder(logRotator(daysToKeepStr: '10', numToKeepStr: '10'))
timeout(time: 12, unit: 'HOURS')
timestamps()
}
triggers {
cron '@midnight'
}
stages {
stage('Make executable') {
steps {
sh('chmod +x ./scripts/fibonacci.sh')
}
}
stage('Relative path') {
steps {
sh("./scripts/fibonacci.sh ${env.NUMBER}")
}
}
stage('Full path') {
steps {
sh("${env.WORKSPACE}/scripts/fibonacci.sh ${env.NUMBER}")
}
}
stage('Change directory') {
steps {
dir("${env.WORKSPACE}/scripts"){
sh("./fibonacci.sh ${env.NUMBER}")
}
}
}
}
}