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
# If no active branches are found, let's see if it is a feature branch.
45
-
echo"--- :arrow_right: Release Manager only supports the current active branches, skipping"
46
-
echo"BUILDKITE_BRANCH=$BUILDKITE_BRANCH"
47
-
echo"BUILDKITE_COMMIT=$BUILDKITE_COMMIT"
48
-
echo"VERSION=$VERSION"
49
-
echo"Supported branches:"
50
-
cat active-branches.json
51
-
if [[ $BUILDKITE_BRANCH=~"feature/" ]];then
52
-
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'
53
-
dra_command=list
54
-
55
-
# use a different branch since DRA does not support feature branches but main/release branches
56
-
# for such we will use the VERSION and https://storage.googleapis.com/artifacts-api/snapshots/<major.minor>.json
57
-
# to know if the branch was branched out from main or the release branches.
58
-
MAJOR_MINOR=${VERSION%.*}
59
-
if curl -s "https://storage.googleapis.com/artifacts-api/snapshots/main.json"| grep -q "$VERSION";then
60
-
DRA_BRANCH=main
61
-
else
62
-
if curl -s "https://storage.googleapis.com/artifacts-api/snapshots/$MAJOR_MINOR.json"| grep -q "$VERSION";then
63
-
DRA_BRANCH="$MAJOR_MINOR"
64
-
else
65
-
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'
66
-
exit 0
67
-
fi
68
-
fi
69
-
else
70
-
buildkite-agent annotate "${BUILDKITE_BRANCH} is not supported yet. Look for the supported branches in ${BRANCHES_URL}" --style 'warning' --context 'ctx-warn'
71
-
exit 1
72
-
fi
44
+
dra_process_other_branches
73
45
fi
74
46
47
+
echo"--- :arrow_right: Release Manager only supports the current active branches"
48
+
echo"BUILDKITE_BRANCH=$BUILDKITE_BRANCH"
49
+
echo"BUILDKITE_COMMIT=$BUILDKITE_COMMIT"
50
+
echo"VERSION=$VERSION"
51
+
echo"Supported branches:"
52
+
cat active-branches.json
53
+
75
54
dra() {
76
55
local workflow=$1
77
56
local command=$2
78
-
local qualifier=${ELASTIC_QUALIFIER:-""}
57
+
local qualifier=${3:-""}
79
58
echo"--- Run release manager $workflow (DRA command: $command)"
80
59
set -x
81
60
docker run --rm \
@@ -94,32 +73,20 @@ dra() {
94
73
--qualifier "$qualifier" \
95
74
--version $VERSION| tee rm-output.txt
96
75
set +x
97
-
# Create Buildkite annotation similarly done in Beats:
>&2echo"Retry $count/$retries exited $exit, retrying in $wait seconds..."
24
+
sleep $wait
25
+
else
26
+
>&2echo"Retry $count/$retries exited $exit, no more retries left."
27
+
return$exit
28
+
fi
29
+
done
30
+
return 0
31
+
}
32
+
33
+
#
34
+
# An opinionated approach to detect if unsupported Unified Release branches
35
+
# can be used, this is handy for testing feature branches in dry-run mode
36
+
# It produces the below environment variables:
37
+
# - VERSION
38
+
# - DRA_COMMAND
39
+
# - DRA_BRANCH
40
+
dra_process_other_branches() {
41
+
## Read current version without the qualifier
42
+
VERSION=$(make get-version-only)
43
+
DRA_BRANCH="$BUILDKITE_BRANCH"
44
+
if [[ $BUILDKITE_BRANCH=~"feature/" ]];then
45
+
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'
46
+
DRA_COMMAND=list
47
+
48
+
# use a different branch since DRA does not support feature branches but main/release branches
49
+
# for such we will use the VERSION and https://storage.googleapis.com/artifacts-api/snapshots/<major.minor>.json
50
+
# to know if the branch was branched out from main or the release branches.
51
+
MAJOR_MINOR=${VERSION%.*}
52
+
if curl -s "https://storage.googleapis.com/artifacts-api/snapshots/main.json"| grep -q "$VERSION";then
53
+
DRA_BRANCH=main
54
+
else
55
+
if curl -s "https://storage.googleapis.com/artifacts-api/snapshots/$MAJOR_MINOR.json"| grep -q "$VERSION";then
56
+
DRA_BRANCH="$MAJOR_MINOR"
57
+
else
58
+
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'
59
+
fi
60
+
fi
61
+
fi
62
+
export DRA_BRANCH DRA_COMMAND VERSION
63
+
}
64
+
65
+
# Create Buildkite annotation similarly done in Beats:
0 commit comments