Skip to content

Instantly share code, notes, and snippets.

@naturalett
Last active December 17, 2023 15:12
Show Gist options
  • Select an option

  • Save naturalett/de1208ff6a371c98d93d6dfba3a54715 to your computer and use it in GitHub Desktop.

Select an option

Save naturalett/de1208ff6a371c98d93d6dfba3a54715 to your computer and use it in GitHub Desktop.
commonPipelineWorkshop
#!/usr/bin/env groovy
import groovy.text.StreamingTemplateEngine
def call(sharedLibrary, svcName, buildCommands, pod, slackChannel) {
if (pod.contains("<%")) {
pod = new StreamingTemplateEngine().createTemplate(pod).make(['' : '']).toString()
}
def podLabel = "${svcName}-${UUID.randomUUID().toString().substring(0,8)}"
pipeline {
agent {
kubernetes {
label podLabel
defaultContainer 'jnlp'
yaml pod
}
}
stages {
stage('Initialization') {
steps {
script {
echo "Starting Initialization stage"
}
}
}
stage('Build and Upload Artifact') {
steps {
script {
echo "Starting Build and Upload Artifact stage"
}
}
}
stage('Deployment') {
steps {
script {
echo "Starting Deployment stage"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment