【发布时间】:2015-10-20 21:44:13
【问题描述】:
我正在尝试通过将环境变量 (SHORT_HASH) 作为命令 ('echo $CIRCLE_SHA1 | cut -c -7') 运行来将其设置为更短的 github 哈希。
所以,我希望将哈希 'b1e5ef8acff51c9218ccbf7152fae1d2049d03c5' 缩短为 'b1e5ef8'
这是我的 circle.yml 的精简版
machine:
python:
version: 2.7.3
services:
- docker
environment:
SHORT_HASH: 'echo $CIRCLE_SHA1 | cut -c -7'
BUILD_TAG: $CIRCLE_BUILD_NUM-$SHORT_HASH
我查看了 circleci 文档,但没有找到类似的内容。 https://circleci.com/docs/environment-variables
【问题讨论】:
-
圆圈错误是:发现字符`'
' that cannot start any token. (Do not use用于缩进)。
标签: circleci