Skip to content

Commit

Permalink
[ci] split platform sections in slack report script into two parts to…
Browse files Browse the repository at this point in the history
… avoid hitting the limit of 10 fields in a section
  • Loading branch information
avtolstoy committed Oct 23, 2022
1 parent fb4a9c3 commit accacb4
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions ci/cf_generate_message.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ fi
REPOSITORY_URL="https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
COMMIT_URL="${REPOSITORY_URL}/commit/${CIRCLE_SHA1}"

# Underscores are treated as italic styling and seems to cause an error
export CIRCLE_BRANCH="${CIRCLE_BRANCH//_/\\_}"

BASE_BLOCK=$(cat <<EOF
{
"type": "section",
Expand Down Expand Up @@ -55,8 +52,9 @@ if [ "${RESULT_STATUS}" == "failed" ]; then
EOF
)

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

fields=""
for p in P2; do
if echo -e "${failures}" | grep -q "PLATFORM=\"${p,,}\""; then
msg=":scrum_closed: $p\\n"
else
msg=":scrum_finished: $p\\n"
fi
field=$(cat <<EOF
{
"type": "mrkdwn",
"text": "${msg}"
}
EOF
)
comma=","
if [ "${fields}" == "" ]; then
comma=""
fi
fields="${fields}${comma}${field}"
done
ADDITIONAL_BLOCKS+=$(cat <<EOF
,{
"type": "section",
"fields": [
${fields}
]
}
EOF
)


if [ "${CIRCLE_ARTIFACTS_URL}" == "" ]; then
msg=":scrum_closed: Artifacts"
else
Expand Down

0 comments on commit accacb4

Please sign in to comment.