I am creating deployment yaml script in azure devops.
I have a requirement to use a manual validation task to confirm such changes. But before that, we have to set variable to one of our flags as conditions to run the said manual validation task.
Here is the code now:
strategy:
runOnce:
preDeploy:
pool: server
steps:
- script: |
if [[ "$(clusterTags)" == *"HOTFIX"* ]]; then
echo "##vso[task.setvariable variable=hotfix]true"
echo "HOTFIX TO BOY"
else
echo "##vso[task.setvariable variable=hotfix]false"
echo "Hindi to hotfix"
fi
name: SetHotfixVariable
- task: ManualValidation@0
timeoutInMinutes: 1440 # task times out in 1 day
condition: eq(variables.hotfix, true)
inputs:
notifyUsers: ''
instructions: 'Please validate the build configuration and resume'
onTimeout: 'resume'
deploy:
#usual deployment script here
I tried this approach but encountered error as I have a shell script within an agentless job. ‘SIT’ is a server job, but contains task ‘CmdLine’ which can only run on agents.
Is it possible to set these variables before the manual validation task? The cluster tag came from Pull Request Tags from azure repository.
Thank you very mych