Created
June 8, 2019 00:32
-
-
Save nathanwoulfe/d7a67592ca07e79810e3184475c9e754 to your computer and use it in GitHub Desktop.
DevOps pipeline config for Umbraco package CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
- master | |
- refs/tags/v* | |
pool: | |
vmImage: 'windows-latest' | |
variables: | |
solution: '**/Plumber8.sln' | |
buildPlatform: 'Any CPU' | |
buildConfiguration: 'Release' | |
buildVersion: '1.0.0' | |
buildBranch: 'master' | |
packageSuffix: 'beta' | |
steps: | |
- task: Bash@3 | |
displayName: 'Set environment variables' | |
inputs: | |
targetType: 'inline' | |
script: | | |
echo "##vso[task.setvariable variable=UMBRACO_PACKAGE_MIN_VERSION]$(System.UmbracoPackageMinVersion)" | |
echo "##vso[task.setvariable variable=BUILD_VERSION]$(buildVersion).$(Build.BuildId)" | |
echo "##vso[task.setvariable variable=REPO_TAG]'false'" | |
echo "##vso[task.setvariable variable=UMBRACO_PACKAGE_PRERELEASE_SUFFIX]$(packageSuffix)" | |
echo "##vso[task.setvariable variable=BUILD_NUMBER]$(Build.BuildId)" | |
# install npm packages for web project | |
- task: Npm@1 | |
displayName: 'Install NPM depenencies' | |
inputs: | |
command: 'install' | |
workingDir: 'Plumber.Web' | |
- task: Grunt@0 | |
displayName: 'Run default Grunt task' | |
inputs: | |
gruntFile: 'Plumber.Web/Gruntfile.js' | |
targets: 'default' | |
arguments: '--buildversion=$(buildVersion) --buildbranch=$(buildBranch) --packagesuffix=$(packageSuffix)' | |
gruntCli: 'node_modules/grunt-cli/bin/grunt' | |
# install nuget tooling | |
- task: NuGetToolInstaller@0 | |
# restore nuget packages for solution | |
- task: NuGetCommand@2 | |
displayName: 'Restore nuget packages for solution' | |
inputs: | |
restoreSolution: '$(solution)' | |
# build it | |
- task: MSBuild@1 | |
displayName: 'Build the sucker' | |
inputs: | |
solution: 'BuildPackage/package.proj' | |
# test it | |
- task: PowerShell@2 | |
displayName: 'Make sure it all works' | |
inputs: | |
filePath: 'Plumber.Testing/RunTests.ps1' | |
- task: PublishCodeCoverageResults@1 | |
inputs: | |
codeCoverageTool: 'Cobertura' | |
summaryFileLocation: '**/coverage.cobertura.xml' | |
- task: PublishTestResults@2 | |
inputs: | |
testResultsFormat: 'VSTest' | |
testResultsFiles: '**/TestResults/*.trx' | |
- task: CopyFiles@2 | |
displayName: 'Copy package files from BuildPackage/artifacts to staging directory' | |
inputs: | |
SourceFolder: 'BuildPackage/artifacts' | |
Contents: '*.*' | |
TargetFolder: '$(Build.ArtifactStagingDirectory)' | |
CleanTargetFolder: true | |
OverWrite: true | |
- task: PublishPipelineArtifact@0 | |
displayName: 'Publish zip and nuget from staging directory' | |
inputs: | |
artifactName: 'drop' | |
targetPath: '$(Build.ArtifactStagingDirectory)' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment