Skip to content

Commit b17920d

Browse files
committed
Adds COMPI_PIPELINE_VERSION to tasks environment variables
1 parent f6364f5 commit b17920d

File tree

7 files changed

+40
-6
lines changed

7 files changed

+40
-6
lines changed

cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>org.sing_group</groupId>
1111
<artifactId>compi</artifactId>
12-
<version>1.5.0</version>
12+
<version>1.5.1</version>
1313
<!--
1414
WARNING: change version using (in the parent project):
1515
mvn versions:set -DnewVersion=[new_version]

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.sing_group</groupId>
1212
<artifactId>compi</artifactId>
13-
<version>1.5.0</version>
13+
<version>1.5.1</version>
1414
<!--
1515
WARNING: change version using (in the parent project):
1616
mvn versions:set -DnewVersion=[new_version]

core/src/main/java/org/sing_group/compi/core/CompiRunConfiguration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public Map<String, String> asMap() {
7373
CONFIGURATION_VARIABLES_PREFIX + "PIPELINE_FILE",
7474
(this.getPipelineFile() == null) ? "" : this.getPipelineFile().toString()
7575
);
76+
asMap.put(
77+
CONFIGURATION_VARIABLES_PREFIX + "PIPELINE_VERSION",
78+
(this.getPipeline() == null) ? "" : this.getPipeline().getVersion().toString()
79+
);
7680
asMap.put(
7781
CONFIGURATION_VARIABLES_PREFIX + "PARAMS_FILE",
7882
(this.getParamsFile() == null) ? "" : this.getParamsFile().toString()

dk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>org.sing_group</groupId>
1111
<artifactId>compi</artifactId>
12-
<version>1.5.0</version>
12+
<version>1.5.1</version>
1313
<!--
1414
WARNING: change version using (in the parent project):
1515
mvn versions:set -DnewVersion=[new_version]

docs/source/writing_pipelines.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,37 @@ first ``foreach``.
264264
.. note::
265265
It is mandatory that all ``foreach`` tasks have the same number of iterations
266266
if you want to establish an "iteration dependency" between them.
267-
267+
268+
Environment variables available for tasks
269+
-----------------------------------------
270+
271+
When launching a task, Compi establishes a set of environment variables related with the task
272+
and the Compi execution itself (i.e. the ``compi run`` command), plus an additional variable
273+
with the pipeline version (``COMPI_PIPELINE_VERSION``).
274+
275+
The task-related variables are:
276+
277+
- ``task_id``: contains the id of the task being executed.
278+
- ``task_code``: contains the code (defined in the ``pipeline.xml``) of the task being executed.
279+
- ``task_params``: contains the list of params associated to the task being executed.
280+
- ``i``: in the case of ``foreach`` tasks, the iteration value.
281+
282+
The variables related with the Compi execution are:
283+
284+
- ``COMPI_PARAMS_FILE``
285+
- ``COMPI_DO_NOT_LOG_TASKS``
286+
- ``COMPI_UNTIL_TASK``
287+
- ``COMPI_MAX_TASKS``
288+
- ``COMPI_AFTER_TASKS``
289+
- ``COMPI_BEFORE_TASK``
290+
- ``COMPI_LOGS_DIR``
291+
- ``COMPI_PIPELINE_FILE``
292+
- ``COMPI_RUNNERS_FILE``
293+
- ``COMPI_FROM_TASKS``
294+
- ``COMPI_SINGLE_TASK``
295+
- ``COMPI_LOG_ONLY_TASKS``
296+
- ``COMPI_SHOW_STD_OUTS``
297+
- ``COMPI_OVERWRITE_LOGS``
268298

269299
Defining tasks metadata
270300
=======================

e2e-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>org.sing_group</groupId>
1111
<artifactId>compi</artifactId>
12-
<version>1.5.0</version>
12+
<version>1.5.1</version>
1313
<!--
1414
WARNING: change version using (in the parent project):
1515
mvn versions:set -DnewVersion=[new_version]

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>org.sing_group</groupId>
77
<artifactId>compi</artifactId>
88
<packaging>pom</packaging>
9-
<version>1.5.0</version>
9+
<version>1.5.1</version>
1010
<!-- WARNING: change version using (in the parent project): mvn versions:set -DnewVersion=[new_version] mvn versions:commit This will change the version
1111
in all modules at-once -->
1212

0 commit comments

Comments
 (0)