Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Created February 17, 2021 22:35
Show Gist options
  • Save jamiejackson/03b8c7098129cd5931de31fa63c93509 to your computer and use it in GitHub Desktop.
Save jamiejackson/03b8c7098129cd5931de31fa63c93509 to your computer and use it in GitHub Desktop.
pipelineJob("E2E Tests ${JOB_NAME_SUFFIX}") {
description("")
keepDependencies(false)
parameters {
wHideParameterDefinition {
name('AGENT')
defaultValue("${AGENT}")
description('Node on which to run.')
}
wHideParameterDefinition {
name('BRANCH_NAME')
defaultValue("${BRANCH_NAME}")
description('SCM branch')
}
stringParam(
"E2E_TEST_TAGS",
"${E2E_TEST_TAGS}",
'Cucumber tags.\nNote: Try the following to do an abbreviated test run:\n@single-example'
)
wHideParameterDefinition {
name('ENV_NAME')
defaultValue("${ENV_NAME}")
description('Environment Name')
}
wHideParameterDefinition {
name('CRON_SCHEDULE')
defaultValue("${CRON_SCHEDULE}")
description('Schedule, in cron format.')
}
wHideParameterDefinition {
name('SITE_DOMAIN')
defaultValue("${SITE_DOMAIN}")
description('Site domain to test.')
}
}
triggers {
// noon, eastern
cron('TZ=America/New_York' + "\n" + CRON_SCHEDULE)
// watch other jobs and trigger this job when one of those jobs completes
// upstream(upstreamProjects: 'job1,job2', threshold: hudson.model.Result.SUCCESS)
upstream(upstreamProjects: 'Deploy Local2 Stack', threshold: hudson.model.Result.SUCCESS)
}
definition {
cpsScm {
scm {
git {
remote {
url("https://myrepo/_git/hudx")
credentials("scm")
}
// TODO: I would prefer this kind of thing, so the param
// is optional, but it doesn't work:
// branch( params.containsKey('BRANCH_NAME') ? params.BRANCH_NAME : "env/${ENV_NAME}" )
branch( BRANCH_NAME )
}
}
scriptPath("cfml/deployment_root/test/e2e/Jenkinsfile")
}
}
disabled(false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment