Jenkins



Creating a Pipeline

Single Github Repository

  • Create Pipeline (Jenkins) - Create a new pipeline, follow the steps to link it with your repository

    • Github Repo - create a github token with all the flags for handling branches, PR’s etc

  • Create CI/CD Script (Github) - add a JenkinsFile in the root of your repository (Q: can it be elsewhere?)

pipeline { agent any options { skipStagesAfterUnstable() } stages { stage('Build') { steps { echo 'Build' } } stage('Test'){ steps { echo 'Testing' } } stage('Deploy') { steps { echo 'Deploy' } } } }

At this point, you’ll have a pipeline you can trigger manually from Jenkins. It’ll additionally add reports, with links in the PR’s. You’ll need

  • Event-Based Triggers (Github) - add a webhook for your jenkins pipeline so that you can receive github events (no need to manually scan for commits/branches/PRs)

    • Internet Accessible - TODO

    • Localhost & Firewalled - TODO (perhaps use ngrok, see here)

  • Periodic Triggers (Jenkins) - configure your pipeline to periodically scan if you can’t receive automatic events

  • Jenkins access for all repo users?

  • Jenkins behind a firewall?