AkurAI Build
Menu

Public repository / 34fb1ee8d3093927513e21ddd902f4ce1d7385c1

AkurAI-Build / .akurai.yml

Latest change a0c9d4ff8c1ee8397ccd5287465783b1f0f23d04 - deploy: path-activated root forge swap; CI job stages binary without sudo (OLI-279) by Ólafur Búi Ólafsson

version: 1
# AkurAI-Build is split into an HTTP service and a worker. The worker owns
# pipeline execution, so a protected job can replace the service without
# restarting or self-severing the worker. Production deploys consume the
# package job's prebuilt binary through deploy/service-deploy.sh --scheduled,
# which swaps the akurai-build system unit's binary in a transient systemd unit
# 5s after the job ends (a direct restart would kill the job), with health
# check and rollback. See the script header for the sudo requirement.
jobs:
  - name: lint-config
    executor: native
    branches: [main]
    run:
      - sh scripts/test-lint-akurai-yml.sh
      - sh scripts/lint-akurai-yml.sh .akurai.yml
      - sh scripts/test-lint-sibling-deps.sh
      - sh scripts/test-service-deploy.sh
      - sh scripts/lint-sibling-deps.sh

  - name: verify
    needs: [lint-config]
    executor: native
    branches: [main]
    run:
      - RUSTUP_HOME=$AKURAI_HOST_HOME/.rustup CARGO_HOME=$AKURAI_HOST_HOME/.cargo PATH=$AKURAI_HOST_HOME/.cargo/bin:/usr/bin:/bin cargo fmt --all -- --check
      - RUSTUP_HOME=$AKURAI_HOST_HOME/.rustup CARGO_HOME=$AKURAI_HOST_HOME/.cargo PATH=$AKURAI_HOST_HOME/.cargo/bin:/usr/bin:/bin cargo clippy --all-targets --all-features -- -D warnings
      - RUSTUP_HOME=$AKURAI_HOST_HOME/.rustup CARGO_HOME=$AKURAI_HOST_HOME/.cargo PATH=$AKURAI_HOST_HOME/.cargo/bin:/usr/bin:/bin cargo test

  - name: package
    needs: [verify]
    executor: native
    branches: [main]
    run: RUSTUP_HOME=$AKURAI_HOST_HOME/.rustup CARGO_HOME=$AKURAI_HOST_HOME/.cargo PATH=$AKURAI_HOST_HOME/.cargo/bin:/usr/bin:/bin cargo build --release
    artifacts:
      - target/release/akurai

  - name: deploy-production
    needs: [package]
    executor: native
    branches: [main]
    environment: production
    approval: true
    run: sh deploy/service-deploy.sh --scheduled