diff --git a/README.md b/README.md index 80ef5ab6193..358447d8987 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ +[![Build Status](https://dev.azure.com/AddactTech/SpaceGameGIT/_apis/build/status/ksbhatt1107.mslearn-tailspin-spacegame-web?branchName=master)](https://dev.azure.com/AddactTech/SpaceGameGIT/_build/latest?definitionId=3&branchName=master) + # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a diff --git a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml index f7c4c886074..de1287f0302 100644 --- a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml +++ b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml @@ -5,7 +5,7 @@
Space Game -

An example site for learning

+

Welcome to the official Space Game Site!

diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000000..67e19d31c13 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,64 @@ +pool: + vmImage: 'MyAgentPool' + demands: + - npm + +variables: + buildConfiguration: 'Release' + 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 + +- template: templates/build.yml + parameters: + buildConfiguration: 'Debug' + +- template: templates/build.yml + parameters: + buildConfiguration: 'Release' + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' + condition: succeeded() \ No newline at end of file diff --git a/templates/build.yml b/templates/build.yml new file mode 100644 index 00000000000..adb464a80a7 --- /dev/null +++ b/templates/build.yml @@ -0,0 +1,19 @@ +parameters: + buildConfiguration: 'Release' + +steps: +- task: DotNetCoreCLI@2 + displayName: 'Build the project - ${{ parameters.buildConfiguration }}' + inputs: + command: 'build' + arguments: '--no-restore --configuration ${{ parameters.buildConfiguration }}' + projects: '**/*.csproj' + +- task: DotNetCoreCLI@2 + displayName: 'Publish the project - ${{ parameters.buildConfiguration }}' + inputs: + command: 'publish' + projects: '**/*.csproj' + publishWebProjects: false + arguments: '--no-build --configuration ${{ parameters.buildConfiguration }} --output $(Build.ArtifactStagingDirectory)/${{ parameters.BuildConfiguration }}' + zipAfterPublish: true \ No newline at end of file