aboutsummaryrefslogblamecommitdiffstats
path: root/builds.sr.ht/manifest.md
blob: 694daa19d7af15930f3972dbdafd6583388a1841 (plain) (tree)









































                                                                                





                                                           



                                                                              







                                                                        


                                                                              

                                                                              
                                                                         





                                                                              
                                                               



                                                                              


























                                                                            


                                                                                




                                                                          


                                       













                                                                         
A build manifest is a YAML file that describes how to perform a build. Here's an
example:

    image: archlinux
    packages:
      - cmake
      - wlc-git
      - xorg-server-xwayland
      - xcb-util-image
      - json-c
      - pango
      - cairo
      - wayland
      - gdk-pixbuf2
      - asciidoc
    sources:
      - https://github.com/SirCmpwn/sway
    tasks:
      - setup: |
          cd sway
          mkdir build
          cd build
          cmake ..
      - build: |
          cd sway
          cd build
          make

The minimum build manifest has an image and at least one task. The various
properties available are described here:

## image

*string*

Which OS image to build in. A list of available build images can be found
[here](/builds.sr.ht/#build-images).

## packages

*list* (of *string*)

A list of package names to install on the image.

- **Alpine** installs these packages with `apk`
- **Arch Linux** installs these packages with `yay`
- **Debian** installs these packages with `apt-get install`
- **FreeBSD** installs these packages with `pkg`
- **NixOS** installs these packages with `nix-env -iA`. Since it's possible to
  specify multiple channels, you must provide the full selection path,
  for example `nixpkgs.hello`. Note that the `nixpkgs` channel is **not**
  added by default.

## repositories

*dictionary* (of *string: string*)

A list of extra repositories to enable with the image's package manager.
The format is name: url, and the syntax of url varies between images.

- **Alpine** uses `repo-url key-url key-name`, where `repo-url` is the URL of
  the package repository and `key-url` is a URL from where the signing key may
  be downloaded, and `key-name` is the name of the file written to
  `/etc/apk/keys/`. If the name of the repo is prefixed with an @, it will use
  that prefix in apk.
- **Arch Linux** uses `url#key-id`, where `url` is the URL of the package
  repository and `key-id` is the ID of the published PGP key the packages are
  signed with.
- **Debian** uses `url distro component key-id`, where `url` is the URL of the
  package repository, `distro` is e.g. `jessie` or `stretch`, `component` is
  e.g. `main` or `non-free`, and `key-id` is an optional PGP key ID to add to
  apt-key.
- **FreeBSD** images do not support extra package repositories.
- **NixOS** uses `channel-url`. The repo name is relevant, since
  `repo-name: repo-url` wil execute the commands
  `nix-channel --add repo-url repo-name` and `nix-channel --update repo-name`.
  Given the nature of nix, no channel is added by default.

## sources

*list* (of *string*)

A list of git repositories to clone into the home directory of the build
user in the build environment.

## tasks

*list* (of *string*)

A list of scripts to execute in the build environment. These scripts are run
with the following preamble:

    #!/usr/bin/env bash
    . ~/.buildenv
    set -x
    set -e

~/.buildenv contains environment variables specified by the `environment`
directive.

Task names must use only lowercase alphanumeric characters or underscores
and must be <=128 characters in length. Tasks are executed in the order
specified.

Each task is run in a separate login session, so if you modify the groups of the
`build` user they will be effective starting from the subsequent task.

## triggers

*list* (of *trigger*)

A list of triggers to execute post-build, which can be used to send emails
or do other post-build tasks.

See also: [Build triggers](triggers.md)

## environment

*dictionary* (of *string: string* OR *string: list*)

A list of key/value pairs for options to set in the build environment via
~/.buildenv.

## secrets

*list* (of *string*)

List of secret UUIDs to be added to the guest during the build. See also:
[secrets](/builds.sr.ht#secrets).