Skip to content

Commit 01c8d70

Browse files
authored
Fix YAML and some MD syntax cleanup
1 parent 4c050d7 commit 01c8d70

File tree

1 file changed

+97
-44
lines changed

1 file changed

+97
-44
lines changed

readme.md

Lines changed: 97 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,47 @@ The key takeaways of the demo are:
5757

5858
These items are required for this demo.
5959

60-
1. A GitHub account from <https://github.com>.
60+
1. A GitHub account from <https://github.compool:
61+
vmImage: 'ubuntu-16.04'
62+
63+
steps:
64+
- task: Npm@1
65+
inputs:
66+
command: 'install'
67+
68+
- script:
69+
npm test
70+
displayName: 'Run tests'
71+
continueOnError: true
72+
73+
- task: PublishTestResults@2
74+
displayName: 'Publish Test Results'
75+
condition: succeededOrFailed()
76+
inputs:
77+
testResultsFiles: '$(System.DefaultWorkingDirectory)/test-report.xml'
78+
79+
- task: PublishCodeCoverageResults@1
80+
displayName: 'Publish Code Coverage'
81+
condition: in(variables['Agent.JobStatus'], 'Succeeded')
82+
inputs:
83+
codeCoverageTool: Cobertura
84+
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage'
85+
86+
- task: ArchiveFiles@2
87+
displayName: 'Archive sources'
88+
inputs:
89+
rootFolderOrFile: '$(Build.SourcesDirectory)'
90+
includeRootFolder: false
91+
92+
- task: CopyFiles@2
93+
displayName: 'Copy ARM templates'
94+
inputs:
95+
SourceFolder: deployment
96+
Contents: '*.json'
97+
TargetFolder: '$(build.artifactstagingdirectory)/Templates'
98+
99+
- task: PublishBuildArtifacts@1
100+
displayName: 'Publish Artifact: drop'.
61101

62102
2. An Azure account from <https://azure.com>.
63103

@@ -159,7 +199,7 @@ extension in the GitHub Marketplace.
159199
1. Select the repositories you want to include (or **All
160200
repositories**) and click **Install**.
161201

162-
> **Note** that if you've previously installed Azure Pipelines, you may
202+
>**Note:** If you've previously installed Azure Pipelines, you may
163203
need to toggle between the "All" and "Select" radio buttons to enable the
164204
wizard in Task 2. You can always create the pipeline directly from Azure
165205
Pipelines if the wizard does not appear.
@@ -180,8 +220,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
180220

181221
![](./images/image9.png)
182222

183-
184-
>Every build pipeline is simply a set of tasks. Whether it's copying files, compiling source, or publishing artifacts, the existing library of tasks covers the vast majority of scenarios. You can even create your own if you have specialized needs not already covered. We're going to use YAML, a markup syntax that lends itself well to describing the build pipeline. Note that the Node.js pipeline as a starting point based on an analysis of our source project. We'll replace the contents with the final YAML required for our project.
223+
Every build pipeline is simply a set of tasks. Whether it's copying files, compiling source, or publishing artifacts, the existing library of tasks covers the vast majority of scenarios. You can even create your own if you have specialized needs not already covered. We're going to use YAML, a markup syntax that lends itself well to describing the build pipeline. Note that the Node.js pipeline as a starting point based on an analysis of our source project. We'll replace the contents with the final YAML required for our project.
185224

186225
3. Select the recommended template.
187226

@@ -190,31 +229,46 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
190229
4. Replace the default template with the YAML below.
191230

192231
````yaml
193-
232+
194233
pool:
195234
vmImage: 'ubuntu-16.04'
196235

197236
steps:
198-
- task: CopyFiles@2
199-
displayName: 'Copy Files to: $(build.artifactstagingdirectory)/Templates'
237+
- task: Npm@1
200238
inputs:
201-
SourceFolder: deployment
202-
Contents: '*.json'
203-
TargetFolder: '$(build.artifactstagingdirectory)/Templates'
239+
command: 'install'
204240

205-
- task: Npm@1
206-
displayName: 'npm custom'
241+
- script:
242+
npm test
243+
displayName: 'Run tests'
244+
continueOnError: true
245+
246+
- task: PublishTestResults@2
247+
displayName: 'Publish Test Results'
248+
condition: succeededOrFailed()
249+
inputs:
250+
testResultsFiles: '$(System.DefaultWorkingDirectory)/test-report.xml'
251+
252+
- task: PublishCodeCoverageResults@1
253+
displayName: 'Publish Code Coverage'
254+
condition: in(variables['Agent.JobStatus'], 'Succeeded')
207255
inputs:
208-
command: custom
209-
verbose: false
210-
customCommand: 'install --production'
256+
codeCoverageTool: Cobertura
257+
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage'
211258

212259
- task: ArchiveFiles@2
213-
displayName: 'Archive $(Build.SourcesDirectory)'
260+
displayName: 'Archive sources'
214261
inputs:
215262
rootFolderOrFile: '$(Build.SourcesDirectory)'
216263
includeRootFolder: false
217264

265+
- task: CopyFiles@2
266+
displayName: 'Copy ARM templates'
267+
inputs:
268+
SourceFolder: deployment
269+
Contents: '*.json'
270+
TargetFolder: '$(build.artifactstagingdirectory)/Templates'
271+
218272
- task: PublishBuildArtifacts@1
219273
displayName: 'Publish Artifact: drop'
220274

@@ -245,7 +299,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
245299

246300
![](./images/image14.png)
247301

248-
\> The first item to define in a release pipeline is exactly what will be released and when. In our case, it's the output
302+
The first item to define in a release pipeline is exactly what will be released and when. In our case, it's the output
249303
generated from the build pipeline. Note that we could also assign a
250304
schedule, such as if we wanted to release the latest build every
251305
night.
@@ -259,7 +313,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
259313

260314
![](./images/image16.png)
261315

262-
\> As we did with continuous integration starting on a source commit, we also want to have this pipeline automatically start when the build pipeline completes. It's just as easy.
316+
As we did with continuous integration starting on a source commit, we also want to have this pipeline automatically start when the build pipeline completes. It's just as easy.
263317

264318
5. Click the **Triggers** button on the artifact.
265319

@@ -269,7 +323,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
269323

270324
![](./images/image18.png)
271325

272-
\> We also have the option of adding quality gates to the release process. For example, we could require that a specific user or group approve a release before it continues, or that they approve it after it's been deployed. These gates provide notifications to the necessary groups, as well as polling support if you're automating the gates using something dynamic, such as an Azure function, REST API, work item query, and more. We won't add any of that here, but we could easily come back and do it later on.
326+
We also have the option of adding quality gates to the release process. For example, we could require that a specific user or group approve a release before it continues, or that they approve it after it's been deployed. These gates provide notifications to the necessary groups, as well as polling support if you're automating the gates using something dynamic, such as an Azure function, REST API, work item query, and more. We won't add any of that here, but we could easily come back and do it later on.
273327

274328
7. Click the **pre-deployment conditions** button.
275329

@@ -279,7 +333,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
279333

280334
![](./images/image20.png)
281335

282-
\> In this pipeline, we're going to need to specify the same resource group in multiple tasks, so it's a good practice
336+
In this pipeline, we're going to need to specify the same resource group in multiple tasks, so it's a good practice
283337
to use a pipeline variable. We'll add one here for the new Azure resource group we want to provision our resources to. Note that
284338
there are also a variety of deployment options we can configure, as well as a retention policy.
285339

@@ -293,7 +347,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
293347

294348
![](./images/image22.png)
295349

296-
\> Also, just like the build pipeline, the release pipeline is really just a set of tasks. There are many
350+
Also, just like the build pipeline, the release pipeline is really just a set of tasks. There are many
297351
out-of-the-box tasks available, and you can build your own if needed. The first task our release requires is to set up the Azure
298352
deployment environment if it doesn't yet exist. After we add the task, I can authorize access to the Azure account I want to deploy
299353
to and instruct it to use the variable name we just specified for the resource group name.
@@ -324,7 +378,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
324378

325379
![](./images/image28.png)
326380

327-
\> Rather than having to manually create the Azure
381+
Rather than having to manually create the Azure
328382
resources required to host the web app, the team has defined an
329383
Azure Resource Manager---or ARM---template that describes the
330384
environment in JSON. This allows the environment definition to be
@@ -350,7 +404,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
350404

351405
![](./images/image29.png)
352406

353-
\> When this task completes, it will have generated
407+
When this task completes, it will have generated
354408
an Azure resource group with the resources required to run our
355409
application. However, the ARM template does some processing of the
356410
variables to generate names for the resources based on the input
@@ -379,7 +433,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
379433

380434
![](./images/image32.png)
381435

382-
\> Now let's get back to adding the ARM Outputs
436+
Now let's get back to adding the ARM Outputs
383437
task. The key variable we care about here is the name of the app
384438
service created, which our ARM template has specified as an output.
385439
This task will populate it for us to use as the "web" variable in
@@ -398,7 +452,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
398452

399453
![](./images/image35.png)
400454

401-
\> Finally, we can deploy the app service. We'll use
455+
Finally, we can deploy the app service. We'll use
402456
the same subscription as earlier and specify the web variable as the
403457
name of the app service we want to deploy to. By this time in the
404458
pipeline, it will have been filled in for us by the ARM Outputs
@@ -432,7 +486,7 @@ Now that Azure Pipelines has been installed in the GitHub account, we can config
432486

433487
### Task 4 -- Invoking Continuous Delivery from GitHub to Azure
434488

435-
\> Now that we have our pipelines in place, it's time to
489+
Now that we have our pipelines in place, it's time to
436490
commit a change to the master branch on GitHub. We're going to pull down
437491
the azure-pipelines.yml file added by Azure DevOps during the build
438492
creation and commit a slight edit to trigger the CI/CD process.
@@ -448,7 +502,7 @@ creation and commit a slight edit to trigger the CI/CD process.
448502

449503
![](./images/image42.png)
450504

451-
\> Before we make our change, let's take a quick
505+
Before we make our change, let's take a quick
452506
look at the build tasks. There are four steps required for the
453507
build. First, deployment templates are copied to a target folder for
454508
use during the release process. Next, the project is built with NPM.
@@ -469,7 +523,7 @@ creation and commit a slight edit to trigger the CI/CD process.
469523

470524
8. Press **Ctrl+S** to save the file.
471525

472-
\> Now we can commit and push the updated build
526+
Now we can commit and push the updated build
473527
definition to GitHub. This will invoke a continuous integration
474528
build in Azure DevOps, which will trigger a continuous delivery to
475529
Azure upon completion.
@@ -491,7 +545,7 @@ creation and commit a slight edit to trigger the CI/CD process.
491545

492546
![](./images/image44.png)
493547

494-
\> Back in Azure DevOps, we can see that our build
548+
Back in Azure DevOps, we can see that our build
495549
pipeline has kicked off a new build. We can follow as it executes
496550
the tasks we defined earlier, and even get a real-time view into
497551
what's going on at each step. When the build completes, we can
@@ -514,7 +568,7 @@ creation and commit a slight edit to trigger the CI/CD process.
514568

515569
![](./images/image48.png)
516570

517-
\> Now that the build has completed, let's check out
571+
Now that the build has completed, let's check out
518572
the release. It was automatically invoked by the successful
519573
completion of the build pipeline, and we can follow it all the same.
520574
Since this is the first time we're deploying, Azure will need to
@@ -546,8 +600,7 @@ creation and commit a slight edit to trigger the CI/CD process.
546600

547601
# Exercise 2 -- Managing GitHub Projects with Azure DevOps
548602

549-
550-
DevOps is not just about automation; while continuous integartion and continuous delivery are key practices, teams also need continuous planning. As the saying software developmement is a team sport - it is vital that everyone stays on the same page.
603+
DevOps is not just about automation; while continuous integartion and continuous delivery are key practices, teams also need continuous planning. As the saying software developmement is a team sport - it is vital that everyone stays on the same page.
551604

552605
Azure Boards provides a wealth of project management functionality that spans Kanban boards, backlogs, team dashboards, and
553606
custom reporting. By connecting Azure Boards with GitHub repositories, teams can take advantage of the rich project management capabilities. You can create links between GitHub commits and pull requests to work items tracked in Azure Boards. This enables a seamless way for you to use GitHub for software development while using Azure Boards to plan and track your work.
@@ -563,17 +616,17 @@ custom reporting. By connecting Azure Boards with GitHub repositories, teams can
563616

564617
![](./images/image76.png)
565618

566-
\> In our scenario, users will need to be able to book flights by selecting the cities involved. We will create a new
619+
In our scenario, users will need to be able to book flights by selecting the cities involved. We will create a new
567620
user story to sort the airports listed in the booking form in alphabetical order by city. Ordinarily we would create the user
568-
story at a higher level and add tasks to define how the story is to be implemented, but for our demo purposes here we'll leave it as a
569-
single work item.
621+
story at a higher level and add tasks to define how the story is to be implemented, but for our demo purposes here we'll leave it as
622+
a single work item.
570623

571624
3. Click **New Work Item** and add a user story with the title **"User
572625
can select airport by city"**. Press **Enter** to create.
573626

574627
![](./images/image77.png)
575628

576-
\> In addition to working with work items in a backlog, we have a very flexible Kanban board option. With the
629+
In addition to working with work items in a backlog, we have a very flexible Kanban board option. With the
577630
board, we can edit items on a card in line, or even drag cards around to change their state and assignment. Let's take ownership of
578631
the new user story so we can begin work.
579632

@@ -591,7 +644,7 @@ custom reporting. By connecting Azure Boards with GitHub repositories, teams can
591644

592645
![](./images/image80.png)
593646

594-
\> In order to complete our integration, we'll need to wire up a connection between this project and the GitHub repo.
647+
In order to complete our integration, we'll need to wire up a connection between this project and the GitHub repo.
595648

596649
7. Click **Project settings**.
597650

@@ -609,7 +662,7 @@ custom reporting. By connecting Azure Boards with GitHub repositories, teams can
609662

610663
![](./images/image84.png)
611664

612-
\> Let's take a look at our deployed site to see
665+
Let's take a look at our deployed site to see
613666
what the current booking experience is like. As you can see, the
614667
airports appear to be sorted by airport code, which isn't the
615668
behavior we want our users to see.
@@ -642,7 +695,7 @@ Task 8 -- Committing to Complete a Task
642695

643696
1. Return to **Visual Studio Code**.
644697

645-
\> We'll start off by creating a new branch for this
698+
We'll start off by creating a new branch for this
646699
task. The work itself is pretty straightforward. We just need to
647700
locate the place where airports are provided to the user experience
648701
and make sure they're being sorted by city name.
@@ -685,7 +738,7 @@ Task 8 -- Committing to Complete a Task
685738

686739
7. Press **Ctrl+S** to save the file.
687740

688-
\> We'll skip testing this locally for the sake of
741+
We'll skip testing this locally for the sake of
689742
the demo. Instead, we'll commit it using a comment that includes
690743
special syntax to link it to the Azure Boards task we saw earlier.
691744
Now this commit will become trackable from project management, as
@@ -706,7 +759,7 @@ Task 8 -- Committing to Complete a Task
706759

707760
10. When the push has completed, return to the GitHub browser tab.
708761

709-
\> With the commit pushed, we'll create a pull
762+
With the commit pushed, we'll create a pull
710763
request to drive those changes back into the master branch. In this
711764
case we're inheriting the title from the commit, but having the pull
712765
request mention "Fixes AB\#ID" will link and complete the target
@@ -732,7 +785,7 @@ Task 8 -- Committing to Complete a Task
732785

733786
14. Return to Visual Studio Code.
734787

735-
\> Now we'll switch to the other side of the pull
788+
Now we'll switch to the other side of the pull
736789
request and take on the role of reviewer. We can use Visual Studio
737790
Code to check out the pull request, analyze changes, and comment.
738791
Assuming we trust the fix, we can merge the pull request to update
@@ -764,7 +817,7 @@ Task 8 -- Committing to Complete a Task
764817
![](./images/image103.png)
765818

766819

767-
\> Once the deployment works its way through build
820+
Once the deployment works its way through build
768821
and release, we can confirm the new functionality.
769822

770823
20. Follow the CI/CD pipeline through to completion.
@@ -778,7 +831,7 @@ Task 8 -- Committing to Complete a Task
778831

779832
22. Return to the Azure DevOps tab open to the Kanban board.
780833

781-
\> Since the user story we were working on was
834+
Since the user story we were working on was
782835
linked in a pull request that was approved, Azure DevOps will
783836
automatically transition the state of the work item to "Closed". You
784837
can also see that the related GitHub commits and pull request were

0 commit comments

Comments
 (0)