Skip to content

Instantly share code, notes, and snippets.

@nhocki
Created January 31, 2020 20:26
Show Gist options
  • Save nhocki/59c1c59f0272b4f1ee1db91b5c49f73e to your computer and use it in GitHub Desktop.
Save nhocki/59c1c59f0272b4f1ee1db91b5c49f73e to your computer and use it in GitHub Desktop.
pipeline {
agent {
label 'build_node'
}
stages {
stage('run services pipelines') {
steps {
script {
parallel buildServices()
}
}
}
}
}
// buildServices returns a list of tests for each service.
def buildServices() {
def services = [:]
files = sh(script: 'find ./services/ -type f -name \'Jenkinsfile\' | sed -r \'s|/[^/]+$||\' |sort |uniq', returnStdout: true).split()
files.each { item ->
services.put("${item.split("/").last()}", prepareService(item))
}
return services
}
def prepareService(String service) {
return {
load("${service}/Jenkinsfile")
}
}
stage('NAME') {
stage('test') {
sh '''
echo "test in NAME"
'''
}
stage('docker-build') {
sh '''
echo "building docker NAME"
'''
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment