rox-cli 0.4.0

Composable build tool inspired by Make
Documentation
version_requirements:
  - command: "cargo watch --version"
    minimum_version: "8.1.7"
    split: true

file_requirements:
  - path: "Cargo.toml"

  - path: ".env"
    create_if_not_exists: true

templates:
  - name: docker_build
    command: "docker build {path} -t rox:{image_tag}"
    symbols: ["{path}", "{image_tag}"]

pipelines:
  - name: build-release-all
    description: "Build a release artifact binary and Docker image"
    stages:
      - ["build-release-binary", "build-release-image"]

  - name: ci
    description: "Run all CI-related tasks"
    stages:
      - ["fmt", "clippy-ci"]
      - ["test"]
      - ["fmt", "clippy-ci"]

tasks:
  - name: build-local
    description: "Build the application dockerfile"
    uses: docker_build
    values: [".", "local"]

  - name: build-prod
    description: "Build the application dockerfile"
    uses: docker_build
    values: [".", "latest"]

  - name: dr
    description: "Run 'help' for the packaged Docker application"
    command: "docker run rox:local"
    pre_tasks: ["db"]

  - name: "wr"
    command: "cargo watch -c -x run"
    description: "Run the application, restarting on file changes"
    hide: true

  - name: "wt"
    command: "cargo watch -c -x test"
    description: "Rerun tests on every file change"

  - name: "wc"
    command: "cargo watch -c -x check"
    description: "Rerun checks on every file change"

  - name: "clippy-ci"
    description: "Run Clippy with a non-zero exit if warnings are found."
    command: "cargo clippy -- -D warnings"

  - name: clippy-fix
    command: "cargo clippy"

  - name: fmt
    command: "cargo fmt"

  - name: test
    command: "cargo test"
    description: "Run tests"

  - name: test-workdir
    command: "docker build ."
    workdir: "tests/expected/"

  - name: build-binary
    command: "cargo build"
    description: "Build the dev binary"

  - name: run
    description: "Runs the 'help' command as a basic test"
    command: "cargo run help"

  - name: precommit
    description: "All things to run before a commit"

  # Release-related
  - name: build-release-binary
    description: "Build a release binary with cargo."
    command: "cargo build --release"

  - name: build-release-image
    description: "Build a production image for Docker."
    command: "docker build tests/files/ -t rox:latest"

  # This won't show up in the CLI help output
  - name: invalid
    description: "This task will throw an error becasue it has nothing to do!"
    hide: true