-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add earthly build configuration for building docs.
I prefer the now acceptable build.earth filename over for the Filefile-style Earthfile. Along with the build.earth I've also included a .earthlyignore file which uses the same format as a [.dockerignore] file. Although we are not creating distributable images ignoring spurious files in the docker context helps cut down on cache misses invalidating dependency layers in the build. [.dockerignore]: https://docs.docker.com/build/concepts/context/#dockerignore-files
- Loading branch information
1 parent
28280c3
commit 9043f6c
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# https://docs.docker.com/build/concepts/context/#dockerignore-files | ||
# Unlike .gitignore files directories are not ignored at all layers by default. | ||
# The **/ prefix will make a pattern behave like a .gitignore pattern and apply | ||
# in any directory, including the root. | ||
**/*.pyc | ||
**/.direnv/ | ||
**/.envrc | ||
**/.git/ | ||
**/.github/ | ||
**/.pytest_cache/ | ||
**/.ruff_cache/ | ||
**/__pycache__/ | ||
**/_build/ | ||
**/build/ | ||
**/deb_dist/ | ||
**/dist/ | ||
**/rosdep.egg-info/ | ||
**/rosdep_modules.egg-info/ | ||
**/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
VERSION 0.8 | ||
|
||
build: | ||
FROM docker.io/library/python:3.12 | ||
RUN mkdir -p /src || true | ||
COPY --dir doc src test \ | ||
CHANGELOG.rst \ | ||
Makefile \ | ||
README.md \ | ||
rosdoc.yaml \ | ||
setup.cfg \ | ||
setup.py \ | ||
stdeb.cfg \ | ||
/src/rosdep | ||
WORKDIR /src/rosdep | ||
RUN pip install -e . | ||
|
||
testdeps: | ||
FROM +build | ||
RUN pip install .[test] | ||
|
||
test: | ||
# TODO tests aren't passing in context. | ||
FROM +testdeps | ||
RUN pytest test | ||
|
||
docdeps: | ||
FROM +build | ||
RUN pip install .[doc] | ||
|
||
doc: | ||
FROM +docdeps | ||
WORKDIR /src/rosdep/doc | ||
RUN make html | ||
SAVE ARTIFACT _build/html AS LOCAL doc/_build/html |