Do not think that you can use variables there. However, you can skip this condition and instead run the Run Shell build step, and then check the $PROMOTED_USER_NAME variables. Parse the name and make your decision based on this.
Parent parameters are not automatically passed to the promoted assemblies. However, you can export them to a file, archive the file (it is important for the archive, not store it in the workspace), transfer the file at the stage of promotion and load it into environment variables using EnvInject , or just use the file as it is in the script
About parenting
- Configure
approverid parameter - Create the Run Shell step with the following:
echo approverid=$approverid > myfile - At the end, make sure the
myfile archive
Promotion Configuration
- Skip approval criteria
- Add Copy Artifacts from Another Project Step
- Use
$PROMOTED_JOB_NAME for the project name. - For which assembly use a special assembly, then specify
$PROMOTED_NUMBER - To copy artifacts, use
myfile - Add Injection Environment Variables Build Step
- For the path to the properties file, enter
myfile - Add step execute command
- In this shell, compare the values โโof
$approverid and $PROMOTED_USER_NAME - If they match, continue, once again interrupt / stop the promotion.
Or, of course, the execution history will be marked (and interrupted).
Slav
source share