griddynamics / mpl

[IT-36925] Jenkins Shared Modular Pipeline Library
https://blog.griddynamics.com/developing-a-modular-pipeline-library-to-improve-devops-collaboration/
Apache License 2.0
158 stars 97 forks source link

Virtual modules #9

Open sparshev opened 6 years ago

sparshev commented 6 years ago

Could be useful to simple test new modules functional, debugging or easy way to kickstart with the MPL.

// Defining virtual module
MPLVirtualModule('Build') {
  // Closure with all the features of usual module
  echo "Hihi, I'm the virtual module"
  MPLModule('Build', CFG) // Executing upper level Build module
}

pipeline {
  ...
  stages {
    stage( 'Build' ) {
      MPLModule() // will execute virtual module first
    }
    ...
  }
}