Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
9ec9a74a
Commit
9ec9a74a
authored
May 31, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
9f4a5c13
1758d8c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
149 deletions
+0
-149
pipeline.yml
ci/pipeline.yml
+0
-95
determine-email-body.sh
ci/scripts/determine-email-body.sh
+0
-46
determine-email-body.yml
ci/tasks/determine-email-body.yml
+0
-8
No files found.
ci/pipeline.yml
View file @
9ec9a74a
...
...
@@ -4,10 +4,6 @@ resource_types:
source
:
repository
:
springio/artifactory-resource
tag
:
0.0.3
-
name
:
email
type
:
docker-image
source
:
repository
:
pcfseceng/email-resource
-
name
:
pull-request
type
:
docker-image
source
:
...
...
@@ -72,16 +68,6 @@ resources:
username
:
((artifactory-username))
password
:
((artifactory-password))
build_name
:
((build-name))
-
name
:
email-notification
type
:
email
source
:
smtp
:
host
:
((email-server))
port
:
"
25"
anonymous
:
true
skip_ssl_validation
:
true
from
:
((email-from))
to
:
((email-to))
-
name
:
repo-status-build
type
:
github-status-resource
source
:
...
...
@@ -153,41 +139,14 @@ jobs:
do
:
-
put
:
repo-status-build
params
:
{
state
:
"
failure"
,
commit
:
"
git-repo"
}
-
task
:
determine-email-body
image
:
spring-boot-ci-image
file
:
git-repo/ci/tasks/determine-email-body.yml
params
:
STATE
:
failure
BUILD_PIPELINE_NAME
:
((pipeline-name))
BUILD_JOB_NAME
:
build
CONCOURSE_URL
:
((concourse-url))
ACCESS_TOKEN
:
((github-access-token))
-
put
:
email-notification
params
:
subject
:
email-details/subject
body
:
email-details/body
-
put
:
slack-alert
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!>"
silent
:
true
icon_emoji
:
"
:concourse:"
username
:
concourse-ci
-
do
:
-
task
:
determine-email-body
image
:
spring-boot-ci-image
file
:
git-repo/ci/tasks/determine-email-body.yml
params
:
STATE
:
success
BUILD_PIPELINE_NAME
:
((pipeline-name))
BUILD_JOB_NAME
:
build
CONCOURSE_URL
:
((concourse-url))
ACCESS_TOKEN
:
((github-access-token))
-
put
:
repo-status-build
params
:
{
state
:
"
success"
,
commit
:
"
git-repo"
}
-
put
:
email-notification
params
:
subject
:
email-details/subject
body
:
email-details/body
-
put
:
slack-alert
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!>"
...
...
@@ -283,41 +242,14 @@ jobs:
do
:
-
put
:
repo-status-jdk9-build
params
:
{
state
:
"
failure"
,
commit
:
"
git-repo"
}
-
task
:
determine-email-body
image
:
spring-boot-jdk9-ci-image
file
:
git-repo/ci/tasks/determine-email-body.yml
params
:
STATE
:
failure
BUILD_PIPELINE_NAME
:
((pipeline-name))
BUILD_JOB_NAME
:
jdk9-build
CONCOURSE_URL
:
((concourse-url))
ACCESS_TOKEN
:
((github-access-token))
-
put
:
email-notification
params
:
subject
:
email-details/subject
body
:
email-details/body
-
put
:
slack-alert
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!>"
silent
:
true
icon_emoji
:
"
:concourse:"
username
:
concourse-ci
-
do
:
-
task
:
determine-email-body
image
:
spring-boot-jdk9-ci-image
file
:
git-repo/ci/tasks/determine-email-body.yml
params
:
STATE
:
success
BUILD_PIPELINE_NAME
:
((pipeline-name))
BUILD_JOB_NAME
:
jdk9-build
CONCOURSE_URL
:
((concourse-url))
ACCESS_TOKEN
:
((github-access-token))
-
put
:
repo-status-jdk9-build
params
:
{
state
:
"
success"
,
commit
:
"
git-repo"
}
-
put
:
email-notification
params
:
subject
:
email-details/subject
body
:
email-details/body
-
put
:
slack-alert
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!>"
...
...
@@ -356,41 +288,14 @@ jobs:
do
:
-
put
:
repo-status-jdk10-build
params
:
{
state
:
"
failure"
,
commit
:
"
git-repo"
}
-
task
:
determine-email-body
image
:
spring-boot-jdk10-ci-image
file
:
git-repo/ci/tasks/determine-email-body.yml
params
:
STATE
:
failure
BUILD_PIPELINE_NAME
:
((pipeline-name))
BUILD_JOB_NAME
:
jdk10-build
CONCOURSE_URL
:
((concourse-url))
ACCESS_TOKEN
:
((github-access-token))
-
put
:
email-notification
params
:
subject
:
email-details/subject
body
:
email-details/body
-
put
:
slack-alert
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!>"
silent
:
true
icon_emoji
:
"
:concourse:"
username
:
concourse-ci
-
do
:
-
task
:
determine-email-body
image
:
spring-boot-jdk10-ci-image
file
:
git-repo/ci/tasks/determine-email-body.yml
params
:
STATE
:
success
BUILD_PIPELINE_NAME
:
((pipeline-name))
BUILD_JOB_NAME
:
jdk10-build
CONCOURSE_URL
:
((concourse-url))
ACCESS_TOKEN
:
((github-access-token))
-
put
:
repo-status-jdk10-build
params
:
{
state
:
"
success"
,
commit
:
"
git-repo"
}
-
put
:
email-notification
params
:
subject
:
email-details/subject
body
:
email-details/body
-
put
:
slack-alert
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!>"
...
...
ci/scripts/determine-email-body.sh
deleted
100755 → 0
View file @
9f4a5c13
#!/bin/bash
set
-e
pushd
git-repo
>
/dev/null
PREV_SHA
=
$(
git rev-parse HEAD^1
)
popd
>
/dev/null
function
getPreviousSha
()
{
pushd
git-repo
>
/dev/null
PREV_SHA
=
$(
git rev-parse
"
$1
"
^1
)
popd
>
/dev/null
echo
"
$PREV_SHA
"
}
function
getPreviousStates
()
{
PREV_STATUSES
=
$(
curl https://api.github.com/repos/spring-projects/spring-boot/commits/
"
$1
"
/statuses
-H
"Authorization: token
${
ACCESS_TOKEN
}
"
)
PREV_STATES
=
$(
echo
"
$PREV_STATUSES
"
| jq
-r
--arg
BUILD_JOB_NAME
"
$BUILD_JOB_NAME
"
'.[] | select(.context == $BUILD_JOB_NAME) | .state'
)
echo
"
$PREV_STATES
"
}
PREV_STATES
=
$(
getPreviousStates
"
$PREV_SHA
"
)
WAS_PREV_SUCCESSFUL
=
$(
echo
"
$PREV_STATES
"
|
grep
'success'
||
true
)
IS_PREV_FAILURE
=
$(
echo
"
$PREV_STATES
"
|
grep
'failure'
||
true
)
while
[[
$WAS_PREV_SUCCESSFUL
==
""
]]
&&
[[
$IS_PREV_FAILURE
==
""
]]
;
do
PREV_SHA
=
$(
getPreviousSha
"
$PREV_SHA
"
)
PREV_STATES
=
$(
getPreviousStates
"
$PREV_SHA
"
)
WAS_PREV_SUCCESSFUL
=
$(
echo
"
$PREV_STATES
"
|
grep
'success'
||
true
)
IS_PREV_FAILURE
=
$(
echo
"
$PREV_STATES
"
|
grep
'failure'
||
true
)
done
if
[[
$STATE
==
"success"
]]
;
then
echo
"Build SUCCESSFUL
${
BUILD_PIPELINE_NAME
}
/
${
BUILD_JOB_NAME
}
"
>
email-details/subject
if
[[
$WAS_PREV_SUCCESSFUL
==
""
]]
;
then
echo
"Build
${
CONCOURSE_URL
}
/teams/spring-boot/pipelines/
${
BUILD_PIPELINE_NAME
}
is successful!"
>
email-details/body
elif
[[
$WAS_PREV_SUCCESSFUL
==
"success"
]]
;
then
touch
email-details/body
fi
elif
[[
$STATE
==
"failure"
]]
;
then
echo
"Build
${
CONCOURSE_URL
}
/teams/spring-boot/pipelines/
${
BUILD_PIPELINE_NAME
}
has failed!"
>
email-details/body
if
[[
$WAS_PREV_SUCCESSFUL
==
""
]]
;
then
echo
"Still FAILING
${
BUILD_PIPELINE_NAME
}
/
${
BUILD_JOB_NAME
}
"
>
email-details/subject
elif
[[
$WAS_PREV_SUCCESSFUL
==
"success"
]]
;
then
echo
"Build FAILURE
${
BUILD_PIPELINE_NAME
}
/
${
BUILD_JOB_NAME
}
"
>
email-details/subject
fi
fi
ci/tasks/determine-email-body.yml
deleted
100644 → 0
View file @
9f4a5c13
---
platform
:
linux
inputs
:
-
name
:
git-repo
outputs
:
-
name
:
email-details
run
:
path
:
git-repo/ci/scripts/determine-email-body.sh
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment