Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Created February 17, 2021 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiejackson/d07104cd4e8d01f539438a9d01dde956 to your computer and use it in GitHub Desktop.
Save jamiejackson/d07104cd4e8d01f539438a9d01dde956 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(UPSTREAM_TRIGGER_JOBS ?: 'some_nonexistent_job_name', 'FAILURE')
}
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