From 75b4a799265df729fc5c84c8362d4043a5bb01ef Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 19:26:55 +0530 Subject: [PATCH 01/20] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..10bb8b96d3 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,17 @@ +# ASP.NET Core +# Build and test ASP.NET Core projects targeting .NET Core. +# Add steps that run tests, create a NuGet package, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core + +trigger: +- master + +pool: + vmImage: ubuntu-latest + +variables: + buildConfiguration: 'Release' + +steps: +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' From 6a30003bf95653fc15b7085ede96a72f482df6bf Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 19:41:05 +0530 Subject: [PATCH 02/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 10bb8b96d3..c18e037122 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,6 +12,30 @@ pool: variables: buildConfiguration: 'Release' -steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +stages: + - stage: build + jobs: + - job: build + displayName: build pipeline-dotnet-core + continueOnError: false + steps: + - script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' + + - task: DotNetCoreCLI@2 + inputs: + command: 'pack' + packagesToPack: '**/*.csproj' + includesymbols: true + versioningScheme: 'off' + + - task: DotNetCoreCLI@2 + inputs: + command: 'publish' + publishWebProjects: true + + # - task: PublishBuildArtifacts@1 + # inputs: + # PathtoPublish: '$(Build.ArtifactStagingDirectory)' + # ArtifactName: 'drop' + # publishLocation: 'Container' \ No newline at end of file From 241d9a18a5e0a2ebd12f899cc3e2686a976e15b8 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 19:44:03 +0530 Subject: [PATCH 03/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c18e037122..349e49cb0a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,13 +29,14 @@ stages: includesymbols: true versioningScheme: 'off' - - task: DotNetCoreCLI@2 - inputs: - command: 'publish' - publishWebProjects: true - - # - task: PublishBuildArtifacts@1 + # - task: DotNetCoreCLI@2 # inputs: - # PathtoPublish: '$(Build.ArtifactStagingDirectory)' - # ArtifactName: 'drop' - # publishLocation: 'Container' \ No newline at end of file + # command: 'publish' + # publishWebProjects: true + + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' \ No newline at end of file From cc2fd233f21bb525f216b7461fada8e214d4299b Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 19:57:39 +0530 Subject: [PATCH 04/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 349e49cb0a..306d1fb522 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,24 +19,27 @@ stages: displayName: build pipeline-dotnet-core continueOnError: false steps: - - script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' - - - task: DotNetCoreCLI@2 - inputs: - command: 'pack' - packagesToPack: '**/*.csproj' - includesymbols: true - versioningScheme: 'off' - # - task: DotNetCoreCLI@2 # inputs: - # command: 'publish' - # publishWebProjects: true + # command: 'restore' + # feedsToUse: 'select' + # vstsFeed: 'my-vsts-feed' # A series of numbers and letters + - task: DotNetCoreCLI@2 + inputs: + command: 'build' + arguments: '--configuration $(buildConfiguration)' + displayName: 'dotnet build $(buildConfiguration)' + + - task: DotNetCoreCLI@2 + inputs: + command: publish + publishWebProjects: True + arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' + zipAfterPublish: True - - task: PublishBuildArtifacts@1 + # this code takes all the files in $(Build.ArtifactStagingDirectory) and uploads them as an artifact of your build. + - task: PublishPipelineArtifact@1 inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' - publishLocation: 'Container' \ No newline at end of file + targetPath: '$(Build.ArtifactStagingDirectory)' + artifactName: 'myWebsiteName' \ No newline at end of file From eb1cd3c827beaaa4e79de52234d6d883775a8336 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 20:03:00 +0530 Subject: [PATCH 05/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 306d1fb522..5dc5801f11 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,6 +5,7 @@ trigger: - master +- feature/* pool: vmImage: ubuntu-latest @@ -19,19 +20,15 @@ stages: displayName: build pipeline-dotnet-core continueOnError: false steps: - # - task: DotNetCoreCLI@2 - # inputs: - # command: 'restore' - # feedsToUse: 'select' - # vstsFeed: 'my-vsts-feed' # A series of numbers and letters - - task: DotNetCoreCLI@2 + displayName: build inputs: command: 'build' arguments: '--configuration $(buildConfiguration)' displayName: 'dotnet build $(buildConfiguration)' - task: DotNetCoreCLI@2 + displayName: publish inputs: command: publish publishWebProjects: True @@ -40,6 +37,7 @@ stages: # this code takes all the files in $(Build.ArtifactStagingDirectory) and uploads them as an artifact of your build. - task: PublishPipelineArtifact@1 + displayName: publish artifact to myWebsiteName inputs: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: 'myWebsiteName' \ No newline at end of file From 4fd8d4e6dd0e8ffefb2a01acc37d023cdc8731c6 Mon Sep 17 00:00:00 2001 From: satendra singh Date: Sat, 6 Aug 2022 20:48:38 +0530 Subject: [PATCH 06/20] feature branch changes --- Views/Home/Index.cshtml | 1 + 1 file changed, 1 insertion(+) diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index d2d19bdf9f..f630c04a7d 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -5,4 +5,5 @@

Welcome

Learn about building Web apps with ASP.NET Core.

+

This is from feature branch

From 61bd86a9bc6d0afb71153acbf705222bc94f56d3 Mon Sep 17 00:00:00 2001 From: satendra singh Date: Sat, 6 Aug 2022 22:06:55 +0530 Subject: [PATCH 07/20] feature branch changes 1 --- Views/Home/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index f630c04a7d..8f661f317b 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -5,5 +5,5 @@

Welcome

Learn about building Web apps with ASP.NET Core.

-

This is from feature branch

+

This is from feature branch branch

From 9446cd1c991ba731ec007325546cee4844ed7236 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 22:10:52 +0530 Subject: [PATCH 08/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5dc5801f11..831eef430c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,6 +37,7 @@ stages: # this code takes all the files in $(Build.ArtifactStagingDirectory) and uploads them as an artifact of your build. - task: PublishPipelineArtifact@1 + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) displayName: publish artifact to myWebsiteName inputs: targetPath: '$(Build.ArtifactStagingDirectory)' From 346669845ec0e4f75d0d7114ae7d5ca6ceb1ece0 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 22:47:37 +0530 Subject: [PATCH 09/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 831eef430c..0173e78344 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,9 +3,15 @@ # Add steps that run tests, create a NuGet package, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core -trigger: -- master -- feature/* +trigger: none +# - master +# - feature/* + +pr: + branches: + include: + - master + - feature/* pool: vmImage: ubuntu-latest @@ -14,7 +20,23 @@ variables: buildConfiguration: 'Release' stages: + - stage: PR + displayName: Pull Request + condition: eq(variables['Build.Reason'], 'PullRequest') + jobs: + - job: build + displayName: build pipeline-dotnet-core + continueOnError: false + steps: + - task: DotNetCoreCLI@2 + displayName: build + inputs: + command: 'build' + arguments: '--configuration $(buildConfiguration)' + displayName: 'dotnet build $(buildConfiguration)' + - stage: build + displayName: Build jobs: - job: build displayName: build pipeline-dotnet-core @@ -29,6 +51,7 @@ stages: - task: DotNetCoreCLI@2 displayName: publish + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) inputs: command: publish publishWebProjects: True From a774ddbf25098edc2a4031b8b9ebf0ca40e1be6c Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 22:51:17 +0530 Subject: [PATCH 10/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0173e78344..8695da2e88 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,7 @@ variables: stages: - stage: PR - displayName: Pull Request + displayName: Pull Request Stage condition: eq(variables['Build.Reason'], 'PullRequest') jobs: - job: build @@ -36,7 +36,7 @@ stages: displayName: 'dotnet build $(buildConfiguration)' - stage: build - displayName: Build + displayName: Build Stage jobs: - job: build displayName: build pipeline-dotnet-core From 9c80d8dc289b2774cd03088ac946b53c574cb1f0 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 22:56:06 +0530 Subject: [PATCH 11/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8695da2e88..52fe434fb6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,7 +51,6 @@ stages: - task: DotNetCoreCLI@2 displayName: publish - condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) inputs: command: publish publishWebProjects: True From 6a2f775f3081c8cd57c98265609bcd6179588afa Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:02:40 +0530 Subject: [PATCH 12/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 52fe434fb6..86504d1813 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,6 +21,7 @@ variables: stages: - stage: PR + dependsOn: none displayName: Pull Request Stage condition: eq(variables['Build.Reason'], 'PullRequest') jobs: From 0414405e5ef1833aceb6c5888e480ac888b26d34 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:03:18 +0530 Subject: [PATCH 13/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 86504d1813..3c616ed219 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,6 @@ variables: stages: - stage: PR - dependsOn: none displayName: Pull Request Stage condition: eq(variables['Build.Reason'], 'PullRequest') jobs: @@ -38,6 +37,7 @@ stages: - stage: build displayName: Build Stage + dependsOn: none jobs: - job: build displayName: build pipeline-dotnet-core From 4f8a816119077479109568b90ee8bc125957daa9 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:04:11 +0530 Subject: [PATCH 14/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3c616ed219..52fe434fb6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,7 +37,6 @@ stages: - stage: build displayName: Build Stage - dependsOn: none jobs: - job: build displayName: build pipeline-dotnet-core From 53aa9237757c226324354e2d568f76b476c26993 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:17:40 +0530 Subject: [PATCH 15/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 52fe434fb6..4ba4976449 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,15 +3,13 @@ # Add steps that run tests, create a NuGet package, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core -trigger: none -# - master -# - feature/* +trigger: + - feature.* pr: branches: include: - master - - feature/* pool: vmImage: ubuntu-latest @@ -37,6 +35,7 @@ stages: - stage: build displayName: Build Stage + condition: eq(variables['Build.SourceBranch'], 'refs/heads/main') jobs: - job: build displayName: build pipeline-dotnet-core @@ -59,7 +58,7 @@ stages: # this code takes all the files in $(Build.ArtifactStagingDirectory) and uploads them as an artifact of your build. - task: PublishPipelineArtifact@1 - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) + # condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) displayName: publish artifact to myWebsiteName inputs: targetPath: '$(Build.ArtifactStagingDirectory)' From 7ecf0bc94210c73cd6071d6fc9d3018c0e1dd53e Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:37:00 +0530 Subject: [PATCH 16/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4ba4976449..ce7e6635a7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,12 @@ # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core trigger: - - feature.* + branches: + include: + - feature/* + tags: + include: + - feature.* pr: branches: From 41f3a3e1f6b307da34c9ddae069dfb22aecfaae0 Mon Sep 17 00:00:00 2001 From: satendra singh Date: Sat, 6 Aug 2022 23:41:18 +0530 Subject: [PATCH 17/20] commit with tag --- Views/Home/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 8f661f317b..36a03a76da 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -5,5 +5,5 @@

Welcome

Learn about building Web apps with ASP.NET Core.

-

This is from feature branch branch

+

This is from feature branch branch with tag

From 1d602207d92ff81318c7e1961326bfd7ede53ce0 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:43:54 +0530 Subject: [PATCH 18/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ce7e6635a7..3be3896a63 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,20 +23,20 @@ variables: buildConfiguration: 'Release' stages: - - stage: PR - displayName: Pull Request Stage - condition: eq(variables['Build.Reason'], 'PullRequest') - jobs: - - job: build - displayName: build pipeline-dotnet-core - continueOnError: false - steps: - - task: DotNetCoreCLI@2 - displayName: build - inputs: - command: 'build' - arguments: '--configuration $(buildConfiguration)' - displayName: 'dotnet build $(buildConfiguration)' + # - stage: PR + # displayName: Pull Request Stage + # condition: eq(variables['Build.Reason'], 'PullRequest') + # jobs: + # - job: build + # displayName: build pipeline-dotnet-core + # continueOnError: false + # steps: + # - task: DotNetCoreCLI@2 + # displayName: build + # inputs: + # command: 'build' + # arguments: '--configuration $(buildConfiguration)' + # displayName: 'dotnet build $(buildConfiguration)' - stage: build displayName: Build Stage @@ -63,7 +63,7 @@ stages: # this code takes all the files in $(Build.ArtifactStagingDirectory) and uploads them as an artifact of your build. - task: PublishPipelineArtifact@1 - # condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) displayName: publish artifact to myWebsiteName inputs: targetPath: '$(Build.ArtifactStagingDirectory)' From bf88203e358b620a2123a02724b0066e74f10436 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:50:02 +0530 Subject: [PATCH 19/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3be3896a63..d59f26bdd1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ trigger: - feature/* tags: include: - - feature.* + - feature/feature.* pr: branches: From e7024f0c2e3700bef509cb7c1dfb32fa672e8fa4 Mon Sep 17 00:00:00 2001 From: Satendra Singh Date: Sat, 6 Aug 2022 23:52:17 +0530 Subject: [PATCH 20/20] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d59f26bdd1..2fcf1ea6d7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,7 +40,7 @@ stages: - stage: build displayName: Build Stage - condition: eq(variables['Build.SourceBranch'], 'refs/heads/main') + #condition: eq(variables['Build.SourceBranch'], 'refs/heads/main') jobs: - job: build displayName: build pipeline-dotnet-core