【问题标题】:gcloud multiple terminals with different configuration activegcloud 具有不同配置的多个终端处于活动状态
【发布时间】:2019-04-24 14:58:04
【问题描述】:

我使用不同的环境暂存和生产。通常我需要在两种环境中同时做事。每个环境都是一个 gcloud 配置。所以我总是在配置之间跳转。

我想在不同的终端激活不同的配置,有什么办法吗?

当我运行下面的命令时,它会影响所有终端,有什么办法只影响当前终端?

gcloud config configurations activate <config-name>

任何解决方法的想法也很有用

谢谢

【问题讨论】:

    标签: gcloud gcloud-cli


    【解决方案1】:

    根据gcloud help

    GLOBAL FLAGS
         ...
         --configuration=CONFIGURATION
            The configuration to use for this command invocation. For more
            information on how to use configurations, run: gcloud topic
            configurations. You can also use the [CLOUDSDK_ACTIVE_CONFIG_NAME]
            environment variable to set the equivalent of this flag for a terminal
            session.
    

    你可以在一个终端上运行

    export CLOUDSDK_ACTIVE_CONFIG_NAME=config-name1
    

    在另一个终端

    export CLOUDSDK_ACTIVE_CONFIG_NAME=config-name2
    

    希望有用。

    【讨论】:

      猜你喜欢
      • 2023-03-26
      • 1970-01-01
      • 2019-05-05
      • 2018-08-31
      • 2021-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多