diff --git a/vars/compileDoc.groovy b/vars/compileDoc.groovy index d566ff5..e499aa5 100644 --- a/vars/compileDoc.groovy +++ b/vars/compileDoc.groovy @@ -1,6 +1,8 @@ // Pipeline de construction des images Docker des services Zéphir def call() { def buildTag + def gitEmail = params.gitEmail ? params.gitEmail : 'jenkins@cadoles.com' + def gitUsername = params.gitUsername ? params.gitUsername : 'Jenkins' pipeline { @@ -106,6 +108,9 @@ def call() { def projectName = env.project_name def destFolder = "${projectName}/${docProfile}" def result = tamarin.compileDoc(env.buildProfile) + if(result.size() == 0) { + error('No artefact produced') + } println(result) if(docProfile != 'draft') { def publicFolder = "${destFolder}/latest/public" @@ -160,6 +165,10 @@ def call() { sh(script: "chmod +x ./sshForJenkins.sh") if (docProfile != 'draft') { withEnv(["GIT_SSH=./sshForJenkins.sh"]) { + // Add git username/email + sh("git config user.email '${gitEmail}'") + sh("git config user.username '${gitUsername}'") + sh """ git tag -am "paquet" release/v${dateTag} """ @@ -169,6 +178,10 @@ def call() { } } withEnv(["GIT_SSH=./sshForJenkins.sh"]) { + // Add git username/email + sh("git config user.email '${gitEmail}'") + sh("git config user.username '${gitUsername}'") + sh """ git tag -d ${env.ref} git push origin :${env.ref}