Skip to content

Commit

Permalink
Extract build template, refactor CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetseckin committed Feb 22, 2020
1 parent c4ea9e0 commit e4b0719
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 17 deletions.
26 changes: 9 additions & 17 deletions pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
name: 1.2.0.$(build.buildId)
variables:
version: '1.2.0'

name: $(version)$(rev:.r)

trigger:
- master

pool:
vmImage: 'windows-latest'
pr:
- master

stages:
- stage: "build_stage"
jobs:
- job: "build_job"
steps:
- task: Npm@1
displayName: "Run 'npm install'"
inputs:
command: 'install'
workingDir: 'src\'
- task: VSBuild@1
displayName: "Build"
inputs:
solution: 'src\Solutions\Solutions.cdsproj'
msbuildArgs: '/t:build /restore'
- template: templates/stages/build.yml
parameters:
name: 'ci_build'
33 changes: 33 additions & 0 deletions pipelines/templates/stages/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
name: 'build'
configuration: 'Debug' # 'Debug' or 'Release'
publish: false # true if artifacts need to be published
dependsOn: []

stages:
- stage: '${{ parameters.name }}'

variables:
artifactName: 'Solutions'
artifactPath: 'src\Solutions\bin\${{ parameters.configuration }}\*.zip'

dependsOn: ${{ parameters.dependsOn }}
jobs:
- job: '${{ parameters.name }}_job'
pool:
vmImage: 'windows-latest'
steps:
- task: Npm@1
displayName: "Run 'npm install'"
inputs:
command: 'install'
workingDir: 'src\'
- task: VSBuild@1
displayName: "Build"
inputs:
solution: 'src\Solutions\Solutions.cdsproj'
msbuildArgs: '/t:build /p:configuration=${{ parameters.configuration }} /restore'
- publish: '$(artifactPath)'
displayName: 'Publishing $(artifactName)'
artifact: '$(artifactName)'
condition: and(succeeded(), eq(${{ parameters.publish }}, true))

0 comments on commit e4b0719

Please sign in to comment.