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

feat: upgrade to net9 #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [12.0.0]

- Updated to NET 9 SDK Container
- Update to Node 20
- Update Docker Compose to v2.29.7
- [BREAKING] Dropped NET 7 support

## [11.0.1]

Added make as a dependency
- Added make as a dependency

## [11.0.0]

Expand Down
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0
FROM mcr.microsoft.com/dotnet/sdk:9.0

# "install" the dotnet 7 runtime so we can also run the NET 7 tests
COPY --from=mcr.microsoft.com/dotnet/sdk:7.0.404-1-bookworm-slim-amd64 /usr/share/dotnet/shared /usr/share/dotnet/shared
# "install" the dotnet 8 runtime so we can also run the NET 8 tests
COPY --from=mcr.microsoft.com/dotnet/sdk:8.0 /usr/share/dotnet/shared /usr/share/dotnet/shared

# install base software
RUN mkdir -p /usr/share/man/man1 \
Expand All @@ -16,7 +16,7 @@ RUN mkdir -p /usr/share/man/man1 \
zip \
make \
ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install --no-install-recommends -y nodejs \
&& apt-get install -y --no-install-recommends nuget libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb procps\
&& apt-get clean && rm -rf /var/lib/apt/lists/*
Expand All @@ -27,7 +27,7 @@ RUN apt-get update \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# install docker-compose
RUN curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
RUN curl -L "https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose

# install Chromium for (unit)-testing during build-phase
Copy link
Member Author

@HBTeun HBTeun Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I see line 35 is already done on line 21. This comment has nothing to do with what is shown above.

I meant the following:
afbeelding
afbeelding

Expand All @@ -49,12 +49,6 @@ RUN mkdir -p ~/scripts
COPY scripts /scripts
RUN echo "source /scripts/dotnetcore.sh" >> ~/.bashrc

# install reportgenerator for code coverage
RUN dotnet tool install -g dotnet-reportgenerator-globaltool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you move this to the dotnet-build.sh file?

This way it will execute the tool install every time you run the container.
Tools should really be included in the container so we have a static and replayable environment between builds

Copy link
Member Author

@HBTeun HBTeun Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them because they sometimes resulted in errors because they could not not be updated because it was a fixed container layer.

Normally for dotnet tools this is done using a local tool manifest file in the repo. NPM tools are also not in the container.

Plus the "tool install every time" can be partly solved with using the Bitbucket pipeline cache better.

RUN dotnet tool install -g dotnet-sonarscanner
RUN dotnet tool install -g dotnet-format
RUN dotnet tool install -g dotnet-coverage

# add entrypoint and run
COPY dotnet-build.sh /dotnet-build.sh
COPY entrypoint.sh /entrypoint.sh
Expand Down
6 changes: 6 additions & 0 deletions dotnet-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ rm -rf ./**/bin
rm -rf ./**/obj
rm -rf "$DIST"

# Install dotnet tools
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet tool install -g dotnet-sonarscanner
dotnet tool install -g dotnet-format
dotnet tool install -g dotnet-coverage

# create artifacts dir
mkdir -p "$ARTIFACTS_DIST"

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dotnet-build",
"version": "11.0.1",
"version": "12.0.0",
"description": "[![logo](./logo.jpg)](https://frontliners.nl)",
"main": "index.js",
"scripts": {
Expand Down