Skip to content

Commit

Permalink
Arun: Added jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
aruncsengr committed Dec 5, 2018
1 parent 651b4a8 commit 7e49129
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
pipeline {
agent any
environment {
GITHUB_API_TOKEN = credentials('repo:status:deployment')
RUN_DISPLAY_URL = "${env.RUN_DISPLAY_URL}"
}
stages {
stage('Security testing') {
steps {

}
post {
success{
sh '''
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"}'
'''
}
failure{
sh '''
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"}'
'''
}
}
}
stage('Unit testing') {
steps {

}
post{
always{
junit 'spec/reports/*.xml'
}
success{
sh '''
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"}'
'''
}
failure{
sh '''
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"}'
'''
}
}
}
}
}

0 comments on commit 7e49129

Please sign in to comment.