Skip to content

Commit 999cc8b

Browse files
authored
Merge pull request #185 from LBHackney-IT/TS-1891-4-Documents-API-Upgrade-framework-version
Ts 1891 4 documents api upgrade framework version
2 parents b0440f4 + ed9b58e commit 999cc8b

File tree

12 files changed

+45
-47
lines changed

12 files changed

+45
-47
lines changed

.circleci/config.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: 2.1
22

3-
orbs:
4-
aws-cli: circleci/[email protected]
3+
orbs:
54
aws_assume_role: lbh-hackit/[email protected]
65

76
executors:
@@ -10,7 +9,7 @@ executors:
109
- image: circleci/python:3.7
1110
docker-dotnet:
1211
docker:
13-
- image: mcr.microsoft.com/dotnet/sdk:6.0
12+
- image: mcr.microsoft.com/dotnet/sdk:8.0
1413

1514
references:
1615
workspace_root: &workspace_root "~"
@@ -46,7 +45,7 @@ commands:
4645
- run:
4746
name: Install Node.js
4847
command: |
49-
curl -sL https://deb.nodesource.com/setup_14.x | bash -
48+
curl -sL https://deb.nodesource.com/setup_22.x | bash -
5049
apt-get update && apt-get install -y nodejs
5150
- run:
5251
name: Install serverless CLI
@@ -83,7 +82,7 @@ commands:
8382
- run:
8483
name: Install Node.js
8584
command: |
86-
curl -sL https://deb.nodesource.com/setup_14.x | bash -
85+
curl -sL https://deb.nodesource.com/setup_22.x | bash -
8786
apt-get update && apt-get install -y nodejs
8887
- run:
8988
name: Install SwaggerHub CLI
@@ -123,7 +122,7 @@ commands:
123122
dpkg -i session-manager-plugin.deb
124123
- run:
125124
name: Install dotnet ef core
126-
command: dotnet tool install dotnet-ef --version 7.0.0 --tool-path ./dotnet-ef-local/
125+
command: dotnet tool install dotnet-ef --version 8.0.12 --tool-path ./dotnet-ef-local/
127126
- run:
128127
name: SSH into RDS and migrate database
129128
command: |
@@ -227,7 +226,9 @@ workflows:
227226
requires:
228227
- assume-role-staging
229228
- deploy-to-staging:
230-
context: api-nuget-token-context
229+
context:
230+
- api-nuget-token-context
231+
- "Serverless Framework"
231232
requires:
232233
- migrate-database-staging
233234

@@ -245,7 +246,9 @@ workflows:
245246
requires:
246247
- assume-role-production
247248
- deploy-to-production:
248-
context: api-nuget-token-context
249+
context:
250+
- api-nuget-token-context
251+
- "Serverless Framework"
249252
requires:
250253
- migrate-database-production
251254
- publish-to-swaggerhub:

DocumentsApi.Tests/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0
22

33
# disable microsoft telematry
44
ENV DOTNET_CLI_TELEMETRY_OPTOUT='true'
@@ -8,7 +8,7 @@ ENV LBHPACKAGESTOKEN=$LBHPACKAGESTOKEN
88

99
RUN apt-get update \
1010
&& apt-get install curl gnupg -yq \
11-
&& curl -sL https://deb.nodesource.com/setup_14.x | bash \
11+
&& curl -sL https://deb.nodesource.com/setup_22.x | bash \
1212
&& apt-get install nodejs -yq
1313

1414
WORKDIR /app

DocumentsApi.Tests/DocumentsApi.Tests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net6.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
<IsPackable>false</IsPackable>
55
<IsTestProject>true</IsTestProject>
66
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
@@ -14,18 +14,18 @@
1414
<PackageReference Include="FluentAssertions" Version="5.10.3" />
1515
<PackageReference Include="Hackney.Core.Http" Version="1.70.0" />
1616
<PackageReference Include="Hackney.Core.JWT" Version="1.72.0" />
17-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.4" />
18-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
17+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.12" />
18+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
1919
<PrivateAssets>all</PrivateAssets>
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
</PackageReference>
22-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
22+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.12" />
2323
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
24-
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
24+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
2525
<PackageReference Include="Bogus" Version="25.0.4" />
2626
<PackageReference Include="Moq" Version="4.17.2" />
27-
<PackageReference Include="nunit" Version="3.11.0" />
28-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
27+
<PackageReference Include="nunit" Version="3.13.3" />
28+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11" />
2929
<PackageReference Include="dotenv.net" Version="3.1.1" />
3030
</ItemGroup>
3131

DocumentsApi.Tests/V1/E2ETests/HealthCheckTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public async Task HealthCheckErrorReturns500()
1919
{
2020
Status = StatusCodes.Status500InternalServerError,
2121
Title = "An error occurred while processing your request.",
22-
Type = "https://tools.ietf.org/html/rfc7231#section-6.6.1"
22+
Type = "https://tools.ietf.org/html/rfc9110#section-15.6.1"
2323
};
2424

2525
var response = await Client.GetAsync(uri);

DocumentsApi/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0
22

33
ARG LBHPACKAGESTOKEN
44
ENV LBHPACKAGESTOKEN=$LBHPACKAGESTOKEN
55

66
RUN apt-get update \
77
&& apt-get install curl gnupg -yq \
8-
&& curl -sL https://deb.nodesource.com/setup_14.x | bash \
8+
&& curl -sL https://deb.nodesource.com/setup_22.x | bash \
99
&& apt-get install nodejs -yq
1010

1111
WORKDIR /app

DocumentsApi/DocumentsApi.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66
<PropertyGroup>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -26,21 +26,21 @@
2626
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
2727
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" />
2828
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.1.1" />
29-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
29+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
33+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.12">
3434
<PrivateAssets>all</PrivateAssets>
3535
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3636
</PackageReference>
37-
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.0" />
38-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
37+
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.12" />
38+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.12" />
3939
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
4040
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0" />
4141
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.4.0" />
4242
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.4.0" />
43-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
43+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11" />
4444
<PackageReference Include="dotenv.net" Version="3.1.1" />
4545
</ItemGroup>
4646

DocumentsApi/build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
dotnet restore
2-
dotnet lambda package --configuration release --framework netcoreapp3.1 --output-package bin/release/netcoreapp3.1/documents-api.zip
2+
dotnet lambda package --configuration release --framework netcoreapp8.0 --output-package bin/release/netcoreapp8.0/documents-api.zip

DocumentsApi/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ then
88
fi
99

1010
#dotnet restore
11-
dotnet tool install --global Amazon.Lambda.Tools --version 4.0.0
11+
dotnet tool install --global Amazon.Lambda.Tools --version 5.12.4
1212

1313

1414
# (for CI) ensure that the newly-installed tools are on PATH
@@ -18,6 +18,6 @@ then
1818
fi
1919

2020
dotnet restore
21-
dotnet lambda package --configuration release --framework net6.0 --output-package ./bin/release/net6.0/documents-api.zip
21+
dotnet lambda package --configuration release --framework net8.0 --output-package ./bin/release/net8.0/documents-api.zip
2222

2323
cd python && zip -rv ../lambda-orchestrator.zip ./*

DocumentsApi/serverless.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
service: documents-api
22
provider:
33
name: aws
4-
runtime: dotnet6
4+
runtime: dotnet8
55
vpc: ${self:custom.vpc.${opt:stage}}
66
stage: ${opt:stage}
77
region: eu-west-2
@@ -38,7 +38,7 @@ provider:
3838
AllowedOrigins: ${self:custom.corsDomains.${self:provider.stage}}
3939

4040
package:
41-
artifact: ./bin/release/net6.0/documents-api.zip
41+
artifact: ./bin/release/net8.0/documents-api.zip
4242
individually: true
4343

4444
plugins:
@@ -51,7 +51,7 @@ functions:
5151
lambdaInsights: true
5252
role: lambdaExecutionRole
5353
package:
54-
artifact: ./bin/release/net6.0/documents-api.zip
54+
artifact: ./bin/release/net8.0/documents-api.zip
5555
layers:
5656
- arn:aws:lambda:${self:provider.region}:553035198032:layer:nodejs12:38
5757
events:
@@ -70,7 +70,7 @@ functions:
7070
lambdaInsights: true
7171
role: lambdaExecutionRole
7272
package:
73-
artifact: ./bin/release/net6.0/documents-api.zip
73+
artifact: ./bin/release/net8.0/documents-api.zip
7474
DocumentsOrchestrator:
7575
runtime: python3.7
7676
name: ${self:service}-documents-orchestrator

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: build-test
22
build-test:
3-
docker-compose -f DocumentsApi.Tests/compose.yml build
3+
docker compose -f DocumentsApi.Tests/compose.yml build
44

55
.PHONY: serve-test
66
serve-test:
@@ -14,7 +14,7 @@ start-test:
1414

1515
.PHONY: build-local
1616
build-local:
17-
docker-compose -f DocumentsApi/compose.yml build
17+
docker compose -f DocumentsApi/compose.yml build
1818

1919
.PHONY: serve-local
2020
serve-local:
@@ -32,7 +32,7 @@ stop-local:
3232

3333
.PHONY: shell
3434
shell:
35-
docker-compose run documents-api bash
35+
docker compose run documents-api bash
3636

3737
.PHONY: lint
3838
lint:
@@ -45,4 +45,4 @@ restart-db:
4545
docker stop $$(docker ps -q --filter ancestor=test-database -a)
4646
-docker rm $$(docker ps -q --filter ancestor=test-database -a)
4747
docker rmi test-database
48-
docker-compose up -d test-database
48+
docker compose up -d test-database

0 commit comments

Comments
 (0)