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

Ability to load pipeline input configuration from repo config file #42

Open sparshev opened 5 years ago

sparshev commented 5 years ago

Execution of the Jenkinsfile from the repository could expose credentials to end-user (for example create custom pipeline with using credentials in test stage and echo those creds as base64-encoded to build console).

Probably the only way to control the scripted pipeline with repo configuration - is to read config file (json, yaml or configslurper for some dynamics) from the repo without access to the pipeline steps.

It could look like this: Job with pipeline script:

@Library('mpl') _
MPLStrict {
  git = [url, creds, ...] // repo configs
  pipeline = 'pipeline_name' // pipeline to execute, if not set - get it from the repo config
}

In this step it will load the config file, parse it, and execute the required pipeline.

As result we need a common interface for that in MPL to allow to fortify the pipeline.