Created
October 9, 2019 14:25
-
-
Save chadmcrowell/a2e6e66793d7ae148690dd5e194aee54 to your computer and use it in GitHub Desktop.
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
variables: | |
buildConfiguration: 'Release' | |
releaseBranchName: 'release' | |
stages: | |
- stage: 'Build' | |
displayName: 'Build the web application' | |
jobs: | |
- job: 'Build' | |
displayName: 'Build job' | |
pool: | |
vmImage: 'Ubuntu-16.04' | |
demands: | |
- npm | |
variables: | |
wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot' | |
dotnetSdkVersion: '2.1.505' | |
steps: | |
- task: DotNetCoreInstaller@0 | |
displayName: 'Use .NET Core SDK $(dotnetSdkVersion)' | |
inputs: | |
version: '$(dotnetSdkVersion)' | |
- task: Npm@1 | |
displayName: 'Run npm install' | |
inputs: | |
verbose: false | |
- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir)' | |
displayName: 'Compile Sass assets' | |
- task: gulp@1 | |
displayName: 'Run gulp tasks' | |
- script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt' | |
displayName: 'Write build info' | |
workingDirectory: $(wwwrootDir) | |
- task: DotNetCoreCLI@2 | |
displayName: 'Restore project dependencies' | |
inputs: | |
command: 'restore' | |
projects: '**/*.csproj' | |
- task: DotNetCoreCLI@2 | |
displayName: 'Build the project - $(buildConfiguration)' | |
inputs: | |
command: 'build' | |
arguments: '--no-restore --configuration $(buildConfiguration)' | |
projects: '**/*.csproj' | |
- task: DotNetCoreCLI@2 | |
displayName: 'Publish the project - $(buildConfiguration)' | |
inputs: | |
command: 'publish' | |
projects: '**/*.csproj' | |
publishWebProjects: false | |
arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)' | |
zipAfterPublish: true | |
- publish: '$(Build.ArtifactStagingDirectory)' | |
artifact: drop | |
- stage: 'Dev' | |
displayName: 'Deploy to the dev environment' | |
dependsOn: Build | |
condition: | | |
and | |
( | |
succeeded(), | |
eq(variables['Build.SourceBranchName'], variables['releaseBranchName']) | |
) | |
jobs: | |
- deployment: Deploy | |
pool: | |
vmImage: 'Ubuntu-16.04' | |
environment: dev | |
variables: | |
- group: Release | |
strategy: | |
runOnce: | |
deploy: | |
steps: | |
- download: current | |
artifact: drop | |
- task: AzureWebApp@1 | |
displayName: 'Azure App Service Deploy: website' | |
inputs: | |
azureSubscription: 'Resource Manager - Tailspin - Space Game' | |
appName: '$(WebAppNameDev)' | |
package: '$(Pipeline.Workspace)/drop/$(buildConfiguration)/*.zip' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment