From de24f05c94d06e64f42c0a27b84dc04f47156acb Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:58:03 +0100 Subject: [PATCH 1/2] added plugin to collect farm environment variables --- .../publish/collect_farm_env_variables.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 client/ayon_kitsu/plugins/publish/collect_farm_env_variables.py diff --git a/client/ayon_kitsu/plugins/publish/collect_farm_env_variables.py b/client/ayon_kitsu/plugins/publish/collect_farm_env_variables.py new file mode 100644 index 0000000..918dc9e --- /dev/null +++ b/client/ayon_kitsu/plugins/publish/collect_farm_env_variables.py @@ -0,0 +1,28 @@ +import os + +import pyblish.api + +try: + from ayon_core.pipeline.publish import FARM_JOB_ENV_DATA_KEY +except ImportError: + # NOTE Can be removed when ayon-core >= 1.0.10 is required in package.py + FARM_JOB_ENV_DATA_KEY = "farmJobEnv" + + +class CollectKitsuJobEnvVars(pyblish.api.ContextPlugin): + """Collect set of environment variables to submit with deadline jobs""" + order = pyblish.api.CollectorOrder - 0.45 + label = "Collect Kitsu farm environment variables" + targets = ["local"] + + def process(self, context): + env = context.data.setdefault(FARM_JOB_ENV_DATA_KEY, {}) + for key in [ + "KITSU_SERVER", + "KITSU_LOGIN", + "KITSU_PWD", + ]: + value = os.getenv(key) + if value: + self.log.debug(f"Setting job env: {key}: {value}") + env[key] = value From ece1242684445fb0d3e002d30008a5d075a054b7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:59:15 +0100 Subject: [PATCH 2/2] added .idea to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f379b51..a663e40 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ frontend/.pnp.cjs frontend/.pnp.loader.mjs dist/ + +# JetBrains +.idea/