Skip to content

Commit b129f3a

Browse files
committed
[ci] split platform sections in slack report script into two parts to avoid hitting the limit of 10 fields in a section
1 parent a51438c commit b129f3a

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

ci/cf_generate_message.sh

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ fi
2121
REPOSITORY_URL="https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
2222
COMMIT_URL="${REPOSITORY_URL}/commit/${CIRCLE_SHA1}"
2323

24-
# Underscores are treated as italic styling and seems to cause an error
25-
export CIRCLE_BRANCH="${CIRCLE_BRANCH//_/\\_}"
26-
2724
BASE_BLOCK=$(cat <<EOF
2825
{
2926
"type": "section",
@@ -55,8 +52,9 @@ if [ "${RESULT_STATUS}" == "failed" ]; then
5552
EOF
5653
)
5754

55+
# Do not add new platforms here, there is a limit of 10 currently, see a block below instead
5856
fields=""
59-
for p in Argon Boron BSoM B5SoM Tracker TrackerM ESomX P2 GCC Newhal P2; do
57+
for p in Argon Boron BSoM B5SoM Tracker TrackerM ESomX P2 GCC Newhal; do
6058
if echo -e "${failures}" | grep -q "PLATFORM=\"${p,,}\""; then
6159
msg=":scrum_closed: $p\\n"
6260
else
@@ -85,6 +83,37 @@ EOF
8583
EOF
8684
)
8785

86+
fields=""
87+
for p in P2; do
88+
if echo -e "${failures}" | grep -q "PLATFORM=\"${p,,}\""; then
89+
msg=":scrum_closed: $p\\n"
90+
else
91+
msg=":scrum_finished: $p\\n"
92+
fi
93+
field=$(cat <<EOF
94+
{
95+
"type": "mrkdwn",
96+
"text": "${msg}"
97+
}
98+
EOF
99+
)
100+
comma=","
101+
if [ "${fields}" == "" ]; then
102+
comma=""
103+
fi
104+
fields="${fields}${comma}${field}"
105+
done
106+
ADDITIONAL_BLOCKS+=$(cat <<EOF
107+
,{
108+
"type": "section",
109+
"fields": [
110+
${fields}
111+
]
112+
}
113+
EOF
114+
)
115+
116+
88117
if [ "${CIRCLE_ARTIFACTS_URL}" == "" ]; then
89118
msg=":scrum_closed: Artifacts"
90119
else

0 commit comments

Comments
 (0)