Shippable CI UI 向我显示以下错误:
错误:检测到 1 个验证错误:值'[if [ develop == master ]; then xxx-xx-prod; else xxx-xx-dev; fi]'
未能'environmentNames'
满足约束:成员必须满足约束:[成员的长度必须小于或等于 40,成员的长度必须大于或等于 4]
这是我的 shippable.yml 文件:
branches:
only:
- develop
- master
build:
ci:
- "echo 'CI is running'"
post_ci:
- "docker build -t=\"xxxx/xxx-xxxx:$BRANCH.$BUILD_NUMBER\" ."
- "docker push xxxx/xxx-xxx:$BRANCH.$BUILD_NUMBER"
- "pip install --upgrade botocore"
- "pip install setuptools==34.0.1"
integrations:
deploy:
-
application_name: seamless-ai
env_name: if [ "$BRANCH" == "master" ]; then "xxx-xx-prod"; else "xxx-xx-dev"; fi
image_name: xxxx/xxx-xxx
image_tag: $BRANCH.$BUILD_NUMBER
integrationName: AWS-int
region: us-east-1
type: aws
hub:
-
integrationName: "Docker Hub"
type: docker
language: node_js
所以本质上,我的问题如下:
env_name: if [ "$BRANCH" == "master" ]; then "xxx-xx-prod"; else "xxx-xx-dev"; fi
基本上我需要做的是:
如果分支是master,那么env_name
一定是xxx-xx-prod
,否则env_name
=xxx-xx-dev
我该如何解决这个问题?