Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35844

(contingency) Provide included Global DSL (global var) for common pipelines

      contingency:: should Jenkinsfile's appear to be too low level for common build tasks, if plumber is not available, we are able to ship some pre-made global libraries for common tasks.

      Including

      • simple notifying via hipchat/slack (without having to write scripts)
      • building inside docker
      • maven build and archive of test results
      • publishing docker images
      • deploying to common targets

      BlueOcean already has a dependency on pipeline, so these can be encapsulated in a plugin and shipped with it.

      How this is done is described here: https://jenkins.io/blog/2016/04/21/dsl-plugins/

      (interested if imeredith has some suggestions of what to include out of the box).

      This helps the UX for new users of Jenkins.
      When a user creates a new pipeline (ie selects a repo) if there is no Jenkinsfile, we can offer these as samples to use.

          [JENKINS-35844] (contingency) Provide included Global DSL (global var) for common pipelines

          Michael Neale added a comment - - edited

          building in a container:

          // this will have stages already built in - no need to specify them:
          containerBuild {
             image = ...
             script = .. 
             hipchat = "room"
             slack = "yeah"
             email = "yeah@bar.com"
             archive = 
             stash = 
             testResults =
             env = [...] 
             branch = /* optionally limit it to a branch */
          }
          

          (could be a variant of simpleBuild) - this takes care of all edge cases, test artifacts,

          This can be used with later stages in jenkins file to publish or deploy the artifacts (up to the user as to where their build puts it in the workspace).

          // just want easier hipchat and slack:
          notifySlack "room" or notifyHipchat "room" or email "address" (no parameters, it will use currentBuild and only do defaults that we think are right)

          archiving test artifacts should be as easy as specifying a path, no $class

          Michael Neale added a comment - - edited building in a container: // this will have stages already built in - no need to specify them: containerBuild { image = ... script = .. hipchat = "room" slack = "yeah" email = "yeah@bar.com" archive = stash = testResults = env = [...] branch = /* optionally limit it to a branch */ } (could be a variant of simpleBuild) - this takes care of all edge cases, test artifacts, This can be used with later stages in jenkins file to publish or deploy the artifacts (up to the user as to where their build puts it in the workspace). // just want easier hipchat and slack: notifySlack "room" or notifyHipchat "room" or email "address" (no parameters, it will use currentBuild and only do defaults that we think are right) archiving test artifacts should be as easy as specifying a path, no $class

            Unassigned Unassigned
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: