Commit a8c029e3 authored by Tim Bleimehl's avatar Tim Bleimehl 🤸🏼
Browse files

add labels to pipeline and members

parent 97a844d1
Pipeline #1658 passed with stage
in 35 seconds
FROM python:3.7 FROM python:3.7
LABEL motherlode.dzd-ev.de/pipeline=true
RUN mkdir -p /opt/Motherlode RUN mkdir -p /opt/Motherlode
COPY ./Motherlode /opt/Motherlode COPY ./Motherlode /opt/Motherlode
......
from Configs import ConfigBase from Configs import ConfigBase
from typing import Dict
class DEFAULT(ConfigBase): class DEFAULT(ConfigBase):
NEO4J = {} NEO4J = {}
...@@ -7,6 +7,7 @@ class DEFAULT(ConfigBase): ...@@ -7,6 +7,7 @@ class DEFAULT(ConfigBase):
# docker.DockerClient params as dict. https://docker-py.readthedocs.io/en/stable/client.html#client-reference # docker.DockerClient params as dict. https://docker-py.readthedocs.io/en/stable/client.html#client-reference
DOCKER_CLIENT = {"base_url": "unix:///var/run/docker.sock"} DOCKER_CLIENT = {"base_url": "unix:///var/run/docker.sock"}
DOCKER_NETWORK_MODE = "bridge" DOCKER_NETWORK_MODE = "bridge"
CONTAINER_LABELS:Dict = {}
FORCE_IMAGE_REPULL = False FORCE_IMAGE_REPULL = False
LOG_PATH = "./logs" LOG_PATH = "./logs"
DOT_ENV_PATH = "/data/.env" DOT_ENV_PATH = "/data/.env"
......
...@@ -19,8 +19,9 @@ class PipelineManager: ...@@ -19,8 +19,9 @@ class PipelineManager:
pipeline = Pipeline( pipeline = Pipeline(
config.PIPELINE_DEF_FILE, config.PIPELINE_DEF_FILE,
docker_client=docker.DockerClient(**config.DOCKER_CLIENT), docker_client=docker.DockerClient(**config.DOCKER_CLIENT),
dot_env_path=config.DOT_ENV_PATH, dot_env_path=config.DOT_ENV_PATH
) )
pipeline.global_labels = {**config.CONTAINER_LABELS,"motherlode.dzd-ev.de/pipeline-member":"true"}
pipeline.container_force_image_pull = config.FORCE_IMAGE_REPULL pipeline.container_force_image_pull = config.FORCE_IMAGE_REPULL
pipeline.container_pre_pull_callback = ( pipeline.container_pre_pull_callback = (
self._callback_attach_container_registry_data self._callback_attach_container_registry_data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment