Skip to content

Commit 7e49129

Browse files
committed
Arun: Added jenkins file
1 parent 651b4a8 commit 7e49129

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Jenkinsfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
pipeline {
2+
agent any
3+
environment {
4+
GITHUB_API_TOKEN = credentials('repo:status:deployment')
5+
RUN_DISPLAY_URL = "${env.RUN_DISPLAY_URL}"
6+
}
7+
stages {
8+
stage('Security testing') {
9+
steps {
10+
11+
}
12+
post {
13+
success{
14+
sh '''
15+
curl -XPOST -H "Authorization: token $GITHUB_API_TOKEN" https://api.github.com/repos/aruncsengr/name_directory/statuses/$GIT_COMMIT -d '{"state": "success","target_url": "'"$RUN_DISPLAY_URL"'","description": "Good to go!","context": "Jiffle CI/Security"}'
16+
'''
17+
}
18+
failure{
19+
sh '''
20+
curl -XPOST -H "Authorization: token $GITHUB_API_TOKEN" https://api.github.com/repos/aruncsengr/name_directory/statuses/$GIT_COMMIT -d '{"state": "failure","target_url": "'"$RUN_DISPLAY_URL"'","description": "Something went wrong!","context": "Jiffle CI/Security"}'
21+
'''
22+
}
23+
}
24+
}
25+
stage('Unit testing') {
26+
steps {
27+
28+
}
29+
post{
30+
always{
31+
junit 'spec/reports/*.xml'
32+
}
33+
success{
34+
sh '''
35+
curl -XPOST -H "Authorization: token $GITHUB_API_TOKEN" https://api.github.com/repos/aruncsengr/name_directory/statuses/$GIT_COMMIT -d '{"state": "success","target_url": "'"$RUN_DISPLAY_URL"'","description": "Good to go!","context": "Jiffle CI/Unit testing"}'
36+
'''
37+
}
38+
failure{
39+
sh '''
40+
curl -XPOST -H "Authorization: token $GITHUB_API_TOKEN" https://api.github.com/repos/aruncsengr/name_directory/statuses/$GIT_COMMIT -d '{"state": "failure","target_url": "'"$RUN_DISPLAY_URL"'","description": "Something went wrong!","context": "Jiffle CI/Unit testing"}'
41+
'''
42+
}
43+
}
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)