Skip to content

Commit

Permalink
jenkins-validate
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnerWill committed Oct 8, 2024
1 parent 084c910 commit 798378a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

function jenkins-validate(){
## Define input file
local jenkins_file="${1:-Jenkinsfile}"

## Check if all required variables are set
[[ -z "${JENKINS_AUTH}" ]] && printf "JENKINS_AUTH is not defined\n" && return 1
[[ -z "${JENKINS_URL}" ]] && printf "JENKINS_URL is not defined\n" && return 1
local jenkins_file="${1:-Jenkinsfile}"

## Check if Jenkinsfile exists
[[ -f "${jenkins_file}" ]] || printf "Cannot find Jenkinsfile: %s\n" "${jenkins_file}" || return 1

## Check if all required variables are set
[[ -z "${JENKINS_AUTH}" ]] && printf "JENKINS_AUTH is not defined\n" && return 1
[[ -z "${JENKINS_URL}" ]] && printf "JENKINS_URL is not defined\n" && return 1

## These instructions assume that the security realm of Jenkins is something other than "None" and you have an account.
## JENKINS_URL=[root URL of Jenkins controller]
## JENKINS_AUTH=[your Jenkins username and an API token in the following format: your_username:api_token]
Expand Down

0 comments on commit 798378a

Please sign in to comment.