From 2489cb9c7ee38ded60cf75ad33461f0421d2f766 Mon Sep 17 00:00:00 2001 From: Christopher Tomkins-Tinch Date: Fri, 20 Oct 2023 15:57:43 -0400 Subject: [PATCH] try obtaining workspace info from google project resource labels --- pipes/WDL/tasks/tasks_terra.wdl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pipes/WDL/tasks/tasks_terra.wdl b/pipes/WDL/tasks/tasks_terra.wdl index 1a21e1e0a..074ea6334 100644 --- a/pipes/WDL/tasks/tasks_terra.wdl +++ b/pipes/WDL/tasks/tasks_terra.wdl @@ -47,7 +47,15 @@ task get_gcloud_env_info { gcloud auth print-access-token - gcloud config list --format='text(core.project)' + GOOGLE_PROJECT_ID="$(gcloud config list --format='value(core.project)')" + + #get project namespace: + WORKSPACE_NAMESPACE="$(gcloud projects describe $GOOGLE_PROJECT_ID --format='value(labels.workspacenamespace)')" + WORKSPACE_NAME="$(gcloud projects describe $GOOGLE_PROJECT_ID --format='value(labels.workspacename)')" + + echo "GOOGLE_PROJECT_ID: ${GOOGLE_PROJECT_ID}" + echo "WORKSPACE_NAMESPACE: ${WORKSPACE_NAMESPACE}" + echo "WORKSPACE_NAME: ${WORKSPACE_NAME}" touch additional_command_stdout.log