Skip to content

Commit a0aa684

Browse files
committed
📝 Add local building instructions to CONTRIBUTING
1 parent 4f53437 commit a0aa684

File tree

2 files changed

+39
-9
lines changed

2 files changed

+39
-9
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,45 @@ Steps to build a release:
3737
'
3838
"
3939
```
40-
- Let CircleCI build your drafts / works-in-progress
41-
* Build environment will match actual docs build environment
42-
* CircleCI takes ~2 minutes to build
43-
1. Fork https://github.com/FCP-INDI/fcp-indi.github.com
44-
1. In your fork's settings, set the GitHub Pages `source` to `master` branch
45-
![GitHub Pages settings example screenshot](./images/github-pages-settings-example.png)
46-
1. Add your project on CircleCI
47-
1. Merge your draft / work-in-progress into your fork's `source` branch. Make sure you push to your fork and not the main repository's `source` branch.
48-
1. Your fork will publish at `https://[your_GitHub_username].github.io/fcp-indi.github.com/`.
40+
41+
### Building
42+
43+
#### Let CircleCI build your drafts / works-in-progress
44+
* Build environment will match actual docs build environment
45+
* CircleCI takes ~2 minutes to build
46+
1. Fork https://github.com/FCP-INDI/fcp-indi.github.com
47+
1. In your fork's settings, set the GitHub Pages `source` to `master` branch
48+
![GitHub Pages settings example screenshot](./images/github-pages-settings-example.png)
49+
1. Add your project on CircleCI
50+
1. Merge your draft / work-in-progress into your fork's `source` branch. Make sure you push to your fork and not the main repository's `source` branch.
51+
1. Your fork will publish at `https://[your_GitHub_username].github.io/fcp-indi.github.com/`.
52+
53+
#### Build locally
54+
This documentation aspires to rely on a [single source of truth](https://en.wikipedia.org/wiki/Single_source_of_truth) where possible. To this end, building this documentation requires an installation of the version of [C-PAC](https://github.com/FCP-INDI/C-PAC) that is being documented.
55+
56+
Steps to build this documentation locally:
57+
1. Clone this repository.
58+
1. _(optional)_ <details><summary>Locally replicate the step "👊 Running cpac commands" from [.circleci/config](./.circleci/config) to generate [cpac](https://pypi.org/project/cpac/) usage strings.</summary>
59+
Either perform this "👊 Running cpac commands" step in a separate Python environment or uninstall cpac after generating the usage string(s).
60+
1. _(optional)_ Create an environment for cpac and activate this environment.
61+
1. `pip install cpac`
62+
1. If you don't have a local container for the version of C-PAC you're documenting, `cpac pull` to download the latest or `cpac pull --tag $TAG` to pull a specific version.
63+
1. Generate ReStructuredText documents with cpac usage strings:
64+
```BASH
65+
mkdir -p docs/_sources/user/cpac
66+
printf ".. code-block:: console\n\n $ cpac --help\n\n" > docs/_sources/user/cpac/help.rst
67+
cpac --help | sed -e "s/.*/ &/" >> docs/_sources/user/cpac/help.rst
68+
mkdir -p docs/_sources/user/run
69+
printf "Usage: cpac run\n\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\n.. code-block:: console\n\n $ cpac run --help\n\n" > docs/_sources/user/run/help.rst
70+
cpac run --help | sed -e "s/.*/ &/" >> docs/_sources/user/run/help.rst
71+
mkdir -p docs/_sources/user/utils
72+
printf "Usage: cpac utils\n\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\n.. code-block:: console\n\n $ cpac utils --help\n\n" > docs/_sources/user/utils/help.rst
73+
cpac utils --help | sed -e "s/.*/ &/" >> docs/_sources/user/utils/help.rst
74+
```
75+
1. `deactivate` your cpac environment if you used a separate environment or `pip uninstall cpac`.
76+
</details>
77+
1. Locally install [C-PAC](https://github.com/FCP-INDI/C-PAC) from source.
78+
1. Run `./bin/build $VERSION` where `$VERSION` is the version to build (`nightly`, `latest`, or [<span title='Semantic Versioning'>semver</span>](https://semver.org/) for production, but this string can be anything you want locally). ![example version](./images/example_version.png)
4979

5080
## Flowcharts
5181

images/example_version.png

39.9 KB
Loading

0 commit comments

Comments
 (0)