Created
January 31, 2020 20:26
-
-
Save nhocki/59c1c59f0272b4f1ee1db91b5c49f73e to your computer and use it in GitHub Desktop.
This file contains 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
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") | |
} | |
} |
This file contains 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
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