Skip to content

Commit

Permalink
Pre-check stage to verify job params
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mmili committed Jan 28, 2023
1 parent d6230e3 commit 0ae4331
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Jenkinsfile.export
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ pipeline {
string defaultValue: '', description: 'Grafana api key id', name: 'grafanaCredentials', trim: true
}
stages {
stage('Pre-check') {
agent any
when {
anyOf {
equals expected: '', actual: gitUrl
equals expected: '', actual: gitBranch
equals expected: '', actual: gitCredentials
equals expected: '', actual: gitUserEmail
equals expected: '', actual: gitUserName
equals expected: '', actual: grafanaUrl
}
}
steps {
error 'One or more of the required job parameters is empty.'
}
post {
cleanup {
cleanWs()
}
}
}
stage('Export') {
agent {
dockerfile {
Expand Down
20 changes: 20 additions & 0 deletions Jenkinsfile.import
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ pipeline {
string defaultValue: '', description: 'Grafana api key id', name: 'grafanaCredentials', trim: true
}
stages {
stage('Pre-check') {
agent any
when {
anyOf {
equals expected: '', actual: grafanaDashboards
equals expected: '', actual: gitUrl
equals expected: '', actual: gitBranch
equals expected: '', actual: gitCredentials
equals expected: '', actual: grafanaUrl
}
}
steps {
error 'One or more of the required job parameters is empty.'
}
post {
cleanup {
cleanWs()
}
}
}
stage('Import') {
agent {
dockerfile true
Expand Down

0 comments on commit 0ae4331

Please sign in to comment.