blob: 5eda35c173457383daf7ab7fa607de079cf85484 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/usr/bin/env bash
set -u
DIRECTORY="unset"
GROUP="unset"
PREFIX="authelia/"
TAG="unset"
if [[ "${BUILDKITE_BRANCH}" =~ ^renovate/ ]]; then
TAG="renovate"
elif [[ "${BUILDKITE_BRANCH}" != "master" ]] && [[ ! "${BUILDKITE_BRANCH}" =~ .*:.* ]]; then
TAG="${BUILDKITE_BRANCH}"
elif [[ "${BUILDKITE_BRANCH}" != "master" ]] && [[ "${BUILDKITE_BRANCH}" =~ .*:.* ]]; then
TAG="PR${BUILDKITE_PULL_REQUEST}"
elif [[ "${BUILDKITE_BRANCH}" == "master" ]] && [[ "${BUILDKITE_PULL_REQUEST}" == "false" ]]; then
TAG="latest"
fi
if [[ "${BUILDKITE_PIPELINE_NAME}" == "integration-duo" ]]; then
DIRECTORY="internal/suites/example/compose/duo-api"
GROUP="duo-deployments"
elif [[ "${BUILDKITE_PIPELINE_NAME}" == "integration-haproxy" ]]; then
DIRECTORY="internal/suites/example/compose/haproxy"
GROUP="haproxy-deployments"
elif [[ "${BUILDKITE_PIPELINE_NAME}" == "integration-samba" ]]; then
DIRECTORY="internal/suites/example/compose/samba"
GROUP="samba-deployments"
fi
cat << EOF
steps:
- label: ":docker: Build and Deploy"
commands:
- "cd ${DIRECTORY}"
- "docker build --tag ${PREFIX}${BUILDKITE_PIPELINE_NAME}:${TAG} --platform linux/amd64 --provenance mode=max,reproducible=true --sbom true --builder buildx --pull --push ."
concurrency: 1
concurrency_group: "${GROUP}"
agents:
upload: "fast"
EOF
|