File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This file should be kept in sync with vtools's pre-command file.
4
+ # https://github.com/redpanda-data/vtools/.buildkite/hooks/pre-command
5
+
6
+ set -uo pipefail
7
+ set +e
8
+
9
+ PARALLEL_STEPS=1
10
+
11
+ repo=$( echo $BUILDKITE_REPO | awk -F/ ' {print $NF}' | awk -F. ' {print $1}' )
12
+
13
+ if [[ ${BUILDKITE_PULL_REQUEST} != false ]]; then
14
+ labels=$( curl \
15
+ --retry 3 --retry-connrefused --fail \
16
+ -H " Accept: application/vnd.github.v3+json" \
17
+ -H " Authorization: token ${GITHUB_API_TOKEN} " \
18
+ " https://api.github.com/repos/redpanda-data/${repo} /issues/${BUILDKITE_PULL_REQUEST} /labels" )
19
+
20
+ if [[ $? == " 0" ]]; then
21
+ set -e
22
+ parallel=$( echo " ${labels} " | jq -r ' .[].name|select(startswith("ci-repeat-"))|ltrimstr("ci-repeat-")' | head -1)
23
+ curl \
24
+ -X " DELETE" \
25
+ --retry 3 --retry-connrefused --silent \
26
+ -H " Accept: application/vnd.github.v3+json" \
27
+ -H " Authorization: token ${GITHUB_API_TOKEN} " \
28
+ " https://api.github.com/repos/redpanda-data/${repo} /issues/${BUILDKITE_PULL_REQUEST} /labels/ci-repeat-$parallel "
29
+
30
+ if (( parallel > 1 && parallel < 20 )) ; then
31
+ PARALLEL_STEPS=$parallel
32
+ else
33
+ echo >&2 " Provided parallel number is out of range(2-19). Changing to 1."
34
+ PARALLEL_STEPS=1
35
+ fi
36
+ fi
37
+ fi
38
+
39
+ export PARALLEL_STEPS
Original file line number Diff line number Diff line change 25
25
* .out
26
26
* .app
27
27
/* build *
28
+ ! .buildkite
28
29
/dbuild
29
30
bin
30
31
_e2e_artifacts /
@@ -240,4 +241,4 @@ vbuild/
240
241
# VSCode java settings
241
242
.classpath
242
243
.factorypath
243
- .settings /
244
+ .settings /
You can’t perform that action at this time.
0 commit comments