Can someone tell me a way to do sequential deployment on a number of servers added in ABC-DEV environment in Azure Devops using yml - not the classic way?

2

1 Answer

To control the sequence of the deployment jobs running in the same environment but on different servers(VM resources), you can explicitly define which server(VM) the deployment job should be running on and define each deployment job name and its dependency.

You may also consider using each expression to simplify the YAML syntax. Kindy take the following sample YAML for a reference.

enter image description here

parameters: - name: Servers type: object default: - ServerName: Server0 Dependency: [] - ServerName: Server1 Dependency: DeploymentJobOnServer0 - ServerName: Server2 Dependency: DeploymentJobOnServer1 stages: - stage: StageA jobs: - ${{ each Server in parameters.Servers }}: - deployment: DeploymentJobOn${{ Server.ServerName }} dependsOn: ${{ Server.Dependency }} environment: name: E-WindowsServers resourceName: ${{ Server.ServerName }} strategy: runOnce: deploy: steps: - script: | echo ${{ Server.ServerName }} 

enter image description here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.