-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update packages and build (#69)
* update packages * add build YAML
- Loading branch information
1 parent
45d8360
commit 8eb7e23
Showing
4 changed files
with
271 additions
and
167 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,115 @@ | ||
# Starter pipeline | ||
# Start with a minimal pipeline that you can customize to build and deploy your code. | ||
# Add steps that build, run tests, deploy, and more: | ||
# https://aka.ms/yaml | ||
|
||
trigger: | ||
- main | ||
- master | ||
|
||
pr: | ||
- master | ||
|
||
name: $(BuildID)-$(SourceBranchName) | ||
|
||
resources: | ||
|
||
repositories: | ||
- repository: self | ||
type: git | ||
ref: master | ||
|
||
jobs: | ||
|
||
- job: Job_1 | ||
displayName: Web API | ||
pool: | ||
vmImage: windows-2019 | ||
|
||
steps: | ||
|
||
- checkout: self | ||
clean: true | ||
|
||
- task: PowerShell@2 | ||
displayName: Swap config files | ||
inputs: | ||
targetType: inline | ||
script: > | ||
Copy-Item "Server/WebApi/appsettings.Token.json" -Destination "Server/WebApi/appsettings.json" -Force | ||
Remove-Item "Server/WebApi/appsettings.Token.json" -Force | ||
- task: replacetokens@3 | ||
displayName: Update configurations | ||
inputs: | ||
rootDirectory: Server | ||
targetFiles: '**\*appsettings.json' | ||
escapeType: none | ||
tokenPrefix: __ | ||
tokenSuffix: __ | ||
|
||
- task: UseDotNet@2 | ||
displayName: Use .Net SDK 5.0.x | ||
continueOnError: True | ||
inputs: | ||
version: 5.0.x | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: dotnet restore | ||
inputs: | ||
command: restore | ||
projects: Server\**\*.csproj | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: dotnet publish | ||
inputs: | ||
command: publish | ||
publishWebProjects: false | ||
projects: Server\**\*.csproj | ||
arguments: -c Release -o $(Build.ArtifactStagingDirectory) | ||
|
||
- task: CopyFiles@2 | ||
displayName: Stage artifacts | ||
inputs: | ||
SourceFolder: Server | ||
Contents: "**/WebApi.zip" | ||
TargetFolder: $(Build.ArtifactStagingDirectory) | ||
CleanTargetFolder: true | ||
OverWrite: true | ||
flattenFolders: true | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: Save artifacts | ||
|
||
- job: Job_2 | ||
displayName: Website | ||
pool: | ||
vmImage: ubuntu-18.04 | ||
|
||
steps: | ||
- checkout: self | ||
clean: true | ||
|
||
- task: UseNode@1 | ||
displayName: Use Node 12.18.x | ||
inputs: | ||
version: 12.18.x | ||
|
||
- task: Npm@1 | ||
displayName: Install packages | ||
inputs: | ||
workingDir: Client | ||
verbose: false | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
- task: Npm@1 | ||
displayName: Build | ||
inputs: | ||
command: custom | ||
workingDir: Client | ||
verbose: false | ||
customCommand: run build.prod | ||
|
||
steps: | ||
- script: echo Hello, world! | ||
displayName: 'Run a one-line script' | ||
- task: ArchiveFiles@2 | ||
displayName: Stage artifacts | ||
inputs: | ||
rootFolderOrFile: Client/dist/app | ||
includeRootFolder: false | ||
archiveFile: $(Build.ArtifactStagingDirectory)/Website.zip | ||
|
||
- script: | | ||
echo Add other tasks to build, test, and deploy your project. | ||
echo See https://aka.ms/yaml | ||
displayName: 'Run a multi-line script' | ||
- task: PublishBuildArtifacts@1 | ||
displayName: Save artifacts |
Oops, something went wrong.