Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Update to .NET 8.0 #26

Merged
merged 7 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['5.0.x', '6.0.x']
dotnet-version: ['8.0.x']
steps:
- uses : actions/checkout@v2
- name: Setup .NET SDK ${{matrix.dotnet-version}}
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{matrix.dotnet-version}}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
run: dotnet test --no-restore --verbosity normal
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</PropertyGroup>

<PropertyGroup>
<NetCoreCurrentVersion Condition="'$(MSBuildVersion)' &gt;= 17.0.0">6.0</NetCoreCurrentVersion>
<NetCoreCurrentVersion Condition="'$(MSBuildVersion)' &gt;= 17.0.0">8.0</NetCoreCurrentVersion>
<NetCoreCurrentVersion Condition="'$(MSBuildVersion)' &lt; 17.0.0">5.0</NetCoreCurrentVersion>
<NetCoreMinimumVersion>5.0</NetCoreMinimumVersion>
<NetCoreMinimumVersion>8.0</NetCoreMinimumVersion>
<NetCoreCurrent>net$(NetCoreCurrentVersion)</NetCoreCurrent>
<NetCoreMinimum>net$(NetCoreMinimumVersion)</NetCoreMinimum>
<NetTargetFrameworks>$(NetCoreCurrent);</NetTargetFrameworks>
Expand Down
9 changes: 5 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### Local Runs

- .NET 6.0.100
- .NET 8.0
- bash

### Docker Runs
Expand All @@ -21,7 +21,7 @@

### Development

- Visual Studio 2022 17.0
- Visual Studio 2022


## Running
Expand All @@ -39,7 +39,7 @@ git-cache-data_1 | Data container for Git cache
git-cache_git-cache-data_1 exited with code 0
git-cache_1 | Hosting environment: Development
git-cache_1 | Content root path: /app
git-cache_1 | Now listening on: http://[::]:80
git-cache_1 | Now listening on: http://[::]:8085
git-cache_1 | Application started. Press Ctrl+C to shut down.
```

Expand All @@ -52,4 +52,5 @@ At this point should be able to clone using the cache:
## Configuration

The default port on the host is `8085`. This can be controlled with
an environment variable `GIT_HTTP_PORT=8888` or with a `.env` file.
an environment variable `GIT_HTTP_PORT=8888` or with a `.env` file.

4 changes: 1 addition & 3 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.4'

services:
git-cache:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "${GIT_HTTP_PORT:-8085}:80"
- "${GIT_HTTP_PORT:-8085}:8085"
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
git-cache-data:
build:
Expand Down
4 changes: 2 additions & 2 deletions docker/git-cache-data/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:xenial
FROM ubuntu:noble
# user 1000 must match the user id for the jenkins user in jenkins-master
RUN useradd -d "/var/git_cache" -u 1000 -m -s /bin/bash gitcache
RUN useradd -d "/var/git_cache" -u 1042 -m -s /bin/bash gitcache
USER gitcache
VOLUME ["/var/gitcache"]
CMD ["echo", "Data container for Git cache"]
Expand Down
6 changes: 3 additions & 3 deletions src/git-cache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
RUN apt-get update && apt-get install -y git
Expand All @@ -11,7 +11,7 @@ RUN build_deps="curl" && \
DEBIAN_FRONTEND=noninteractive apt-get purge -y --auto-remove ${build_deps} && \
rm -r /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:6.0 as build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY git-cache.sln ./
COPY Directory.* ./
Expand All @@ -26,7 +26,7 @@ WORKDIR /src/src/git-cache
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app -f net6.0
RUN dotnet publish -c Release -o /app -f net8.0

FROM base AS final
WORKDIR /app
Expand Down
3 changes: 2 additions & 1 deletion src/git-cache/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static void Main(string[] args)
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://*:8085")
.Build();

/*======================= PROTECTED =====================================*/
Expand All @@ -61,4 +62,4 @@ public static IWebHost BuildWebHost(string[] args) =>

} /* End of Class - Program */
}
/* End of document - Program.cs */
/* End of document - Program.cs */
2 changes: 1 addition & 1 deletion src/git-cache/git-cache.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(SrcDirectory)\git-cache.Services\git-cache.Services.csproj" />
<ProjectReference Include="$(SrcDirectory)/git-cache.Services/git-cache.Services.csproj" />
</ItemGroup>

</Project>
Loading