-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathJenkinsfile.download_logs
40 lines (34 loc) · 1.1 KB
/
Jenkinsfile.download_logs
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 { label 'download_logs' }
parameters {
string(name: 'REMOTE_SERVICE_URL', defaultValue: 'https://api.openshift.com', description: 'Service URL')
}
triggers { cron('H/30 * * * *') }
environment {
SKIPPER_PARAMS = " "
OFFLINE_TOKEN = credentials('admin_offline_token')
JIRA_CREDS = credentials('Ronnie-jira')
LOGS_DEST = "build"
SLACK_TOKEN = credentials('slack-token')
}
options {
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('Run') {
steps {
sh "make download_logs"
sh "skipper run discovery-infra/create_triage_tickets.py -up ${JIRA_CREDS}"
}
}
}
post {
failure {
script {
def data = [text: "Attention! ${BUILD_TAG} job failed, see: ${BUILD_URL}"]
writeJSON(file: 'data.txt', json: data, pretty: 4)
}
sh '''curl -X POST -H 'Content-type: application/json' --data-binary "@data.txt" https://hooks.slack.com/services/${SLACK_TOKEN}'''
}
}
}