Skip to content

Commit

Permalink
Add Travis and build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwcole committed Aug 3, 2017
1 parent 8e356ca commit 3c35578
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: generic
sudo: required
services:
- docker
script:
- export VERSION="$TRAVIS_TAG"
- ./docker-compose.sh -f docker-compose.ci.build.yml up
deploy:
on:
tags: true
all_branches: true
skip_cleanup: true
provider: script
script: ./docker-compose.sh -f docker-compose.ci.publish.yml up
2 changes: 2 additions & 0 deletions Gelf.Extensions.Logging.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ 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
docker-compose.ci.build.yml = docker-compose.ci.build.yml
docker-compose.ci.publish.yml = docker-compose.ci.publish.yml
docker-compose.yml = docker-compose.yml
README.md = README.md
EndProjectSection
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Gelf.Extensions.Logging

[![travis](https://img.shields.io/travis/mattwcole/gelf-extensions-logging.svg?style=flat-square)](https://travis-ci.org/mattwcole/gelf-extensions-logging)
[![nuget](https://img.shields.io/nuget/v/Gelf.Extensions.Logging.svg?style=flat-square)](https://www.nuget.org/packages/Gelf.Extensions.Logging)
[![license](https://img.shields.io/github/license/mattwcole/gelf-extensions-logging.svg?style=flat-square)](https://github.com/mattwcole/gelf-extensions-logging/blob/master/LICENSE.md)

GELF provider for [Microsoft.Extensions.Logging](https://github.com/aspnet/Logging).

Can be tested with a local Graylog instance in Docker.
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.ci.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '2'

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

services:
ci-build:
image: microsoft/dotnet:1.1-sdk
volumes:
- .:/src
working_dir: /src
command: |
/bin/bash -c '
versionArg=$$([[ ! -z $VERSION ]] && echo "/p:PackageVersion=$VERSION" || echo "" fi)
dotnet pack src/*/Gelf.Extensions.Logging.csproj -c Release --no-build $$versionArg
dotnet nuget push src/*/Gelf.Extensions.Logging.*.nupkg -s "$NUGET_SOURCE" -k "$NUGET_API_KEY"
'
9 changes: 9 additions & 0 deletions docker-compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

# Wrap docker-compose and return a non-zero exit code if any containers failed.

docker-compose "$@"

exit $(docker-compose -f docker-compose.ci.build.yml ps -q | tr -d '[:space:]' |
xargs docker inspect -f '{{ .State.ExitCode }}' | grep -v 0 | wc -l | tr -d '[:space:]')
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions src/Gelf.Extensions.Logging/Gelf.Extensions.Logging.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<VersionPrefix>0.1.0</VersionPrefix>
<TargetFramework>netstandard1.3</TargetFramework>
<PackageProjectUrl>https://github.com/mattwcole/gelf-extensions-logging</PackageProjectUrl>
<RepositoryUrl>https://github.com/mattwcole/gelf-extensions-logging</RepositoryUrl>
<Copyright>2017 Matt Cole</Copyright>
<PackageLicenseUrl>https://raw.githubusercontent.com/mattwcole/gelf-extensions-logging/master/LICENSE.md</PackageLicenseUrl>
<PackageTags>gelf graylog microsoft logging extensions</PackageTags>
<Description>GELF provider for Microsoft.Extensions.Logging.</Description>
<PackageIconUrl>https://raw.githubusercontent.com/mattwcole/gelf-extensions-logging/master/icon.png</PackageIconUrl>
<Authors>Matt Cole</Authors>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,4 +20,4 @@
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
</ItemGroup>

</Project>
</Project>

0 comments on commit 3c35578

Please sign in to comment.