# ci

This is a collection of scripts that I use for a DIY continuous integration system for my repos.

Within a bare repo, it's enough to call the `run_post_receive_checks.sh` wrapper, for example:

```bash
#!/usr/bin/env bash

set -o errexit
set -o nounset

bash ~/repos/scripts/ci/run_post_receive_checks.sh chives
```

## The individual scripts

<!-- [[[cog

# This adds the root of the repo to the PATH, which has cog_helpers.py
from os.path import abspath, dirname
import sys

sys.path.append(abspath(dirname(dirname("."))))

import cog_helpers

folder_name = "ci"

scripts = [
    {
        "usage": "run_post_receive_checks.sh [REPO_NAME]",
        "description": """
        run the post-receive checks for a repo, dumping the output to a file
        """
    },
    {
        "usage": "post_receive_tests.sh [REPO_NAME]",
        "description": """
        run the tests for a repo, printing output to stdout/stderr
        """
    },
    {
        "usage": "ts",
        "description": """
        find the `run_{name}_tests.sh` script in a repo and run it
        """
    },
]

cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)

]]]-->
<dl>
  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/ci/run_post_receive_checks.sh">
      <code>run_post_receive_checks.sh [REPO_NAME]</code>
    </a>
  </dt>
  <dd>
    run the post-receive checks for a repo, dumping the output to a file
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/ci/post_receive_tests.sh">
      <code>post_receive_tests.sh [REPO_NAME]</code>
    </a>
  </dt>
  <dd>
    run the tests for a repo, printing output to stdout/stderr
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/ci/ts">
      <code>ts</code>
    </a>
  </dt>
  <dd>
    find the `run_{name}_tests.sh` script in a repo and run it
  </dd>
</dl>
<!-- [[[end]]] (sum: MvYcRvOIeM) -->
