-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathJenkinsfile
More file actions
27 lines (24 loc) · 702 Bytes
/
Jenkinsfile
File metadata and controls
27 lines (24 loc) · 702 Bytes
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
node('master') {
stage("Fetch Source Code") {
cleanWs()
git ([url: 'https://github.com/bstephgit/jenkins', branch: 'add-functions-and-tests'])
}
dir('Lesson5') {
printMessage('Running Pipeline')
stage("Testing") {
sh 'ls -la'
sh 'python3 test_functions.py'
}
stage("Deployment") {
if (env.BRANCH_NAME == 'master') {
printMessage('Deploying the master branch')
} else {
printMessage("No deployment for branch [${env.BRANCH_NAME}]")
}
}
printMessage('Pipeline Complete')
}
}
def printMessage(message) {
echo "${message}"
}