From f9224fac9d2fd6b3b4fc95ebfdad2420babfb9df Mon Sep 17 00:00:00 2001 From: IvanCardel <48393219+IvanCardel@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:03:12 -0600 Subject: [PATCH 1/6] Set up CI with Azure Pipelines --- azure-pipelines.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..3a2d11f8 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,24 @@ +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' \ No newline at end of file From 29af96de1dff4a8bfc6753f19c7c6b831b56cd5f Mon Sep 17 00:00:00 2001 From: IvanCardel <48393219+IvanCardel@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:16:45 -0600 Subject: [PATCH 2/6] updatepipelinesbatch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba478ab9..8ea767c4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - +[![Build Status](https://dev.azure.com/jics0804930955/jics080493/_apis/build/status/IvanCardel.ContosoAir?branchName=master)](https://dev.azure.com/jics0804930955/jics080493/_build/latest?definitionId=1&branchName=master) # Microsoft.Github CI Demo From 1f5732fb85edbfd575b0929dbc9647a4d9955328 Mon Sep 17 00:00:00 2001 From: IvanCardel <48393219+IvanCardel@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:28:32 -0600 Subject: [PATCH 3/6] Update azure-pipelines.yml --- azure-pipelines.yml | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3a2d11f8..2e3a5a5d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,24 +1,36 @@ 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' \ No newline at end of file + displayName: 'Publish Artifact: drop' From 0f03361a7788531061ee65c7b6f474b23374fc5a Mon Sep 17 00:00:00 2001 From: IvanCardel <48393219+IvanCardel@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:30:15 -0600 Subject: [PATCH 4/6] Update azure-pipelines.yml From e946276fe06c113b14ba138903170d694c47fdcf Mon Sep 17 00:00:00 2001 From: IvanCardel <48393219+IvanCardel@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:58:24 -0600 Subject: [PATCH 5/6] Change airport sorting. Fixes AB#1. --- src/services/airports.service.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/airports.service.js b/src/services/airports.service.js index f9af6ab4..9be5cdbf 100644 --- a/src/services/airports.service.js +++ b/src/services/airports.service.js @@ -7,13 +7,15 @@ class AirportsService { this._airports = airports; } + 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) { return avoidEmptyCity(this._airports.find(a => a.code == code)); } } -module.exports = AirportsService; \ No newline at end of file +module.exports = AirportsService; From 3f852e57864b60d918e42e301de5735f500567ff Mon Sep 17 00:00:00 2001 From: IvanCardel <48393219+IvanCardel@users.noreply.github.com> Date: Sat, 9 Mar 2019 16:06:52 -0600 Subject: [PATCH 6/6] Changes airport sorting. Fixes AB#1. --- 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 9be5cdbf..640ee606 100644 --- a/src/services/airports.service.js +++ b/src/services/airports.service.js @@ -7,11 +7,11 @@ class AirportsService { this._airports = airports; } - getAll(){ return this._airports.filter(a => a.code).map(avoidEmptyCity).sort((a, b) => (a.city > b.city) ? 1 : -1); } + getByCode(code) { return avoidEmptyCity(this._airports.find(a => a.code == code));