From cd77338887776a5af4a68645c793285d8a4377db Mon Sep 17 00:00:00 2001 From: ritascosta <44296975+ritascosta@users.noreply.github.com> Date: Wed, 6 Mar 2019 17:20:24 +0000 Subject: [PATCH 1/6] Set up CI with Azure Pipelines --- azure-pipelines.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..973b52db --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,29 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +pool: + vmImage: 'ubuntu-16.04' +trigger: + - master +steps: + - task: CopyFiles@2 + displayName: 'Copy Files to: $(build.artifactstagingdirectory)/Templates' + inputs: + SourceFolder: deployment + Contents: '*.json' + TargetFolder: '$(build.artifactstagingdirectory)/Templates' + - task: Npm@1 + displayName: 'npm custom' + inputs: + command: custom + verbose: false + customCommand: 'install --production' + - task: ArchiveFiles@2 + displayName: 'Archive $(Build.SourcesDirectory)' + inputs: + rootFolderOrFile: '$(Build.SourcesDirectory)' + includeRootFolder: false + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' From 2ffb592914f440c1568ee3daa590a0018c1426c4 Mon Sep 17 00:00:00 2001 From: Rita Silveira da Costa Date: Wed, 6 Mar 2019 17:26:16 +0000 Subject: [PATCH 2/6] Added build status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba478ab9..c7fcb826 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[![Build Status](https://dev.azure.com/risilvei/GitHub/_apis/build/status/ritascosta.ContosoAir?branchName=master)](https://dev.azure.com/risilvei/GitHub/_build/latest?definitionId=26&branchName=master) # Microsoft.Github CI Demo From 21f79057adffc3d8e4161c04ad3a93ac134606c7 Mon Sep 17 00:00:00 2001 From: Rita Silveira da Costa Date: Wed, 6 Mar 2019 17:36:13 +0000 Subject: [PATCH 3/6] Updated build pipeline --- azure-pipelines.yml | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 973b52db..c20ffdaf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,26 +4,38 @@ # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript pool: - vmImage: 'ubuntu-16.04' + vmImage: ubuntu-16.04 trigger: - master steps: - - task: CopyFiles@2 - displayName: 'Copy Files to: $(build.artifactstagingdirectory)/Templates' - inputs: - SourceFolder: deployment - Contents: '*.json' - TargetFolder: '$(build.artifactstagingdirectory)/Templates' - task: Npm@1 - displayName: 'npm custom' inputs: - command: custom - verbose: false - customCommand: 'install --production' + command: install + - script: 'npm test' + displayName: 'Run unit tests' + continueOnError: true + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: succeededOrFailed() + inputs: + testResultsFiles: $(System.DefaultWorkingDirectory)/test-report.xml + - task: PublishCodeCoverageResults@1 + displayName: 'Publish Code Coverage' + condition: 'in(variables[''Agent.JobStatus''], ''Succeeded'')' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/*coverage.xml' + reportDirectory: $(System.DefaultWorkingDirectory)/coverage - task: ArchiveFiles@2 - displayName: 'Archive $(Build.SourcesDirectory)' + displayName: 'Archive sources' inputs: - rootFolderOrFile: '$(Build.SourcesDirectory)' + rootFolderOrFile: $(Build.SourcesDirectory) includeRootFolder: false + - task: CopyFiles@2 + displayName: 'Copy ARM templates' + inputs: + SourceFolder: deployment + Contents: '*.json' + TargetFolder: $(build.artifactstagingdirectory)/Templates - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' From 9430e7276b94120120a2cb0bf1b3f2a160625fd9 Mon Sep 17 00:00:00 2001 From: Rita Silveira da Costa Date: Wed, 6 Mar 2019 18:00:50 +0000 Subject: [PATCH 4/6] Alterei Airport Sorting --- src/services/airports.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/airports.service.js b/src/services/airports.service.js index f9af6ab4..276444bc 100644 --- a/src/services/airports.service.js +++ b/src/services/airports.service.js @@ -8,7 +8,7 @@ class AirportsService { } getAll(){ - return this._airports.filter(a => a.code).map(avoidEmptyCity); + return this._airports.filter(a => a.code).map(avoidEmptyCity).sort((a, b) => (a.city > b.city) ? 1 : -1); } getByCode(code) { From eb1a2a45ad7582d8ad10593f949b2e82bc3e4695 Mon Sep 17 00:00:00 2001 From: Rita Silveira da Costa Date: Wed, 6 Mar 2019 18:02:32 +0000 Subject: [PATCH 5/6] Changes airport sorting. Fixes AB#684. --- src/services/airports.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/airports.service.js b/src/services/airports.service.js index 276444bc..cf5cb233 100644 --- a/src/services/airports.service.js +++ b/src/services/airports.service.js @@ -16,4 +16,5 @@ class AirportsService { } } -module.exports = AirportsService; \ No newline at end of file +module.exports = AirportsService; +//end From c453c92cb0758ef3a1b45d952b1b6236b93e50b6 Mon Sep 17 00:00:00 2001 From: ritascosta <44296975+ritascosta@users.noreply.github.com> Date: Mon, 11 Mar 2019 22:49:31 +0000 Subject: [PATCH 6/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c7fcb826..87b87ead 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Build Status](https://dev.azure.com/risilvei/GitHub/_apis/build/status/ritascosta.ContosoAir?branchName=master)](https://dev.azure.com/risilvei/GitHub/_build/latest?definitionId=26&branchName=master) +Rita # Microsoft.Github CI Demo