-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsFile
42 lines (37 loc) · 1.31 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
41
42
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: '*/main']],
extensions: [],
userRemoteConfigs: [[url: 'https://github.com/Yashovardhan08/jenkinsDemo.git']]
])
}
}
stage('Build') {
steps {
git branch: 'main', url: 'https://github.com/Yashovardhan08/jenkinsDemo.git'
sh 'python3 program.py'
}
}
stage('Test') {
steps {
git branch: 'main', url: 'https://github.com/Yashovardhan08/jenkinsDemo.git'
sh 'python3 test.py'
}
}
}
post {
always {
echo 'Sending Email.'
emailext body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}",
recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']],
subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}",
to: '[email protected]'
echo 'Email Sent.'
}
}
}