Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to skip publishDir #4133

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,10 @@ process foo {
Files are copied into the specified directory in an *asynchronous* manner, so they may not be immediately available in the publish directory at the end of the process execution. For this reason, downstream processes should not try to access output files through the publish directory, but through channels.
:::

:::{tip}
To skip all publishDir directives for a process, set the `skipPublishDir` directive for the according process.
:::

Available options:

`contentType`
Expand Down Expand Up @@ -2066,6 +2070,31 @@ Available options:
: *Experimental: currently only supported for S3.*
: Allow the association of arbitrary tags with the published file e.g. `tags: [FOO: 'Hello world']`.

(process-skippublishdir)=

### skipPublishDir

:::{versionadded} 23.08.0-edge
:::

The `publishDir` directives for one task can be spread over the workflow file and many config files. Each `publishDir` has to be disabled individually. To skip all publishDir directives at once for a process, set the `skipPublishDir` directive for the according process.

```groovy
process foo {
publishDir '/data/chunks1', mode: 'copy', overwrite: false
publishDir '/data/chunks2', mode: 'copy', overwrite: false
publishDir '/data/chunks3', mode: 'copy', overwrite: false
skipPublishDir true

output:
path 'chunk_*'

'''
printf 'Hola' | split -b 1 - chunk_
'''
}
```

(process-queue)=

### queue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class TaskConfig extends LazyMap implements Cloneable {

List<PublishDir> getPublishDir() {
def dirs = get('publishDir')
if( !dirs ) {
if( !dirs || target.skipPublishDir ) {
return Collections.emptyList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,23 @@ class TaskConfigTest extends Specification {

}

def 'should skip publishDir object' () {

setup:
def script = Mock(BaseScript)
ProcessConfig process
List<PublishDir> publish

when:
process = new ProcessConfig(script)
process.publishDir '/data'
process.skipPublishDir = true
publish = process.createTaskConfig().getPublishDir()
then:
publish.isEmpty()

}

def 'should create publishDir with local variables' () {

given:
Expand Down