3.4 KiB
Just Build System
A modular build system using Just that supports container builds, Python tooling, and more.
Installation
There are several ways to use this build system:
Method 1: Global Installation with Symlinks
-
Clone this repository to a permanent location:
git clone https://github.com/yourusername/wjust ~/.wjust -
In your project, create the module directories and symlink the justfiles:
# Create module directories mkdir -p container python # Create symlinks to the global justfiles ln -s ~/.wjust/container/justfile container/justfile ln -s ~/.wjust/python/justfile python/justfile -
Create your project's
justfile:# Import modules mod container mod python # Override or add project-specific recipes here default: @just --list -
Create required files:
# For container module echo "registry.example.com/myproject" > container/name # Optional: Set version echo "0.1.0" > version # Or use __about__.py with __version__ = "0.1.0"
Method 2: Local Copy (Traditional)
Copy the entire module directories to your project:
cp -r ~/.wjust/container ~/.wjust/python .
Then create your justfile as shown above.
Method 3: Remote Import (Advanced)
For advanced users who want to pull updates directly from the repository:
# Create a script to update modules
cat > update-just-modules.sh << 'EOF'
#!/bin/bash
REPO="https://raw.githubusercontent.com/yourusername/wjust/main"
mkdir -p {container,python}
curl -o container/justfile "$REPO/container/justfile"
curl -o python/justfile "$REPO/python/justfile"
EOF
chmod +x update-just-modules.sh
Then run ./update-just-modules.sh whenever you want to update the modules.
Quick Start
- Choose an installation method from above
- Run
justto see available commands:just Available recipes: container ... # Container management python ... # Python tools
Container Module
The container module provides standardized container building and deployment.
Setup
-
Create a
container/namefile with your container registry path:registry.example.com/myproject -
Version will be detected from (in order):
- Any
__about__.pyfile containing__version__ = "x.y.z" - A
versionfile in the project root - Defaults to "0.0.0" if neither exists
- Any
-
Create your
container/Containerfile:FROM python:3.11 # Add your container configuration
Usage
# Show available commands
just
# Build container
just container build
# Push container to registry
just container deploy
Customization
The container module provides these recipes:
build: Builds the container with version tagdeploy: Pushes the container to the registry
Python Module
The Python module provides linting with Ruff.
Usage
# Run linter
just python lint
# Run linter with auto-fix
just python lint-fix
Adding New Modules
- Create a new directory for your module
- Add a
justfilein the module directory - Import it in your root
justfilewithmod mymodule
Environment Variables
VERSION: Automatically set from__about__.pyorversionfileCONTAINER_NAME: Set fromcontainer/namefile
Contributing
Feel free to submit issues and pull requests for additional modules or improvements.