aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-17 15:13:52 +0800
committer杨宇千 <crupest@outlook.com>2019-10-17 15:13:52 +0800
commit9c2937a7fdfe5948096b8a6a6c60a68bb2f845bc (patch)
tree51d130013decea0170820fa17566fb52411dfc31
parentea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33 (diff)
parent055f30e7a9cab639da64518c5098bd369d2be22e (diff)
downloadtimeline-9c2937a7fdfe5948096b8a6a6c60a68bb2f845bc.tar.gz
timeline-9c2937a7fdfe5948096b8a6a6c60a68bb2f845bc.tar.bz2
timeline-9c2937a7fdfe5948096b8a6a6c60a68bb2f845bc.zip
Merge branch 'master' into migrate-v3
-rw-r--r--CI/build-pipeline.yml35
-rw-r--r--CI/release-pipeline.yml53
-rw-r--r--azure-pipelines.yml78
3 files changed, 78 insertions, 88 deletions
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..9b8a5fdb
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,78 @@
+trigger:
+- master
+
+stages:
+- stage: build
+ displayName: Routine Build and Test
+
+ jobs:
+ - job: build
+ displayName: Build Debug and Test
+ pool:
+ vmImage: 'ubuntu-18.04'
+ variables:
+ buildConfiguration: 'Debug'
+ ASPNETCORE_ENVIRONMENT: 'Development'
+ steps:
+ - task: UseDotNet@2
+ inputs:
+ packageType: sdk
+ version: 3.0.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 './Timeline.Tests/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
+ dependsOn: build
+ 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 ./Timeline/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
+