diff --git a/vars/jobDraft.groovy b/vars/jobDraft.groovy index b5fd2fd..6b690df 100644 --- a/vars/jobDraft.groovy +++ b/vars/jobDraft.groovy @@ -1,4 +1,5 @@ def create() { + echo "Creating job draft" configFileProvider([configFile(fileId: 'pmd', variable: 'configfile')]) { def config = readJSON(text: readFile(file: configfile)) String PMD = config['pmd_api'] @@ -9,6 +10,7 @@ } def delete() { + echo "Deleting job draft" configFileProvider([configFile(fileId: 'pmd', variable: 'configfile')]) { def config = readJSON(text: readFile(file: configfile)) String PMD = config['pmd_api'] @@ -20,14 +22,18 @@ } def replace() { + echo "Replacing job draft" try { delete() + } catch(e) { + echo "(no job draft to delete)" } finally { create() } } def find() { + echo "Finding job draft" configFileProvider([configFile(fileId: 'pmd', variable: 'configfile')]) { def config = readJSON(text: readFile(file: configfile)) String PMD = config['pmd_api'] @@ -38,6 +44,7 @@ } def publish() { + echo "Publishing job draft" configFileProvider([configFile(fileId: 'pmd', variable: 'configfile')]) { def config = readJSON(text: readFile(file: configfile)) String PMD = config['pmd_api']