Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add az pipepline yaml #247

Merged
merged 3 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
jobs:

- job: Build
pool:
vmImage: 'VS2017-Win2016'


steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore

- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
projects: '**/*.sln'

# - task: MSBuild@1
# displayName: 'Build solution **/*.sln'
# inputs:
# msbuildArchitecture: x64

# configuration: Release

# - task: VSTest@2
# displayName: 'VsTest - testAssemblies'
# inputs:
# testAssemblyVer2: |
# tests\**\*Tests*.dll
# !**\obj\**

# codeCoverageEnabled: true

- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: tests\**\*.csproj
arguments: /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

- task: PublishCodeCoverageResults@1
displayName: 'publish coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml'

- task: alanwales.resharper-code-analysis.custom-build-task.ResharperCli@1
displayName: 'Automated code quality checks'
inputs:
SolutionOrProjectPath: 'kubernetes-client.sln'

FailBuildOnCodeIssues: false

continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
inputs:
command: pack
packagesToPack: src/KubernetesClient/KubernetesClient.csproj
packDirectory: '$(Build.ArtifactStagingDirectory)/nupkg'
majorVersion: 1
minorVersion: 4
versioningScheme: byPrereleaseNumber


- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/nupkg'



2 changes: 1 addition & 1 deletion src/KubernetesClient/KubernetesClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageTags>kubernetes;docker;containers;</PackageTags>

<TargetFrameworks>netstandard1.4;net452;netcoreapp2.1;xamarinios10;monoandroid81</TargetFrameworks>
<TargetFrameworks Condition="'$(TF_BUILD)' == 'True'">netstandard1.4;net452;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.4;netcoreapp2.1</TargetFrameworks>
<RootNamespace>k8s</RootNamespace>
<SignAssembly>true</SignAssembly>
Expand All @@ -20,7 +21,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="1.1.2" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.33" PrivateAssets="all" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to azure pipeline versioning

  - task: DotNetCoreCLI@2
    displayName: 'dotnet pack'
    inputs:
      command: pack
      packagesToPack: src/KubernetesClient/KubernetesClient.csproj
      packDirectory: '$(Build.ArtifactStagingDirectory)/nupkg'
      majorVersion: 1
      minorVersion: 4      
      versioningScheme: byPrereleaseNumber
 this will generate a SemVer -compliant version formatted as X.Y.Z-ci-datetime where you choose X, Y, and Z.

The pro for generating version when CI is that it differentiate build and commit .
Same commit might be different due to build environment changed.

<PackageReference Include="Portable.BouncyCastle" Version="1.8.1.3" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="1.1.2" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
Expand Down
6 changes: 6 additions & 0 deletions tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
</ItemGroup>

<ItemGroup>

<PackageReference Include="coverlet.msbuild" Version="2.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" NoWarn="NU1701" />
Expand Down
7 changes: 0 additions & 7 deletions version.json

This file was deleted.