Skip to content

Instantly share code, notes, and snippets.

@OksanaH
Created November 14, 2020 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OksanaH/ba4137de9b56dfd19e27643d83e76aa9 to your computer and use it in GitHub Desktop.
Save OksanaH/ba4137de9b56dfd19e27643d83e76aa9 to your computer and use it in GitHub Desktop.
buildspec
version: 0.2
phases:
install:
runtime-versions:
dotnet: 3.1
pre_build:
commands:
- dotnet restore AspNetCoreWebService/AspNetCoreWebService.csproj
- dotnet restore AspNetCoreWebServiceTest/AspNetCoreWebServiceTest.csproj
build:
commands:
- dotnet publish -c release -o ./build_output AspNetCoreWebService/AspNetCoreWebService.csproj
- dotnet test -c release AspNetCoreWebServiceTest/AspNetCoreWebServiceTest.csproj --logger trx --results-directory ./testresults
post_build:
commands:
# Do not remove this statement. This command is required for AWS CodeStar projects.
# Update the AWS Partition, AWS Region, account ID and project ID in the project ARN in template-configuration.json file so AWS CloudFormation can tag project resources.
- sed -i.bak 's/\$PARTITION\$/'${PARTITION}'/g;s/\$AWS_REGION\$/'${AWS_REGION}'/g;s/\$ACCOUNT_ID\$/'${ACCOUNT_ID}'/g;s/\$PROJECT_ID\$/'${PROJECT_ID}'/g' template-configuration.json
reports:
XUnitTestResults:
file-format: VisualStudioTrx
files:
- '**/*'
base-directory: './testresults'
artifacts:
files:
- template.yml
- AspNetCoreWebService/bin/**/*
- scripts/**/*
- appspec.yml
- requirements.txt
- template-configuration.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment