@@ -33,9 +33,10 @@ <h1 class="title">Module <code>gcip.addons.docker.jobs</code></h1>
3333Those require [Docker to be installed](https://docs.docker.com/engine/install/) on the Gitlab runner.
3434"""
3535
36- from gcip.core.job import Job
3736from typing import Optional
3837
38+ from gcip.core.job import Job
39+
3940__author__ = "Thomas Steinbach"
4041__copyright__ = "Copyright 2020 DB Systel GmbH"
4142__credits__ = ["Thomas Steinbach"]
@@ -49,7 +50,7 @@ <h1 class="title">Module <code>gcip.addons.docker.jobs</code></h1>
4950 *,
5051 repository: str,
5152 tag: Optional[str] = None,
52- context: Optional[ str] = ".",
53+ context: str = ".",
5354) -> Job:
5455 """Runs [```docker build```](https://docs.docker.com/engine/reference/commandline/build/)
5556
@@ -64,7 +65,7 @@ <h1 class="title">Module <code>gcip.addons.docker.jobs</code></h1>
6465 repository (str): The Docker repository name ```([<registry>/]<image>)```.
6566 tag (Optional[str]): A Docker image tag applied to the image. Defaults to `None` which no tag is provided
6667 to the docker build command. Docker should then apply the default tag ```latest```.
67- context (Optional[ str] ): The Docker build context (the directory containing the Dockerfile). Defaults to
68+ context (str): The Docker build context (the directory containing the Dockerfile). Defaults to
6869 the current directory `.`.
6970
7071 Returns:
@@ -77,14 +78,14 @@ <h1 class="title">Module <code>gcip.addons.docker.jobs</code></h1>
7778 name="docker",
7879 namespace="build",
7980 script=f"docker build -t {_fq_image_name} {context}",
80- )
81+ ).add_variables(DOCKER_DRIVER="overlay2", DOCKER_TLS_CERTDIR="")
8182
8283
8384def push(
8485 *,
8586 registry: Optional[str] = None,
8687 image: str,
87- tag: Optional[str] = "latest" ,
88+ tag: Optional[str] = None ,
8889 user_env_var: Optional[str] = None,
8990 login_env_var: Optional[str] = None,
9091) -> Job:
@@ -152,7 +153,7 @@ <h1 class="title">Module <code>gcip.addons.docker.jobs</code></h1>
152153< h2 class ="section-title " id ="header-functions "> Functions</ h2 >
153154< dl >
154155< dt id ="gcip.addons.docker.jobs.build "> < code class ="name flex ">
155- < span > def < span class ="ident "> build</ span > </ span > (< span > *, repository: str, tag: Optional[str] = None, context: Optional[ str] = '.') ‑> < a title ="gcip.core.job.Job " href ="../../core/job.html#gcip.core.job.Job "> Job</ a > </ span >
156+ < span > def < span class ="ident "> build</ span > </ span > (< span > *, repository: str, tag: Optional[str] = None, context: str = '.') ‑> < a title ="gcip.core.job.Job " href ="../../core/job.html#gcip.core.job.Job "> Job</ a > </ span >
156157</ code > </ dt >
157158< dd >
158159< div class ="desc "> < p > Runs < a href ="https://docs.docker.com/engine/reference/commandline/build/ "> < code > docker build</ code > </ a > </ p >
@@ -167,7 +168,7 @@ <h2 id="args">Args</h2>
167168< dt > < strong > < code > tag</ code > </ strong > : < code > Optional[str]</ code > </ dt >
168169< dd > A Docker image tag applied to the image. Defaults to < code > None</ code > which no tag is provided
169170to the docker build command. Docker should then apply the default tag < code > latest</ code > .</ dd >
170- < dt > < strong > < code > context</ code > </ strong > : < code > Optional[ str] </ code > </ dt >
171+ < dt > < strong > < code > context</ code > </ strong > : < code > str</ code > </ dt >
171172< dd > The Docker build context (the directory containing the Dockerfile). Defaults to
172173the current directory < code > .</ code > .</ dd >
173174</ dl >
@@ -181,7 +182,7 @@ <h2 id="returns">Returns</h2>
181182 *,
182183 repository: str,
183184 tag: Optional[str] = None,
184- context: Optional[ str] = ".",
185+ context: str = ".",
185186) -> Job:
186187 """Runs [```docker build```](https://docs.docker.com/engine/reference/commandline/build/)
187188
@@ -196,7 +197,7 @@ <h2 id="returns">Returns</h2>
196197 repository (str): The Docker repository name ```([<registry>/]<image>)```.
197198 tag (Optional[str]): A Docker image tag applied to the image. Defaults to `None` which no tag is provided
198199 to the docker build command. Docker should then apply the default tag ```latest```.
199- context (Optional[ str] ): The Docker build context (the directory containing the Dockerfile). Defaults to
200+ context (str): The Docker build context (the directory containing the Dockerfile). Defaults to
200201 the current directory `.`.
201202
202203 Returns:
@@ -209,11 +210,11 @@ <h2 id="returns">Returns</h2>
209210 name="docker",
210211 namespace="build",
211212 script=f"docker build -t {_fq_image_name} {context}",
212- )</ code > </ pre >
213+ ).add_variables(DOCKER_DRIVER="overlay2", DOCKER_TLS_CERTDIR="") </ code > </ pre >
213214</ details >
214215</ dd >
215216< dt id ="gcip.addons.docker.jobs.push "> < code class ="name flex ">
216- < span > def < span class ="ident "> push</ span > </ span > (< span > *, registry: Optional[str] = None, image: str, tag: Optional[str] = 'latest' , user_env_var: Optional[str] = None, login_env_var: Optional[str] = None) ‑> < a title ="gcip.core.job.Job " href ="../../core/job.html#gcip.core.job.Job "> Job</ a > </ span >
217+ < span > def < span class ="ident "> push</ span > </ span > (< span > *, registry: Optional[str] = None, image: str, tag: Optional[str] = None , user_env_var: Optional[str] = None, login_env_var: Optional[str] = None) ‑> < a title ="gcip.core.job.Job " href ="../../core/job.html#gcip.core.job.Job "> Job</ a > </ span >
217218</ code > </ dt >
218219< dd >
219220< div class ="desc "> < p > Runs < a href ="https://docs.docker.com/engine/reference/commandline/push/ "> < code > docker push</ code > </ a >
@@ -260,7 +261,7 @@ <h2 id="returns">Returns</h2>
260261 *,
261262 registry: Optional[str] = None,
262263 image: str,
263- tag: Optional[str] = "latest" ,
264+ tag: Optional[str] = None ,
264265 user_env_var: Optional[str] = None,
265266 login_env_var: Optional[str] = None,
266267) -> Job:
0 commit comments