echo repo url

This commit is contained in:
Robert Schumann 2021-12-10 22:08:06 +01:00
parent 28e21af0f5
commit 3da8a5ff63

9
Jenkinsfile vendored
View File

@ -11,12 +11,12 @@ properties([
node { node {
try { try {
setBuildStatus('build started', 'PENDING') setBuildStatus('In progress...', 'PENDING')
pipeline() pipeline()
setBuildStatus('build succeeded', 'SUCCESS') setBuildStatus('Success', 'SUCCESS')
} }
catch(e) { catch(e) {
setBuildStatus('build failed', 'FAILURE') setBuildStatus(e.take(140), 'FAILURE')
throw e throw e
} }
finally { finally {
@ -24,6 +24,8 @@ node {
} }
} }
// --- helper functions ---
def pipeline() { def pipeline() {
stage('checkout') { stage('checkout') {
checkout scm checkout scm
@ -58,6 +60,7 @@ def cleanup() {
void setBuildStatus(message, state) { void setBuildStatus(message, state) {
def repoUrl = sh(script: 'git config --get remote.origin.url', returnStdout: true).trim() def repoUrl = sh(script: 'git config --get remote.origin.url', returnStdout: true).trim()
echo repoUrl
step([ step([
$class: "GitHubCommitStatusSetter", $class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl], reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl],