Add build scan URI to Slack notifications from CI

Fixes gh-19703
pull/20907/head
Scott Frederick 5 years ago
parent 8e695b0cc5
commit 9aae072872

@ -276,7 +276,11 @@ jobs:
params: { state: "failure", commit: "git-repo" } params: { state: "failure", commit: "git-repo" }
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>" text: >
:concourse-failed: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
@ -302,13 +306,19 @@ jobs:
do: do:
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>" text: >
:concourse-failed: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-succeeded: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!>" text: >
:concourse-succeeded: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
@ -366,7 +376,11 @@ jobs:
params: { state: "failure", commit: "git-repo" } params: { state: "failure", commit: "git-repo" }
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>" text: >
:concourse-failed: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
@ -374,7 +388,11 @@ jobs:
params: { state: "success", commit: "git-repo" } params: { state: "success", commit: "git-repo" }
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-succeeded: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!>" text: >
:concourse-succeeded: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
@ -404,7 +422,11 @@ jobs:
params: { state: "failure", commit: "git-repo" } params: { state: "failure", commit: "git-repo" }
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>" text: >
:concourse-failed: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
@ -412,7 +434,11 @@ jobs:
params: { state: "success", commit: "git-repo" } params: { state: "success", commit: "git-repo" }
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-succeeded: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!>" text: >
:concourse-succeeded: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
@ -439,13 +465,21 @@ jobs:
do: do:
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>" text: >
:concourse-failed: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
- put: slack-alert - put: slack-alert
params: params:
text: ":concourse-succeeded: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!>" text: >
:concourse-succeeded: ${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!
[<https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|build log>]
[<$TEXT_FILE_CONTENT|build scan>]
text_file: git-repo/build/build-scan-uri.txt
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci

@ -4,6 +4,7 @@ inputs:
- name: git-repo - name: git-repo
outputs: outputs:
- name: distribution-repository - name: distribution-repository
- name: git-repo
caches: caches:
- path: gradle - path: gradle
- path: embedmongo - path: embedmongo

@ -34,6 +34,13 @@ settings.gradle.projectsLoaded {
if (settings.gradle.rootProject.hasProperty('buildJavaHome')) { if (settings.gradle.rootProject.hasProperty('buildJavaHome')) {
value('Build Java home', settings.gradle.rootProject.getProperty('buildJavaHome')) value('Build Java home', settings.gradle.rootProject.getProperty('buildJavaHome'))
} }
settings.gradle.rootProject.getBuildDir().mkdirs()
new File(settings.gradle.rootProject.getBuildDir(), "build-scan-uri.txt").text = "(build scan not generated)"
buildScanPublished { scan ->
new File(settings.gradle.rootProject.getBuildDir(), "build-scan-uri.txt").text = "${scan.buildScanUri}\n"
}
} }
} }
} }

Loading…
Cancel
Save