Skip to content

Version 3

Compare
Choose a tag to compare
@bsquizz bsquizz released this 07 Nov 16:10
· 385 commits to master since this release
a75ad8b
  • Consolidating many methods into namespaces grouped according to a common "theme"
  • Cleaning up the code to improve readability, sticking to 100char line length
  • Adding more comments/doc strings to improve understanding of how all this works :)

Given significant breaking changes this will introduce on pipelines, this will be released as v3.0

The methods have been re-worked into different namespaces. Here is the breakdown of what has changed:

The new namespaces of the library are:

  • deployUtils -- helpers for dealing with e2e-deploy/ocdeployer/skopeo
  • execDeployPipeline -- "executes" a deployment pipeline
  • execSmokeTest -- "executes" a smoke test pipeline
  • gitUtils -- helpers for dealing with git / github
  • openShiftUtils -- helpers for dealing w/ openshift and jenkins slaves on openshift
  • pipelineUtils -- helpers for general pipeline code efficiency/flow control
  • pipelineVars -- unchanged
  • pythonUtils -- helpers for common python pipeline tasks
  • rubyUtils -- helpers for common ruby pipeline tasks
  • slackUtils -- helpers for dealing with slack

Added new methods:

  • pipelineUtils.stageIf()
  • pipelineUtils.runGroupedTasks()

Fixed bugs and potential pitfalls related to using script binding variables (i.e. defining a top-level variable without def or @Field def in a groovy script)

Methods have been re-arranged/re-named in the following way:

  • cancelPriorBuilds -> pipelineUtils.cancelPriorBuilds
  • changedFiles -> gitUtils.getFilesChanged
  • checkCoverage -> pythonUtils.checkCoverage
  • checkOutRepo -> gitUtils.checkOutRepo
  • deployHelpers -> deployUtils
  • deployService removed, not used anywhere
  • deployServiceSet -> deployUtils.deployServiceSet
  • deploymentPipeline -> execDeployPipeline
  • getFilesChanged -> gitUtils.getFilesChanged
  • ghNotify -> gitUtils.ghNotify
  • openShift -> openShiftUtils (was confusing since OpenShift plugin uses openshift)
  • pipelineVars.defaultUICloud -> pipelineVars.upshiftCloud
  • pipelineVars.defaultUINameSpace -> pipelineVars.upshiftNameSpace
  • pipfileComment.post -> pythonUtils.postPipfileComment
  • pipfileComment.removeAll -> pythonUtils.removePipfileComments
  • promoteImages -> deployUtils.promoteImages
  • runBundleInstall -> rubyUtils.runBundleInstall
  • runIfMasterOrPullReq -> pipelineUtils.runIfMasterOrPullReq
  • runParallel -> pipelineUtils.runParallel
  • runPipenvInstall -> pythonUtils.runPipenvInstall
  • runPythonLintCheck -> pythonUtils.runLintCheck
  • runSmokeTest -> execSmokeTest
  • slackNotify -> slack.sendMsg
  • stageWithContext -> gitUtils.stageWithContext
  • triggeredByComment -> pipelineUtils.triggeredByComment
  • waitForDeployment -> deployUtils.waitForDeployment
  • withStatusContext.lint -> gitUtils.withStatusContext("lint")
  • withStatusContext.unitTest -> gitUtils.withStatusContext("unittest")
  • withStatusContext.integrationTest -> gitUtils.withStatusContext("integrationtest")
  • withStatusContext.coverage -> gitUtils.withStatusContext("coverage")
  • withStatusContext.pipInstall -> gitUtils.withStatusContext("pipinstall")
  • withStatusContext.bundleInstall -> gitUtils.withStatusContext("bundleinstall")
  • withStatusContext.swagger -> gitUtils.withStatusContext("swagger")
  • withStatusContext.smoke -> gitUtils.withStatusContext("smoke")
  • withStatusContext.dbMigrate -> gitUtils.withStatusContext("dbmigrate")
  • withStatusContext.artifacts -> gitUtils.withStatusContext("artifacts")
  • withStatusContext.waitForFrontend -> gitUtils.withStatusContext("waitforfrontend")
  • withStatusContext.custom(String s) -> gitUtils.withStatusContext(String s)

The context strings that were previously used by withStatusContext were removed from pipelineVars in favor of simply passing in the string in your pipeline.

convert-to-v3.py can be used to update a Jenkinsfile that was using <v3.0 methods to the new syntax.