Skip to content

Instantly share code, notes, and snippets.

@frezbo
Created June 6, 2017 07:56
Show Gist options
  • Save frezbo/df13e0012037dfa4befab967e9887501 to your computer and use it in GitHub Desktop.
Save frezbo/df13e0012037dfa4befab967e9887501 to your computer and use it in GitHub Desktop.
Jenkinsfile test
def set_job_properties() {
properties([
[
$class: 'BuildDiscarderProperty',
strategy: [
$class: 'BuildRotator',
daysToKeep: 5,
numToKeep: 10,
artifactsDaysToKeep: 5,
artifactsNumToKeep: 10
]
],
[
$class: 'org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty',
triggers: [
$class: 'org.jenkinsci.plugins.ghprb.GhprbTrigger',
cron: '',
triggerPhase: 'ReBuild',
useGitHubHooks: true,
autoCloseFailedPullRequests: true,
msgSuccess: 'Passed',
msgFailure: 'Failed',
commitStatusContext: 'New Hello',
whiteListTargetBranches: [
$class: 'org.jenkinsci.plugins.ghprb.GhprbBranch',
branch: 'master'
]
]
]
// pipelineTriggers([
// [
// $class: 'org.jenkinsci.plugins.ghprb.GhprbTrigger',
// cron: '',
// triggerPhase: 'ReBuild',
// useGitHubHooks: true,
// autoCloseFailedPullRequests: true,
// msgSuccess: 'Passed',
// msgFailure: 'Failed',
// commitStatusContext: 'New Hello',
// gitHubAuthId: 'b7ab205a-1d7c-4d9f-a7f8-60f65fc437d0',
// whiteListTargetBranches: [
// $class: 'org.jenkinsci.plugins.ghprb.GhprbBranch',
// branch: 'master'
// ]
// ]
// ])
])
}
pipeline {
agent {
node {
label 'master'
}
}
stages {
stage('Prepare') {
steps {
script {
def artifactDownloadURL = "hello"
echo "${artifactDownloadURL}"
}
set_job_properties()
echo "${BUILD_NUMBER}"
sh "env"
}
}
}
post {
always {
deleteDir()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment