innisfree 0.4.2

Exposes local services on public IPv4 address, via cloud server.
Documentation
# default: lint, test, build
default: check test build

alias all := default

# build container image
container:
    nix build .#container

# build the binary
build:
    cargo build

# build, then run `innisfree up`
run: build
    cargo run -- up

# run unit tests
test:
    cargo nextest run

# run linters
check:
    cargo check --all-features --all-targets
    cargo clippy --all-features --all-targets
    cargo fmt --check

alias lint := check

# build a fresh .deb and dpkg-install it
install:
    rm -vf target/debian/innisfree*.deb
    just deb
    sudo dpkg -i target/debian/innisfree*.deb

# remove build artifacts
clean:
    cargo clean
    git clean -fdX

# build a .deb package
deb:
    cargo build --release
    # Render the systemd unit at the path cargo-deb's asset list
    # expects. `--no-build` below skips a re-build since we just did
    # it ourselves.
    ./target/release/innisfree systemd-service > target/release/innisfree@.service
    cargo deb --no-build

# CI pipeline: deps, lint, test, release build, deb
ci: check test
    cargo build --release
    just deb

# run the live integration test (builds, applies setcap via sudo, then
# `cargo test --test integration_test --ignored`). Provisions a real
# DigitalOcean droplet — DIGITALOCEAN_API_TOKEN must be set.
integration:
    ./tools/test-runner

# reproducible-build test of the release binary
reprotest:
    reprotest \
        --variations "-kernel, -user_group, -domain_host, -home" \
        --min-cpus=99999 --auto-build -c "nix build" . "result/bin/innisfree"

# reproducible-build test of the .deb (currently broken: cargo-deb lacks
# SOURCE_DATE_EPOCH support; timestamps and 'Depends' ordering vary)
reprotest-deb:
    gum log --level=warn "doesn't work yet, since cargo-deb has no support for 'SOURCE_DATE_EPOCH'"
    gum log --level=debug "two variations are prominent: timestamp metadata, and ordering of the 'Depends' field values."
    reprotest \
        --variations "-kernel, -user_group, -domain_host, -home" \
        --min-cpus=99999 --auto-build -c "just deb" . "target/debian/*.deb"