// Test commit to play with for testing - need to override this for local testing set up since GHE isn't conigured here
// This can be any arbitrary commit (as long as the credentialsId has permission to view)
// https://git.xarth.tv/flexo/simpletest2/commits/ca78e3bfd5227faea77cd7005169a911f58f086a
def githubApiEndpoint = 'https://git.xarth.tv/api/v3/repos/flexo/simpletest2/statuses/ca78e3bfd5227faea77cd7005169a911f58f086a'

pipeline {
  agent any
  stages {
    stage('test') {
      steps {
        setBuildStatusPending(debug: true,
          description: 'FlexoTest: pending',
          githubApiEndpoint: githubApiEndpoint,
          credentialsId: 'flexo-org-service_pat'
        )
        echo 'This is a test!'
      }
      post {
        success {
          setBuildStatusSuccess(debug: true,
            description: 'FlexoTest: success',
            githubApiEndpoint: githubApiEndpoint,
            credentialsId: 'flexo-org-service_pat'
          )
        }
        failure {
          setBuildStatusFailure(debug: true,
            description: 'FlexoTest: failure',
            githubApiEndpoint: githubApiEndpoint,
            credentialsId: 'flexo-org-service_pat'
          )
        }
      }
    }
  }
}
