mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 07:45:49 +00:00
Jenkins: Set build description
Write info about gitOps commit into build description in order to show more transparently what was done.
This commit is contained in:
parent
9963f6307d
commit
113ca53c02
1 changed files with 18 additions and 1 deletions
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
|
@ -77,7 +77,8 @@ node {
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
pushToConfigRepo(gitopsConfig)
|
String pushedChanges = pushToConfigRepo(gitopsConfig)
|
||||||
|
currentBuild.description = createBuildDescription(pushedChanges, imageName)
|
||||||
} else {
|
} else {
|
||||||
echo 'Skipping deploy, because build not successful'
|
echo 'Skipping deploy, because build not successful'
|
||||||
}
|
}
|
||||||
|
@ -217,6 +218,22 @@ void createPullRequest(Map gitopsConfig) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String createBuildDescription(String pushedChanges, String imageName) {
|
||||||
|
String description = ''
|
||||||
|
|
||||||
|
description += "GitOps commits: "
|
||||||
|
|
||||||
|
if (pushedChanges) {
|
||||||
|
description += pushedChanges
|
||||||
|
} else {
|
||||||
|
description += 'No changes'
|
||||||
|
}
|
||||||
|
|
||||||
|
description += "\nImage: ${imageName}"
|
||||||
|
|
||||||
|
return description
|
||||||
|
}
|
||||||
|
|
||||||
/** Queries and stores info about current repo and HEAD commit */
|
/** Queries and stores info about current repo and HEAD commit */
|
||||||
class GitRepo {
|
class GitRepo {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue