Skip to content

Commit

Permalink
package trigger: print build url only if there are triggered branches
Browse files Browse the repository at this point in the history
  • Loading branch information
aptalca committed Oct 6, 2024
1 parent e2790bd commit 19403c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions roles/generate-jenkins/templates/PACKAGE_TRIGGER_SCHEDULER.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ jobs:
if [[ -n "${triggered_branches}" ]] || [[ -n "${skipped_branches}" ]]; then
if [[ -n "${triggered_branches}" ]]; then
NOTIFY_BRANCHES="**Triggered:** ${triggered_branches} \n"
NOTIFY_BUILD_URL="**Build URL:** {{ lsio_ci_url }}/blue/organizations/jenkins/Docker-Pipeline-Builders%2F{{ project_repo_name }}/activity/ \n"
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
fi
if [[ -n "${skipped_branches}" ]]; then
NOTIFY_BRANCHES="${NOTIFY_BRANCHES}**Skipped:** ${skipped_branches} \n"
fi
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
echo "**** Notifying Discord ****"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Package Check Build(s) Triggered for {{ project_name }}** \n'"${NOTIFY_BRANCHES}"'**Build URL:** '"{{ lsio_ci_url }}/blue/organizations/jenkins/Docker-Pipeline-Builders%2F{{ project_repo_name }}/activity/"' \n"}],
"description": "**Package Check Build(s) for {{ project_name }}** \n'"${NOTIFY_BRANCHES}"''"${NOTIFY_BUILD_URL}"'"}],
"username": "Github Actions"}' ${{ '{{' }} secrets.DISCORD_WEBHOOK {{ '}}' }}
fi

0 comments on commit 19403c7

Please sign in to comment.