<commit_before>#!/bin/bash
set -u

DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)

if [[ $DIVERGED -eq 0 ]]; then
  if [[ $BUILDKITE_TAG == "" ]]; then
    if [[ $BUILDKITE_BRANCH == "master" ]]; then
      CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
    else
      CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
    fi
  else
    CI_BYPASS="false"
  fi
else
  CI_BYPASS="false"
fi

cat << EOF
env:
  CI_BYPASS: ${CI_BYPASS}

steps:
  - label: ":docker: Image Deployments"
    command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
    concurrency: 1
    concurrency_group: "deployments"
    if: build.branch == "master" && build.env("CI_BYPASS") != "true"

  - label: ":docker: Image Deployments"
    command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
    if: build.branch != "master" && build.env("CI_BYPASS") != "true"

  - wait:
    if: build.env("CI_BYPASS") != "true"

  - label: ":docker: Deploy Manifests"
    command: "authelia-scripts docker push-manifest"
    concurrency: 1
    concurrency_group: "deployments"
    env:
      DOCKER_CLI_EXPERIMENTAL: "enabled"
    if: build.branch == "master" && build.env("CI_BYPASS") != "true"

  - label: ":docker: Deploy Manifests"
    command: "authelia-scripts docker push-manifest"
    env:
      DOCKER_CLI_EXPERIMENTAL: "enabled"
    if: build.branch != "master" && build.env("CI_BYPASS") != "true"

  - label: ":github: Deploy Artifacts"
    command: "ghartifacts.sh"
    depends_on: ~
    retry:
      automatic: true
    agents:
      upload: "fast"
    key: "artifacts"
    if: build.tag != null

  - label: ":linux: Deploy AUR"
    command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload"
    concurrency: 1
    concurrency_group: "aur"
    depends_on: ~
    if: build.tag != null || build.branch == "master" && build.env("CI_BYPASS") != "true"

  - label: ":book: Deploy Documentation"
    command: "syncdoc.sh"
    concurrency: 1
    concurrency_group: "documentation"
    depends_on: ~
    agents:
      upload: "fast"
    if: build.branch == "master"
EOF<commit_msg>[CI] Set concurrency groups at a global level and simplify pipeline (#942)<commit_after>#!/bin/bash
set -u

DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)

if [[ $DIVERGED -eq 0 ]]; then
  if [[ $BUILDKITE_TAG == "" ]]; then
    if [[ $BUILDKITE_BRANCH == "master" ]]; then
      CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
    else
      CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
    fi
  else
    CI_BYPASS="false"
  fi
else
  CI_BYPASS="false"
fi

cat << EOF
env:
  CI_BYPASS: ${CI_BYPASS}

steps:
  - label: ":docker: Image Deployments"
    command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
    if: build.env("CI_BYPASS") != "true"

  - wait:
    if: build.env("CI_BYPASS") != "true"

  - label: ":docker: Deploy Manifests"
    command: "authelia-scripts docker push-manifest"
    env:
      DOCKER_CLI_EXPERIMENTAL: "enabled"
    if: build.env("CI_BYPASS") != "true"

  - label: ":github: Deploy Artifacts"
    command: "ghartifacts.sh"
    depends_on: ~
    retry:
      automatic: true
    agents:
      upload: "fast"
    key: "artifacts"
    if: build.tag != null

  - label: ":linux: Deploy AUR"
    command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload"
    depends_on: ~
    if: build.tag != null || build.branch == "master" && build.env("CI_BYPASS") != "true"

  - label: ":book: Deploy Documentation"
    command: "syncdoc.sh"
    depends_on: ~
    agents:
      upload: "fast"
    if: build.branch == "master"
EOF
{'fraction_non_alphanumeric': 0.16450110321157146, 'fraction_numerical': 0.003677371904878647, 'mean_word_length': 3.241164241164241, 'pattern_counts': {'":': 12, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1968648', 'n_tokens_mistral': 1541, 'n_tokens_neox': 1473, 'n_words': 338}