环境变量赋值
Execute shell
Command
See the list of available environment variables
rm -f env.properties
touch env.properties
echo build_name=构建名称 >env.properties
进阶版本
${project_name} 通过变量输入获得,此处使用下拉选择方式获取,也可以使用输入框获取
#!/bin/bash
rm -f env.properties
touch env.properties
build_time=`date '+%Y%m%d%H%M%S'`
git_branch=${GIT_BRANCH}
git_revision=${GIT_COMMIT:0:8}
project_name=${project_name}
echo build_name=$project_name $git_branch.$git_revision-$build_time >env.properties
注入环境变量
Inject environment variables
Properties File Path
env.properties
使用环境变量
Changes build name
Build Name
${build_name}