jenkins scripted pipeline - ghdrako/doc_snipets GitHub Wiki

Seed job

https://github.com/bitwiseman/jenkins-job-dsl-seed-all-demo

A scripted pipeline is a groovy-based DSL. It provides greater flexibility and scalability for Jenkins users than the Declarative pipeline.

#!/usr/bin/env groovy

Jenkins scripted pipeline has the following skeleton:

node {
	stage (‘Build’ {
		//...
	}
	stage (‘Test’) {
		//...
	}
}

declarative pipeline can be written by using more elements, as shown next:

pipeline {
	agent any 
	stages {
stage(‘Build’) {
	steps {
		//…
	}
	}
	stage (‘Test’) {
	steps {
		//…
	}
	}
}