Description¶
Starts the m-parse-manuscript pipeline for the current Jira ticket with bitbucket_trigger_pipeline.py. The ingest pipelines call it right after their “started” comment, so the conversion runs while the ingest runs.
The pipeline is only started when it is needed. The script downloads the PDF attachments into a scratch directory and compares the manuscript(s) with the checksums in generated/manuscript.sha256, which 31_parse_manuscript.sh records after each successful conversion:
| Checksum file | Manuscript | Result |
|---|---|---|
| Missing or empty | Present | Started |
| Differs (changed, renamed, added or removed) | Present | Started |
| Same | Present | Not started |
| Any | None attached | Not started |
Other PDFs, such as forms, do not count. If the check itself fails, or there is no Jira ticket to check, the pipeline is started anyway.
It never fails. The ingest does not depend on the conversion, so a pipeline that could not be started is only reported as a warning. (The atlassian/trigger-pipeline pipe that hands over to the big ingest cannot be made optional this way: a failing pipe stops the step.)
Usage¶
. ./tools/resolve_jiraticket.sh
./automations/33_trigger_parse_manuscript.shEnvironment Variables¶
jiraticket- Passed on to the pipeline; set bytools/resolve_jiraticket.sh.JIRA_USERNAME,JIRA_API_KEY- Credentials for the attachment download.JIRA_USERNAME,P_BITBUCKET_PAT- Credentials for the Bitbucket API.BITBUCKET_WORKSPACE,BITBUCKET_REPO_SLUG,BITBUCKET_BRANCH- Set by Bitbucket Pipelines.