Skip to content

Commit

Permalink
Fix Docker build
Browse files Browse the repository at this point in the history
- Make sure XML docs are included
- Ensure DLLs have versions set properly
- Update .NET Core SDK image used
  • Loading branch information
mattwcole committed Sep 17, 2017
1 parent 1a7fe9a commit 0f56025
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,10 @@ paket-files/
__pycache__/
*.pyc

## Project specific files and directories

# Graylog
graylog/data/
graylog/data/

# XML Documentation
Gelf.Extensions.Logging.xml
3 changes: 2 additions & 1 deletion Gelf.Extensions.Logging.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8D2DBBD0-2141-4B3D-BEA5-5FF4B15F0919}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.travis.yml = .travis.yml
docker-compose.ci.build.yml = docker-compose.ci.build.yml
docker-compose.ci.publish.yml = docker-compose.ci.publish.yml
Expand All @@ -26,7 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{7D94
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gelf.Extensions.Logging.Samples.NetCore2", "samples\Gelf.Extensions.Logging.Samples.NetCore2\Gelf.Extensions.Logging.Samples.NetCore2.csproj", "{0A2D1AF3-16F9-4081-A3BE-35331BEF58B5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gelf.Extensions.Logging.Samples.NetCore1", "samples\Gelf.Extensions.Logging.Samples.NetCore1\Gelf.Extensions.Logging.Samples.NetCore1.csproj", "{C55B368D-E4C1-42D0-97C2-4AD2F443743B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gelf.Extensions.Logging.Samples.NetCore1", "samples\Gelf.Extensions.Logging.Samples.NetCore1\Gelf.Extensions.Logging.Samples.NetCore1.csproj", "{C55B368D-E4C1-42D0-97C2-4AD2F443743B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ This repository contains a Docker Compose file that can be used for creating loc

## Contributing

Pull requests welcome! In order to run tests, first run `docker-compose up` to create the Graylog stack. Existing tests log messages and use the Graylog API to assert that they have been sent correctly. A UDP input will be created as part of the test setup (if not already present), so there is no need to create one manually. Build and tests are run on CI in Docker, meaning it is possible to run the build locally in identical conditions using `docker-compose -f docker-compose.ci.build.yml -f docker-compose.yml up`.
Pull requests welcome! In order to run tests, first run `docker-compose up` to create the Graylog stack. Existing tests log messages and use the Graylog API to assert that they have been sent correctly. A UDP input will be created as part of the test setup (if not already present), so there is no need to create one manually. Build and tests are run on CI in Docker, meaning it is possible to run the build locally in identical conditions using `docker-compose -f docker-compose.ci.build.yml -f docker-compose.yml up --abort-on-container-exit`.
7 changes: 3 additions & 4 deletions docker-compose.ci.build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
version: '2'
version: '3'

services:
ci-build:
image: microsoft/dotnet:1.1-sdk
image: microsoft/dotnet:2.0-sdk
volumes:
- .:/src
working_dir: /src
environment:
- GRAYLOG_HOST=graylog-server
command: >
/bin/bash -c '
versionArg=$$([[ ! -z "$VERSION" ]] && echo "/p:PackageVersion=$VERSION" || echo "") &&
dotnet restore &&
versionArg=$$([[ ! -z "$VERSION" ]] && echo "/p:Version=$VERSION" || echo "") &&
dotnet build -c Release $$versionArg &&
find test/*/*Tests.csproj | xargs -n 1 dotnet test -c Release --no-build
'
4 changes: 2 additions & 2 deletions docker-compose.ci.publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '2'
version: '3'

services:
ci-build:
image: microsoft/dotnet:1.1-sdk
image: microsoft/dotnet:2.0-sdk
volumes:
- .:/src
working_dir: /src
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: '3'

services:
graylog-mongo:
Expand Down
13 changes: 9 additions & 4 deletions src/Gelf.Extensions.Logging/Gelf.Extensions.Logging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.3\.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile>Gelf.Extensions.Logging.xml</DocumentationFile>
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
Expand Down

0 comments on commit 0f56025

Please sign in to comment.