-
Notifications
You must be signed in to change notification settings - Fork 2
Developer Documentation
-
mainlineshall always be in a release-ready state. - This project shall produce the primary build artifacts using only one command from a fresh clone on a new machine (
./toolboxornpm run clean-verify). - The only prerequisite dependency of this project shall be Docker.
- Continuous Integration tests shall be reproducible on a developer's machine.
- Behavior is defined by tests, not code.
-
CIMerge a change intomainline, triggering the Continuous Integration workflow. -
CIBuild and test the project in a Docker container from both a rootful and rootless Docker context, and store the build artifacts found inbuild/release/if the run is successful. -
CDIf the previous Continuous Integration workflow successfully finished, trigger the Continuous Deployment workflow. -
CDIf thepackage.jsonversion is equal or less-than the current released version, stop. -
CDSign the previously uploaded build artifacts (do not rebuild). -
CDCreate a release and add both the build artifacts and signature file.
Toolbox is a shell script designed to be the main entry point for this project. In essence, all toolbox does is run commands in a temporary Docker container defined by a Docker Compose file. This is the primary purpose of this project: a proof of concept of a completely containerized toolchain. A unified environment between each developer and automated runner.
There are some quirks though:
Reading and writing node_modules with Docker is really slow on Windows. To increase performance, these intermediate directories use Docker volumes instead of a host mount at the cost of additional complexity (mainly, permissions when Docker creates these directories on the host and container).
Items created by rootful Docker (like file system mounts) will be owned by root on Linux systems. To get around this, toolbox creates these items itself and sets the owner to the current user. This is accomplished by reading the volumes: entry of the docker compose file with yq to create items on the host, and forward instructions to Dockerfile to create and own the matching items in the image. Running Docker in a rootless context also works.