Job-Specification

---
key: good-to-merge
name: Good To Merge
context:
  tasks:
    git-submodules-merged:
      key: git-submodules-merged
      name: Git submodules are all merged to origin/master
      traits: {}
      scripts:
        test:
          body: |-
            #!/usr/bin/env bash
            set -eu

            # checks if the commits referenced by submodules are included in their 'master'

            # make sure all submodules are checked out
            # WARNING: test is false-positive without this:
            git fetch --all 1>&2 # print stdout to stderr
            git submodule update --init --recursive 1>&2

            git submodule foreach --recursive \
              'git fetch --all > /dev/null && git rev-list origin/master -- | grep -q "^$(git rev-parse HEAD)$"'

            echo "OK"
    all relevant tests have passed:
      key: all relevant tests have passed
      name: All relevant tests have passed, thus good to merge
      traits: {}
      scripts:
        main:
          body: echo 'All relevant tests have passed' ; exit 0
  task_defaults:
    traits: {}
    max_trials: 1
run_when:
  meta checks have passed:
    type: job
    states:
    - passed
    job_key: meta
  legacy submodule have passed:
    type: job
    states:
    - passed
    job_key: good-to-merge
    submodule:
    - legacy
  deploy to demo was successful:
    type: job
    states:
    - passed
    job_key: deploy-to-demo
  deploy to test was successful:
    type: job
    states:
    - passed
    job_key: deploy-to-test
  deploy to container was successful:
    type: job
    states:
    - passed
    job_key: test-container-deploy
depends_on:
  meta checks have passed:
    type: job
    states:
    - passed
    job_key: meta
  legacy submodule have passed:
    type: job
    states:
    - passed
    job_key: good-to-merge
    submodule:
    - legacy
  deploy to demo was successful:
    type: job
    states:
    - passed
    job_key: deploy-to-zhdk-leihs-demo
  deploy to test was successful:
    type: job
    states:
    - passed
    job_key: deploy-to-zhdk-leihs-test
  deploy to container was successful:
    type: job
    states:
    - passed
    job_key: test-container-deploy
description: |
  This job depends on all other tests and checks
  and it will pass if and only if all dependencies have passed.
  Status of this job is **used by github's "branch protection"**!