-
Notifications
You must be signed in to change notification settings - Fork 2
/
buildspec.yml
53 lines (44 loc) · 1.46 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
version: 0.2
phases:
install:
runtime-versions:
dotnet: 3.1
commands:
#Install Amazon Lambda Tools
- dotnet tool install Amazon.Lambda.Tools -g
- export PATH="$PATH:/root/.dotnet/tools"
pre_build:
commands:
# log the environment variables we care about
- printenv
# Upgrade apt
- apt-get upgrade
# Update libs
- apt-get update
build:
commands:
#build the code
- dotnet build ./CovidAPI/src/CovidAPI/CovidAPI.csproj
- dotnet build ./CovidAPI/src/LifecycleHooks/LifecycleHooks.csproj
# run unit tests
- dotnet test ./CovidAPI/test/CovidAPI.Tests/CovidAPI.Tests.csproj --verbosity normal --logger "trx;LogFileName=salad.Api.trx" --results-directory './testresults'
post_build:
commands:
# Prepare for the package command
- SHORT_VERSION=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- echo $SHORT_VERSION
- MSBUILD_PARAMETERS=\"/p:VersionSuffix=$SHORT_VERSION\"
- echo $MSBUILD_PARAMETERS
# Generate a CI package for the lambda
- dotnet lambda package-ci >
--configuration Release
--project-location ./CovidAPI/src/CovidAPI
--template covidapi.yml
--s3-bucket $BUILD_OUTPUT_BUCKET
--s3-prefix covid-safe/$CODEBUILD_BUILD_ID
--output-template CovidAPIStack.yml
--msbuild-parameters $MSBUILD_PARAMETERS
artifacts:
files:
- CovidAPIStack.yml
discard-paths: no