gcloud - gcloud 具有不同配置的多个终端处于活动状态
问题描述
我使用不同的环境暂存和生产。通常我需要在两种环境中同时做事。每个环境都是一个 gcloud 配置。所以我总是在配置之间跳跃。
我想在不同的终端激活不同的配置,有什么办法吗?
当我运行下面的命令时,它会影响所有终端,有没有办法只影响当前终端?
gcloud config configurations activate <config-name>
任何解决方法的想法也会很有用
谢谢
解决方案
根据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
希望这很有用。
推荐阅读
- wordpress - 如何在 WordPress 中更改媒体文件上传日期?
- angular - 单向数据绑定不适用于 FullCalendar 和 Angular
- python - Scrapy分页无限
- google-cloud-platform - 启动虚拟机时出错 - 可用资源不足
- angular - 角度 6 错误对象为空以处理异常
- php - 如何循环遍历 mysql 查询的结果并将它们显示在 html 表单的选项值中
- javascript - 导入和使用 NPM 包
- playframework - 创建actor时的新play 2.6 application.conf默认值和最佳实践
- c# - 以相反的顺序将数组值传递给另一个数组
- .net-core - .Net Core Debug Logger 在日志级别打印工件