diff --git a/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py b/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py index 79150ebb79..9b2cf63a5b 100644 --- a/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py +++ b/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py @@ -30,6 +30,10 @@ class CollectDeadlineJobEnvVars(pyblish.api.ContextPlugin): # Not sure how this is usefull for farm, scared to remove "PYBLISHPLUGINPATH", + + # NOTE still required by GlobalPreLoadJob.py, but might not be set by + # ayon-core anymore + "AYON_DEFAULT_SETTINGS_VARIANT", ] def process(self, context): diff --git a/client/ayon_deadline/plugins/publish/global/submit_publish_job.py b/client/ayon_deadline/plugins/publish/global/submit_publish_job.py index 82f4e0348c..9eb97b9e51 100644 --- a/client/ayon_deadline/plugins/publish/global/submit_publish_job.py +++ b/client/ayon_deadline/plugins/publish/global/submit_publish_job.py @@ -199,8 +199,8 @@ def _submit_deadline_post_job( "--targets", "deadline", "--targets", "farm", ] - # TODO remove when AYON launcher respects environment variable - # 'AYON_DEFAULT_SETTINGS_VARIANT' + # TODO remove settings variant handling when not needed anymore + # which should be when package.py defines 'core>1.1.1' . settings_variant = os.environ["AYON_DEFAULT_SETTINGS_VARIANT"] if settings_variant == "staging": args.append("--use-staging") diff --git a/client/ayon_deadline/repository/custom/plugins/GlobalJobPreLoad.py b/client/ayon_deadline/repository/custom/plugins/GlobalJobPreLoad.py index 99f02eb3db..e2002ff70a 100644 --- a/client/ayon_deadline/repository/custom/plugins/GlobalJobPreLoad.py +++ b/client/ayon_deadline/repository/custom/plugins/GlobalJobPreLoad.py @@ -13,7 +13,7 @@ FileUtils, DirectoryUtils, ) -__version__ = "1.2.0" +__version__ = "1.2.1" VERSION_REGEX = re.compile( r"(?P0|[1-9]\d*)" r"\.(?P0|[1-9]\d*)" @@ -558,8 +558,12 @@ def inject_ayon_environment(deadlinePlugin): ] # staging requires passing argument - # TODO could be switched to env var after https://github.com/ynput/ayon-launcher/issues/123 - settings_variant = job.GetJobEnvironmentKeyValue("AYON_DEFAULT_SETTINGS_VARIANT") # noqa + # TODO could be removed when PR in ayon-core starts to fill + # 'AYON_USE_STAGING' (https://github.com/ynput/ayon-core/pull/1130) + # - add requirement for "core>=1.1.1" to 'package.py' when removed + settings_variant = job.GetJobEnvironmentKeyValue( + "AYON_DEFAULT_SETTINGS_VARIANT" + ) if settings_variant == "staging": args.append("--use-staging") @@ -583,9 +587,11 @@ def inject_ayon_environment(deadlinePlugin): "AYON_BUNDLE_NAME": ayon_bundle_name, } - automatic_tests = job.GetJobEnvironmentKeyValue("AYON_IN_TESTS") - if automatic_tests: - environment["AYON_IN_TESTS"] = automatic_tests + for key in ("AYON_USE_STAGING", "AYON_IN_TESTS"): + value = job.GetJobEnvironmentKeyValue(key) + if value: + environment[key] = value + for env, val in environment.items(): # Add the env var for the Render Plugin that is about to render deadlinePlugin.SetEnvironmentVariable(env, val)