0

I have a JavaScript repo with some JavaScript code & relevant tests.

On push to the default branch, the JavaScript is compiled and deployed to our CDN using a Jenkins, and configured using a Jenkinsfile.

We also have e2e tests in the same repo that we'd like to run nightly.

Is it possible to have two Jenkins Jobs declared from the same repo. One that triggers on push and builds and deploys code, and the other that is triggered from a CRON job that runs e2e tests on the production code nightly.

Thanks, George

George Kemp
  • 541
  • 1
  • 7
  • 21

1 Answers1

0

Yes, that's absolutely possible and also depending a lot on the details. Generally you would:

  • Hook up the first Job with some sort of git hook. We use the generic webhook plugin, but you can also use a Github/Bitbucket pipeline (again, depending on the details of your situation)
  • Don't put said webhook on the second job, but simply schedule it for every night. How do I schedule jobs in Jenkins?
  • You can use different Jenkinsfiles for the two of them in order to separate them
smelm
  • 1,253
  • 7
  • 14