Gitlab CI yml - If curl statement fails need to trigger JIRA pipeline
I have few curl statements under script section in gitlab-ci.yml file, my pipeline is getting failed if anyone of the curl statements are failed.
sample_dump:
stage: compare
only:
- schedules
script:
- 'curl -k -f -i -s -H 'Content-Type: application/json' -X PUT -d '{"permissions": ["VIEWSPACE","REMOVEOWNCONTENT","COMMENT","EDITSPACE","SETSPACEPERMISSIONS","REMOVEPAGE","REMOVECOMMENT","REMOVEBLOG","CREATEATTACHMENT","REMOVEATTACHMENT","EDITBLOG","EXPORTSPACE","REMOVEMAIL","SETPAGEPERMISSIONS"]}' -u $USERNAME:$PASSWORD "https://url/to/get/someoutput/from/first/successful/run"'
- 'curl -k -f -i -s -H 'Content-Type: application/json' -X PUT -d '{"permissions": ["VIEWSPACE","REMOVEOWNCONTENT","COMMENT","EDITSPACE","SETSPACEPERMISSIONS","REMOVEPAGE","REMOVECOMMENT","REMOVEBLOG","CREATEATTACHMENT","REMOVEATTACHMENT","EDITBLOG","EXPORTSPACE","REMOVEMAIL","SETPAGEPERMISSIONS"]}' -u $USERNAME:$PASSWORD "https://url/to/get/someoutput/from/second/successful/run"'
- 'curl -k -f -i -s -H 'Content-Type: application/json' -X PUT -d '{"permissions": ["VIEWSPACE","REMOVEOWNCONTENT","COMMENT","EDITSPACE","SETSPACEPERMISSIONS","REMOVEPAGE","REMOVECOMMENT","REMOVEBLOG","CREATEATTACHMENT","REMOVEATTACHMENT","EDITBLOG","EXPORTSPACE","REMOVEMAIL","SETPAGEPERMISSIONS"]}' -u $USERNAME:$PASSWORD "https://url/to/get/someoutput/from/third/successful/run"'
demo:
when: on_success
expire_in: 4 weeks
paths:
- inventory.json
Generate_sample_config:
stage: build
only:
- schedules
when: on_success
script:
I would like to receive a JIRA ticket, if curl statements got failed. How we can perform this action.