作者:素材火2 | 来源:互联网 | 2023-02-03 11:42
对于gitlab CI,我正在定义一些变量,如下所示:
variables:
PROD: project_package
STAGE: project_package_stage
PACKAGE_PATH: /opt/project/build/package
BUILD_PATH: /opt/project/build/package/bundle
CONTAINER_IMAGE: registry.example.com/project/package:e2e
我想更动态地设置这些变量,因为主要只有两部分:project
和package
。其他所有内容都取决于这些值,这意味着我只需更改两个值即可获取所有其他变量。
所以我期望像
variables:
PROJECT: project
PACKAGE: package
PROD: $PROJECT_$PACKAGE
STAGE: $PROD_stage
PACKAGE_PATH: /opt/$PROJECT/build/$PACKAGE
BUILD_PATH: /opt/$PROJECT/build/$PACKAGE/bundle
CONTAINER_IMAGE: registry.example.com/$PROJECT/$PACKAGE:e2e
但是看起来这样做的方式是错误的...