Last active
December 17, 2023 15:12
-
-
Save naturalett/de1208ff6a371c98d93d6dfba3a54715 to your computer and use it in GitHub Desktop.
commonPipelineWorkshop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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