Skip to content

Instantly share code, notes, and snippets.

@christianchristensen
Last active February 2, 2017 18:05
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianchristensen/5519757 to your computer and use it in GitHub Desktop.
Save christianchristensen/5519757 to your computer and use it in GitHub Desktop.
.jenkins.yml research and thoughts

.jenkins.yml

Build configuration(s) closer to code; inspired by .travis.yml

  • Default yaml file to define a build that runs make test
  • Preserves No State Between Builds (runs all commands over SSH in isolated virtual machines)
  • The standard Unix exit code of "0" means the build passed; everything else is treated as failure.
  • Specify branches to build (whitelist, blacklist)
  • Secure environment variables (keys, configuration, ...)

(This could dovetail nicely into a combined project (esp. the build matrix and configuration concepts): .ci.yml)

Jenkins management

(Note: this is in the "flavor" of Jenkins+Github APIs, although ostensibly any VCS+hooks should be compatible)

  • Job creation (identified by the existence .jenkins.yml)
  • Hook (github api) integration
    • Push/PR status (see: ghprb)
    • Authorized users/contributors (repo admins/teams)
      • Linking the Jenkins user into the repo processes
    • github-webhook + Git plugin Service configuration
    • Github enterprise custom page link
  • Environment vars (see: Travis CI environment)
  • Notifications (configure existing methods through github API; see: Travis CI notifications)
    • IRC
    • email
    • webhook (ideal for pass = build package/next "build" step)
  • Expose "embeddable" status information from a specific build (see: Embeddable build status) (Note: howto differentiate PR fail vs. master branch fail?)

Jenkins job copy/create/update recipe

(See: Jenkins CLI)

Template .jenkins/jobs/<job name>/config.xml to use with CLI create-job, update-job (, get-job ?)

  • XML template items (per job/repo)
    • description
    • displayName
    • ...GithubProjectProperty:projectUrl
    • scm...GitSCM:url
    • browser...GithubWeb:url
  • Configure Github hooks in Jenkins
    • $JENKINS_URL/ghprbhook
    • $JENKINS_URL/github-webhook

Research

@vassilevsky
Copy link

This is a great idea!

@vassilevsky
Copy link

@christianchristensen
Copy link
Author

@vassilevsky Thanks for the xref that looks nice!

@bersace
Copy link

bersace commented Feb 2, 2017

Hi, did you have a look at https://github.com/novafloss/jenkins-epo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment