You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"--- :arrow_right: Release Manager only supports the current active branches, skipping"
35
-
echo"BUILDKITE_BRANCH=$BUILDKITE_BRANCH"
36
-
echo"BUILDKITE_COMMIT=$BUILDKITE_COMMIT"
37
-
echo"VERSION=$VERSION"
38
-
echo"Supported branches:"
39
-
cat active-branches.json
40
-
buildkite-agent annotate "${BUILDKITE_BRANCH} is not supported yet. Look for the supported branches in ${BRANCHES_URL}" --style 'warning' --context 'ctx-warn'
41
-
exit 1
38
+
# If no active branches are found, let's see if it is a feature branch.
39
+
dra_process_other_branches
42
40
fi
43
41
42
+
echo"--- :arrow_right: Release Manager only supports the current active branches"
43
+
echo"BUILDKITE_BRANCH=$BUILDKITE_BRANCH"
44
+
echo"BUILDKITE_COMMIT=$BUILDKITE_COMMIT"
45
+
echo"VERSION=$VERSION"
46
+
echo"Supported branches:"
47
+
cat active-branches.json
48
+
44
49
dra() {
45
50
local workflow=$1
46
-
echo"--- Prepare release manager $workflow"
47
-
.ci/scripts/prepare-release-manager.sh $workflow
48
-
49
-
echo"--- Run release manager $workflow"
51
+
local command=$2
52
+
echo"--- Run release manager $workflow (DRA command: $command)"
>&2echo"Retry $count/$retries exited $exit, retrying in $wait seconds..."
12
+
sleep $wait
13
+
else
14
+
>&2echo"Retry $count/$retries exited $exit, no more retries left."
15
+
return$exit
16
+
fi
17
+
done
18
+
return 0
19
+
}
20
+
21
+
#
22
+
# An opinionated approach to detect if unsupported Unified Release branches
23
+
# can be used, this is handy for testing feature branches in dry-run mode.
24
+
# In addition support for PRs is added by using the base branch of the PR.
25
+
# It produces the below environment variables:
26
+
# - VERSION
27
+
# - DRA_COMMAND
28
+
# - DRA_BRANCH
29
+
dra_process_other_branches() {
30
+
VERSION=$(make get-version)
31
+
DRA_BRANCH="$BUILDKITE_BRANCH"
32
+
if [[ $BUILDKITE_BRANCH=~"feature/" ]];then
33
+
buildkite-agent annotate "${BUILDKITE_BRANCH} will list DRA artifacts. Feature branches are not supported. Look for the supported branches in ${BRANCHES_URL}" --style 'info' --context 'ctx-info'
34
+
DRA_COMMAND=list
35
+
36
+
# use a different branch since DRA does not support feature branches but main/release branches
37
+
# for such we will use the VERSION and https://storage.googleapis.com/artifacts-api/snapshots/<major.minor>.json
38
+
# to know if the branch was branched out from main or the release branches.
39
+
MAJOR_MINOR=${VERSION%.*}
40
+
if curl -s "https://storage.googleapis.com/artifacts-api/snapshots/main.json"| grep -q "$VERSION";then
41
+
DRA_BRANCH=main
42
+
else
43
+
if curl -s "https://storage.googleapis.com/artifacts-api/snapshots/$MAJOR_MINOR.json"| grep -q "$VERSION";then
44
+
DRA_BRANCH="$MAJOR_MINOR"
45
+
else
46
+
buildkite-agent annotate "It was not possible to know the original base branch for ${BUILDKITE_BRANCH}. This won't fail - this is a feature branch." --style 'info' --context 'ctx-info-feature-branch'
0 commit comments