-
-
Save huguesfontenelle/887cc0d8214b20dfd9b355d38ec044bf 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
class Util { | |
static def whois(def number) { | |
def subdir = ['one', 'two', 'three'] | |
return subdir[number-1] | |
} | |
} | |
ch = Channel.from(1, 2, 3) | |
process parallel { | |
echo true | |
publishDir "$storage/${Util.whois(no)}", mode: 'copy' | |
input: | |
val(no) from ch | |
output: | |
file('*.txt') into parallel_out | |
script: | |
""" | |
echo "A_${no}" > A_${no}.txt | |
echo "B_${no}" > B_${no}.txt | |
""" | |
} | |
process join { | |
echo true | |
publishDir "$storage" | |
input: | |
file('*') from parallel_out.flatten().toList() | |
output: | |
file('*.txt') into join_out | |
script: | |
""" | |
cat A_1.txt A_2.txt A_3.txt > A_join.txt | |
cat B_1.txt B_2.txt B_3.txt > B_join.txt | |
""" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment