From e63f67d335efef91930e274f9703d76e0d363099 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 17 Oct 2019 13:25:28 +0800 Subject: Update CI. --- CI/build-pipeline.yml | 35 ----------------------- CI/release-pipeline.yml | 53 ---------------------------------- azure-pipelines.yml | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 88 deletions(-) delete mode 100644 CI/build-pipeline.yml delete mode 100644 CI/release-pipeline.yml create mode 100644 azure-pipelines.yml diff --git a/CI/build-pipeline.yml b/CI/build-pipeline.yml deleted file mode 100644 index 85b373ff..00000000 --- a/CI/build-pipeline.yml +++ /dev/null @@ -1,35 +0,0 @@ -trigger: -- master - -variables: - buildConfiguration: 'Debug' - ASPNETCORE_ENVIRONMENT: 'Development' - -pool: - vmImage: 'Ubuntu-16.04' - -steps: -- task: UseDotNet@2 - inputs: - packageType: sdk - version: 2.2.x - -- script: | - dotnet restore Timeline/Timeline.csproj --configfile nuget.config - dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config - displayName: Dotnet Restore - -- script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage" --settings './coverletArgs.runsettings' - displayName: Dotnet Test - -- task: PublishTestResults@2 - condition: succeededOrFailed() - inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' - -- task: PublishCodeCoverageResults@1 - condition: succeededOrFailed() - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: '**/TestResults/*/coverage.cobertura.xml' diff --git a/CI/release-pipeline.yml b/CI/release-pipeline.yml deleted file mode 100644 index f3434a36..00000000 --- a/CI/release-pipeline.yml +++ /dev/null @@ -1,53 +0,0 @@ -trigger: -- master - -pr: none - -stages: -- stage: Build - variables: - buildConfiguration: 'Release' - ASPNETCORE_ENVIRONMENT: 'Development' - jobs: - - job: Build - pool: - vmImage: 'Ubuntu-16.04' - steps: - - script: | - dotnet restore Timeline/Timeline.csproj --configfile nuget.config - dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config - displayName: Dotnet Restore - - - script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx - displayName: Dotnet Test - - - task: PublishTestResults@2 - condition: succeededOrFailed() - inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' - - - script: dotnet publish Timeline/Timeline.csproj --configuration $(buildConfiguration) --no-restore --output ./publish/ - displayName: Dotnet Publish - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'timeline' - targetPath: Timeline/publish - -- stage: Deploy - jobs: - - deployment: Deploy - pool: - name: 'Default' - environment: 'timeline-server' - strategy: - runOnce: - deploy: - steps: - - script: | - rm -rf /var/timeline/* - cp -r $PIPELINE_WORKSPACE/timeline/. /var/timeline/ - sudo systemctl restart timeline.service - displayName: 'Command Line Script' - failOnStderr: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..6078b1ff --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,76 @@ +trigger: +- master + +stages: +- stage: build + displayName: Routine Build and Test + + jobs: + - job: build + pool: + vmImage: 'ubuntu-18.04' + variables: + buildConfiguration: 'Debug' + ASPNETCORE_ENVIRONMENT: 'Development' + steps: + - task: UseDotNet@2 + inputs: + packageType: sdk + version: 2.2.x + + - script: | + dotnet restore Timeline/Timeline.csproj --configfile nuget.config + dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config + displayName: Dotnet Restore + + - script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage" --settings './coverletArgs.runsettings' + displayName: Dotnet Test + + - task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testRunner: VSTest + testResultsFiles: '**/*.trx' + + - task: PublishCodeCoverageResults@1 + condition: succeededOrFailed() + inputs: + codeCoverageTool: 'Cobertura' + summaryFileLocation: '**/TestResults/*/coverage.cobertura.xml' + +- stage: deploy + displayName: Build Release and Deploy + variables: + buildConfiguration: 'Release' + + jobs: + - job: build + displayName: Build Release Artifact + pool: + vmImage: 'ubuntu-18.04' + steps: + - script: dotnet publish Timeline/Timeline.csproj --configuration $(buildConfiguration) --output ./publish/ + displayName: Dotnet Publish + + - task: PublishPipelineArtifact@1 + inputs: + artifactName: 'timeline' + targetPath: Timeline/publish + + - deployment: deploy + displayName: Deploy to Server + pool: + name: 'Default' + environment: 'timeline-server' + dependsOn: build + strategy: + runOnce: + deploy: + steps: + - script: | + rm -rf /var/timeline/* + cp -r $PIPELINE_WORKSPACE/timeline/. /var/timeline/ + sudo systemctl restart timeline.service + displayName: 'Copy Files and Restart Service' + failOnStderr: true + -- cgit v1.2.3 From ee612ce0348dade84abf5d196fc641c05ed366ff Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 17 Oct 2019 14:05:03 +0800 Subject: Update CI. --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6078b1ff..e696b6a9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,6 +7,7 @@ stages: jobs: - job: build + displayName: Build Debug and Test pool: vmImage: 'ubuntu-18.04' variables: @@ -16,7 +17,7 @@ stages: - task: UseDotNet@2 inputs: packageType: sdk - version: 2.2.x + version: 3.x - script: | dotnet restore Timeline/Timeline.csproj --configfile nuget.config @@ -40,6 +41,7 @@ stages: - stage: deploy displayName: Build Release and Deploy + dependsOn: build variables: buildConfiguration: 'Release' -- cgit v1.2.3 From f2c2b4e43216a5c30dba05cf75208167b06fdbbc Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 17 Oct 2019 14:06:43 +0800 Subject: ... --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e696b6a9..7fcf898f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ stages: - task: UseDotNet@2 inputs: packageType: sdk - version: 3.x + version: 2.x - script: | dotnet restore Timeline/Timeline.csproj --configfile nuget.config -- cgit v1.2.3 From 9f575113a883497210ccc4b888ae04e60934c5df Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 17 Oct 2019 14:07:37 +0800 Subject: ... --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7fcf898f..c77485a5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ stages: - task: UseDotNet@2 inputs: packageType: sdk - version: 2.x + version: 3.0.x - script: | dotnet restore Timeline/Timeline.csproj --configfile nuget.config -- cgit v1.2.3 From ac067b3c0354e381a0f881fae8e478aa2e2572a8 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 17 Oct 2019 14:16:06 +0800 Subject: Update CI. --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c77485a5..9b8a5fdb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,7 +24,7 @@ stages: dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config displayName: Dotnet Restore - - script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage" --settings './coverletArgs.runsettings' + - script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage" --settings './Timeline.Tests/coverletArgs.runsettings' displayName: Dotnet Test - task: PublishTestResults@2 @@ -51,7 +51,7 @@ stages: pool: vmImage: 'ubuntu-18.04' steps: - - script: dotnet publish Timeline/Timeline.csproj --configuration $(buildConfiguration) --output ./publish/ + - script: dotnet publish Timeline/Timeline.csproj --configuration $(buildConfiguration) --output ./Timeline/publish/ displayName: Dotnet Publish - task: PublishPipelineArtifact@1 -- cgit v1.2.3