Skip to content

Commit

Permalink
Merge pull request bids-standard#767 from sappelhoff/link/git
Browse files Browse the repository at this point in the history
[INFRA] install git in linkchecker job
  • Loading branch information
sappelhoff committed Mar 26, 2021
2 parents a280ae8 + 56e84b3 commit 9c4c09e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ jobs:
docker:
- image: yarikoptic/linkchecker:9.4.0.anchorfix1-1
steps:
# checkout code to default ~/project
- checkout
- attach_workspace:
# mkdocs build outputs will be in ~/project/site
at: ~/project
- run:
name: install git
command: |
apt update -y
apt install git-all -y
- run:
name: check links
command: |
git status
if (! git log -1 --pretty=%b | grep REL:) ; then
chmod a+rX -R ~
linkchecker -t 1 ~/project/site/
Expand Down Expand Up @@ -63,8 +71,9 @@ jobs:
command: |
cd ~/project/pdf_build_src
bash build_pdf.sh
mv ~/project/pdf_build_src/bids-spec.pdf ~/project/bids-spec.pdf
- store_artifacts:
path: ~/project/pdf_build_src/bids-spec.pdf
path: bids-spec.pdf

# Auto changelog collector
github-changelog-generator:
Expand Down
14 changes: 13 additions & 1 deletion pdf_build_src/pandoc_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,21 @@ def build_pdf(filename):
'--output={}'.format(filename),
]

# location of this file: This is also the working directory when
# the pdf is being built using `cd build_pdf_src` and then
# `bash build_pdf.sh`
root = pathlib.Path(__file__).parent.absolute()

# Resources are searched relative to the working directory, but
# we can add additional search paths using <path>:<another path>, ...
# When in one of the 99-appendices/ files there is a reference to
# "../04-modality-specific-files/images/...", then we need to use
# 99-appendices/ as a resource-path so that the relative files can
# be found.
cmd += [f'--resource-path=.:{str(root / "99-appendices")}']

# Add input files to command
# The filenames in `markdown_list` will ensure correct order when sorted
root = pathlib.Path(__file__).parent.absolute()
cmd += [str(root / index_page)]
cmd += [str(root / i) for i in sorted(markdown_list)]

Expand Down

0 comments on commit 9c4c09e

Please sign in to comment.