Lab 06: Azure Release Pipelines - OT-TRAINING/azure-devops-zero-to-hero GitHub Wiki

Releases Pipelines

Till now we have explored the Build Pipelines and its types in our previous labs. In this lab we are going to explore the release or deploy pipeline in Azure Devops.

The beauty of Azure Devops is that it provides different pipelines for Build and Release jobs.

In this lab we will proceed in continuation of our previous pipelines, publish an artifact, copy it in our Deployment Agent Pool, make some changes in the file and deploy it.

Let's first publish an artifact in our build pipeline.

Add a task to publish artifact.

image

Configure it.

image

Now let's save and run our pipeline.

image

This will generate an artifact named drop.

image

image

Now let's move to Release Pipelines.

image

We will start with an Empty Job.

image

image

Then go to Add Artifact and fill the following details like Build Pipeline Name, Default Version and Source Alias and then click the Add button.

image

Then move to Stage 1 and configure the task.

image

Select the release agent pool.

Just for the simplicity of pipeline, we will use bash commands.

Rename the file name file.txt as index.html

image

Rename the old file as old-index.html

image

Copy index.html into /var/www/html

image

Restarted our nginx service

image

Curl Localhost:80

image

Now let's save the pipeline and create the release

image

Now go to release to see the logs

image

image

image

image

image

image

image

image

image

You might have guessed it by now that we don't have yet configured for Continuous Integration.

For that we'll go back to our Build pipeline and check the Enable continuous integration box under Triggers. Which will trigger the Build Pipeline after every new pushed changes in the parent repo.

image

Along with that go to Artifact Triggers option and enable the Continuous Deployment Trigger.

image

After this our Release pipeline will get triggered after every new and successful build.