Skip to content

torrust/torrust-tracker-deployer

Repository files navigation

Linting Testing E2E Infrastructure Tests E2E Deployment Tests Coverage SDK Examples Tests Test LXD Container Provisioning Test Dependency Installer Cargo Security Audit Docker Security Scan Container Publish Crate Backup Container Code Statistics

Open in GitHub Codespaces

Torrust Tracker Deployer

Deployment automation for Torrust Tracker environments using OpenTofu, Ansible, and Rust.

Release Status

Version 0.1.0 is the first fully functional release line of the deployer.

Current status:

  • End-to-end workflow is implemented: create, provision, configure, test, release, run, destroy
  • Multi-provider architecture is implemented
  • Providers currently supported: LXD (local development) and Hetzner Cloud (cloud deployments)
  • CI includes linting, unit/integration tests, and split E2E workflows

What This Project Does

The deployer provisions and configures VM infrastructure, then deploys and runs the Torrust Tracker stack.

Workflow:

  1. OpenTofu provisions infrastructure and cloud-init setup.
  2. Ansible configures the provisioned host.
  3. The deployer releases tracker artifacts and starts services.
  4. Built-in commands support verification and teardown.

Quick Start

1. Install dependencies

Recommended (automatic dependency installer):

cargo run --bin dependency-installer install
cargo run --bin dependency-installer check

2. Build and run the CLI

cargo run

3. Create and deploy an environment

# Generate environment config template
cargo run -- create template my-env.json

# Edit config values, then create the environment from the file
cargo run -- create environment --env-file my-env.json

# Provision and configure
cargo run -- provision my-environment
cargo run -- configure my-environment

# Verify and deploy application
cargo run -- test my-environment
cargo run -- release my-environment
cargo run -- run my-environment

# Tear down when done
cargo run -- destroy my-environment

Important:

  • Keep your environment JSON files in envs/.
  • The data/ directory is application-managed deployment state and should not be edited manually.

Docker Usage

For cloud-provider deployments, you can run the deployer via container image:

docker pull torrust/tracker-deployer:latest

docker run --rm \
  -v $(pwd)/data:/var/lib/torrust/deployer/data \
  -v $(pwd)/build:/var/lib/torrust/deployer/build \
  -v $(pwd)/envs:/var/lib/torrust/deployer/envs \
  -v ~/.ssh:/home/deployer/.ssh:ro \
  torrust/tracker-deployer:latest \
  --help

Note: Docker workflow supports cloud providers. For local LXD usage, run the deployer natively on the host.

Development Commands

# Comprehensive linting
cargo run --bin linter all

# Run test suite
cargo test

# E2E suites
cargo run --bin e2e-infrastructure-lifecycle-tests
cargo run --bin e2e-deployment-workflow-tests

# Full E2E workflow (local only)
cargo run --bin e2e-complete-workflow-tests

Documentation Map

For detailed guides, use the docs index and user guide:

Related Repository

The deployer focuses on provisioning, configuring, and deploying Torrust Tracker. For example application operations and maintenance after deployment, see:

Repository Layout

Top-level directories:

  • src/: Rust codebase using DDD layers (domain, application, infrastructure, presentation)
  • templates/: OpenTofu and Ansible templates
  • docs/: user and contributor documentation
  • envs/: user environment configuration files (git-ignored)
  • build/: generated runtime files (git-ignored)
  • data/: application-managed deployment state

Roadmap After 0.1.0

The 0.1.0 line establishes the functional baseline. Upcoming improvements are tracked in the roadmap, including broader provider support and deployment UX refinements.

See: Roadmap

License

This project is licensed under the MIT License.

Packages

 
 
 

Contributors

Languages