bash - 用 bash 脚本中的值替换 phantom js 中的 YAML
问题描述
有一个静态yaml
文件。我在 phantom js 驱动程序中运行一些测试。我定义了两个 URL,一个用于暂存版本,另一个用于生产版本。
YAML 文件看起来像
browser:
chromejs: "phantomjs"
# we've deliberately left out the snap_file
resize_or_reload: 'reload'
# Type the name of the directory that shots will be stored in
directory: 'compare/alohavillas'
#before snap
before_capture: 'templates/javascript/wait--phantom.js'
# Add only 2 domains, key will act as a label
domains:
Production: "https://www.google.com"
Staging: "https://www.staging-google.com" # i want to make this like dynamic
问题是,我想从 bash 文件中获取动态值暂存站点地址
暂存网址.sh
#!/bin/bash
urlvalue="https://www.staging-google.com"
echo $urlvalue
如何从 bash 文件中读取值?
解决方案
推荐阅读
- sqlalchemy - SQLalchemy 在时间序列的 TOP / END / CONTINUATION 插入行,以便为现有表
- java - 如何在 Android Studio 的片段中添加日历?
- c - 如何在 C 语言中使用空格进行行输入
- python - NameError:名称“意思”未定义
- java - 为什么运算符 && 不检查两个条件并终止程序测试
- html - 如何在引导程序 5 中反转手风琴按钮内容
- terraform-provider-aws - 错误:启动源实例时出错:InvalidGroup.NotFound
- react-native - 使用钩子激活设备键盘时如何隐藏元素?
- java - 我正在尝试创建一个简单的 REST 服务来实现 CRUD 操作但是我在执行 DELETE 方法时遇到了这个错误-
- python - 无法使用 Python 类结构/将函数转换为类结构获取队列值