OXYGENHUB

Getting Started

Andy McCall edited this page · 1 revision

Getting Started

1. Write a pipeline

Create .flow/pipeline.kdl at the top of the repository:

schema-version 1

sandbox "alpine" {
    runtime "microvm"
    rootfs "cas://blob/e95d22fb2380b67193f2640a12c2f8c7bae485f6fd14330bdb0c7157faa588dc"
    memory-limit "256MiB"
    cpu-limit 1
    network "isolated"
}

job "lint" {
    sandbox "alpine"
    exec "sh" "-eu" ".flow/jobs/lint.sh"
}

job "test" {
    sandbox "alpine"
    depends-on "lint"
    scope "src/**"
    exec "sh" "-eu" ".flow/jobs/test.sh"
}
  • A sandbox names the root file system image (by hash) and the job's limits.
  • A job runs one command in a sandbox. The repository is at /src.
  • scope limits a job to the paths it reads. A change that doesn't touch them keeps the job's last result.

2. Check it

flow check

This prints the jobs and the pipeline's hash, or says what's wrong and on which line.

3. Run it on your machine

flow run          # every job
flow run test     # one job, and what it depends on

See Running Locally.

4. Push

oxy push

The run appears on the repository's Flow tab on OxygenHub, and each job sets a check on the change. flow wait follows the checks of a pushed state from the terminal.