diff --git a/.github/dependabot.yml b/.github/dependabot.yml index aba37ef8..bef11482 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -33,8 +33,9 @@ updates: - dependency-name: "System.Threading.Channels" update-types: ["version-update:semver-major"] - # The examples' own packages. They build Obvs from the repo, so its versions in Directory.Packages.props are theirs - # too, and they take the same ignores. + # The examples are built on the published Obvs packages, so keep them on its latest release. They pin their own + # versions, so this entry updates only theirs. It carried the root's ignores while the examples built Obvs from the + # repo, which made it update Directory.Packages.props too, and doesn't need them now. - package-ecosystem: nuget directory: /Examples target-branch: v7 @@ -43,20 +44,6 @@ updates: groups: examples: patterns: ["*"] - ignore: - - dependency-name: "Microsoft.CodeAnalysis.CSharp*" - - dependency-name: "Microsoft.AspNetCore.*" - update-types: ["version-update:semver-major"] - - dependency-name: "Microsoft.Bcl.*" - update-types: ["version-update:semver-major"] - - dependency-name: "Microsoft.Extensions.*" - update-types: ["version-update:semver-major"] - - dependency-name: "System.Diagnostics.DiagnosticSource" - update-types: ["version-update:semver-major"] - - dependency-name: "System.Text.Json" - update-types: ["version-update:semver-major"] - - dependency-name: "System.Threading.Channels" - update-types: ["version-update:semver-major"] - package-ecosystem: github-actions directory: / diff --git a/Examples/.dockerignore b/Examples/.dockerignore index a4d6d9c6..f9195be4 100644 --- a/Examples/.dockerignore +++ b/Examples/.dockerignore @@ -1 +1,3 @@ -.vs/ \ No newline at end of file +.vs/ +**/bin/ +**/obj/ diff --git a/Examples/Client/Obvs.Example.Client.csproj b/Examples/Client/Obvs.Example.Client.csproj index 5ade1520..dadcf6c8 100644 --- a/Examples/Client/Obvs.Example.Client.csproj +++ b/Examples/Client/Obvs.Example.Client.csproj @@ -5,12 +5,11 @@ + - - diff --git a/Examples/Dockerfile b/Examples/Dockerfile index 0fb28348..ad7db0f4 100644 --- a/Examples/Dockerfile +++ b/Examples/Dockerfile @@ -1,8 +1,14 @@ -# Built from the repo's root, as the examples reference Obvs's projects: docker compose up, from Examples/ +# The service, on the published Obvs packages, built from Examples/: docker compose up, from Examples/ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src -COPY . . -RUN dotnet publish Examples/Service.ActiveMQ -c Release -o /app +# Restore from the project files first, so changing the code doesn't download the packages again +COPY Directory.Packages.props . +COPY Messages/*.csproj Messages/ +COPY Service.ActiveMQ/*.csproj Service.ActiveMQ/ +RUN dotnet restore Service.ActiveMQ +COPY Messages/ Messages/ +COPY Service.ActiveMQ/ Service.ActiveMQ/ +RUN dotnet publish Service.ActiveMQ -c Release --no-restore -o /app FROM mcr.microsoft.com/dotnet/runtime:10.0 AS runtime WORKDIR /app diff --git a/Examples/Messages/Obvs.Example.Messages.csproj b/Examples/Messages/Obvs.Example.Messages.csproj index a091e13e..c4333cf9 100644 --- a/Examples/Messages/Obvs.Example.Messages.csproj +++ b/Examples/Messages/Obvs.Example.Messages.csproj @@ -4,9 +4,8 @@ netstandard2.0 - - + diff --git a/Examples/Service.ActiveMQ/Obvs.Example.Service.ActiveMQ.csproj b/Examples/Service.ActiveMQ/Obvs.Example.Service.ActiveMQ.csproj index 5ade1520..dadcf6c8 100644 --- a/Examples/Service.ActiveMQ/Obvs.Example.Service.ActiveMQ.csproj +++ b/Examples/Service.ActiveMQ/Obvs.Example.Service.ActiveMQ.csproj @@ -5,12 +5,11 @@ + - - diff --git a/Examples/docker-compose.yml b/Examples/docker-compose.yml index 014654b0..4bd09242 100644 --- a/Examples/docker-compose.yml +++ b/Examples/docker-compose.yml @@ -8,18 +8,22 @@ services: ports: - "61616:61616" - "8161:8161" + # Ready once it accepts connections: the service connects as it starts + healthcheck: + test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/61616"] + interval: 2s + retries: 30 networks: - obvs obvssvc1: - build: - context: .. - dockerfile: Examples/Dockerfile + build: . image: obvs.example.service.activemq:latest environment: - ACTIVEMQ_BROKER_URI=activemq:tcp://amq:61616?connectionTimeout=0 - OBVS_SERVICE_NAME=Obvs.Service1 depends_on: - - amq + amq: + condition: service_healthy networks: - obvs