【发布时间】:2020-02-28 10:52:33
【问题描述】:
我正在使用 codebuild 构建现有项目,并希望将版本号添加到工件 zip 名称中。内部版本号在源代码中可用,但我需要一种方法将其公开给 Artifacts 代码构建步骤。
我的 buildspec.yaml 的精简版:
env:
exported-variables:
- BUILD_VERSION
phases:
build:
commands:
- setx BUILD_VERSION (Get-Content -Path .\Version.txt) /M
artifacts:
base-directory: bin\Release\Publish\
files:
- .\**\*
name: myapp-$BUILD_VERSION-$(Get-Date -UFormat "%Y%m%d%H%M%S").zip
目前这个输出 "mpapp--.zip" 有没有办法将 BUILD_VERSION 环境变量设置为文件中的值?
【问题讨论】:
标签: amazon-web-services aws-codebuild