You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/pages/pipelines/building_failure_handlers.rst
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,3 +81,31 @@ Below is an example of running a :attr:`failure handlers<FailureHandler>` from b
81
81
.. note::
82
82
Notice that ``failure-handler-1`` will run twice because it's declared in both the global section and in the step. Currently IceCI does not implement any deduplication mechanism for failure handlers.
83
83
84
+
85
+
Environment variables and files
86
+
_______________________________
87
+
88
+
Here's an example of defining environment variables and files on :attr:`failure handler<FailureHandler>` level.
Copy file name to clipboardExpand all lines: source/pages/pipelines/building_steps.rst
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,28 @@ Here's an example of passing environment variables to a container.
84
84
85
85
As you can see, the environment variable value is hardcoded into the pipeline. This is fine if your build configuration doesn't contain passwords or other sensitive data. For more information on how to manage sensitive data in ``IceCI`` see :ref:`secrets section<secrets-desc>`.
86
86
87
+
Files
88
+
_____
89
+
90
+
Here's an example of mounting files from a secret in a container.
91
+
92
+
.. code-block:: yaml
93
+
94
+
steps:
95
+
- name: file-test
96
+
dockerRun:
97
+
image: busybox
98
+
script: "cat /mnt/file"
99
+
files:
100
+
- path: /mnt/file
101
+
fromSecret: file-secret
102
+
103
+
.. note::
104
+
105
+
The content of a file can't be defined inline. Every file has to have a reference to a secret, from which the content is pulled.
Copy file name to clipboardExpand all lines: source/pages/pipelines/structure.rst
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,15 @@ The root of pipeline yaml file consists of the following fields.
67
67
Those environment variables will be passed to every :attr:`Docker run step<DockerRun>` in the pipeline.
68
68
69
69
.. important::
70
-
``Failure handlers`` have access to all the environment variables of a given ``step`` injected into their spec, so they're available in the failure handler as well. For more information about passing environment variables to failure handlers see TODO
70
+
``Failure handlers`` have access to all the environment variables of a given ``step`` injected into their spec, so they're available in the failure handler as well.
71
+
72
+
.. py:attribute:: files
73
+
:type: list(File)
74
+
75
+
List of files that will be mounted in every :attr:`Docker run step<DockerRun>` in the pipeline.
76
+
77
+
.. important::
78
+
Like environment variables, files from a given ``step`` are also mounted into ``Failure handlers``.
71
79
72
80
73
81
@@ -143,6 +151,11 @@ Definitions of all objects and types used in the pipeline definition.
143
151
144
152
List of environment variables passed to the container.
145
153
154
+
.. py:data:: files
155
+
:type: list(File)
156
+
157
+
List of files that will be mounted in the container.
158
+
146
159
147
160
148
161
.. _docker-build-reference:
@@ -261,6 +274,11 @@ Definitions of all objects and types used in the pipeline definition.
261
274
262
275
List of environment variables passed to the container.
263
276
277
+
.. py:data:: files
278
+
:type: list(File)
279
+
280
+
List of files that will be mounted in the container.
281
+
264
282
265
283
.. _failure-handler-reference-reference:
266
284
@@ -296,3 +314,20 @@ Definitions of all objects and types used in the pipeline definition.
296
314
297
315
.. note::
298
316
Currently ``IceCI`` supports creating environment variables by explicitly entering their values in the pipeline yaml or by providing a secret name from which the value should be taken. Those options are exclusive for a given variable - you can't have both :attr:`value` and :attr:`fromSecret` set at the same time - the pipeline validation will fail.
317
+
318
+
319
+
320
+
.. _file-reference:
321
+
322
+
.. py:attribute:: File
323
+
:type: Object
324
+
325
+
The file object represents a file that'll be mounted in a container from a secret. Unlike environment variables, file values cannot be provided inline - they have to reference a secret.
326
+
327
+
.. py:attribute:: path
328
+
329
+
The absolute path that the file will be mounted in.
330
+
331
+
.. py:attribute:: fromSecret
332
+
333
+
Name of a secret from which the value should be retrieved to mount into the container as a file.
0 commit comments