Skip to content

Commit

Permalink
More build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Jan 23, 2020
1 parent 6680c3d commit 6e6a572
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 28 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build.yaml
Expand Up @@ -2,6 +2,7 @@ name: Build
on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -33,16 +34,22 @@ jobs:
- name: Build Docker Images
if: github.event_name != 'pull_request'
run: |
echo ${{ steps.version.outputs.version }}
docker build --target api -t api-ci --build-arg VERSION_SUFFIX=${{ steps.version.outputs.version }} .
docker build --target job -t job-ci --build-arg VERSION_SUFFIX=${{ steps.version.outputs.version }} .
docker build --target api -t ex-api .
docker build --target job -t ex-job .
- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push CI Packages
if: github.event_name != 'pull_request'
run: echo "Push docker images to GPR and maybe Docker Hub"
run: |
# tag and push docker image
for image in {"ex-api","ex-job"}; do
for tag in {${{ steps.version.outputs.version }},latest}; do
docker tag $image exceptionless/$image:$tag
docker push exceptionless/$image:$tag
done
done
- name: Publish Release Packages
if: startsWith(github.ref, 'refs/tags/v')
run: echo "Push docker images to Docker Hub"
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
@@ -1,5 +1,4 @@
/TestResults
/Build

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand All @@ -15,7 +14,6 @@
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
published/
Expand Down Expand Up @@ -112,7 +110,6 @@ dump.rdb

#App
App_Data
/build/elasticsearch-*
/.vs

*.DS_Store
Expand Down
15 changes: 3 additions & 12 deletions Dockerfile
@@ -1,9 +1,6 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /app

ARG VERSION_SUFFIX=0-dev
ENV VERSION_SUFFIX=$VERSION_SUFFIX

COPY ./*.sln ./NuGet.Config ./
COPY ./build/*.props ./build/

Expand All @@ -19,7 +16,7 @@ RUN dotnet restore

# Copy everything else and build app
COPY . .
RUN dotnet build --version-suffix $VERSION_SUFFIX -c Release
RUN dotnet build -c Release

# testrunner

Expand All @@ -32,10 +29,7 @@ ENTRYPOINT dotnet test --results-directory /app/artifacts --logger:trx
FROM build AS job-publish
WORKDIR /app/src/Exceptionless.Job

ARG VERSION_SUFFIX=0-dev
ENV VERSION_SUFFIX=$VERSION_SUFFIX

RUN dotnet publish --version-suffix $VERSION_SUFFIX -c Release -o out
RUN dotnet publish -c Release -o out

# job

Expand All @@ -49,10 +43,7 @@ ENTRYPOINT [ "dotnet", "Exceptionless.Job.dll" ]
FROM build AS api-publish
WORKDIR /app/src/Exceptionless.Web

ARG VERSION_SUFFIX=0-dev
ENV VERSION_SUFFIX=$VERSION_SUFFIX

RUN dotnet publish --version-suffix $VERSION_SUFFIX -c Release -o out
RUN dotnet publish -c Release -o out

# api

Expand Down
9 changes: 3 additions & 6 deletions build/common.props
@@ -1,14 +1,10 @@
<Project>

<PropertyGroup Label="Version">
<VersionPrefix>6.0</VersionPrefix>
<VersionSuffix>0-dev</VersionSuffix>
<Version>$(VersionPrefix).$(VersionSuffix)</Version>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Product>Exceptionless</Product>
<MinVerSkip Condition="'$(Configuration)' == 'Debug'">true</MinVerSkip>
<MinVerTagPrefix>v</MinVerTagPrefix>
<Copyright>Copyright (c) 2020 Exceptionless. All rights reserved.</Copyright>
<RepositoryUrl>https://github.com/exceptionless/exceptionless</RepositoryUrl>
<Authors>Exceptionless</Authors>
Expand All @@ -22,6 +18,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="AsyncFixer" Version="1.1.6" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="2.0.0" PrivateAssets="All" />
</ItemGroup>

</Project>
3 changes: 0 additions & 3 deletions src/Exceptionless.Web/Program.cs
Expand Up @@ -12,13 +12,10 @@
using Exceptionless.Insulation.Configuration;
using Exceptionless.Web.Utility;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.HostFiltering;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Serilog;
using Serilog.Events;
using Serilog.Sinks.Exceptionless;
Expand Down

0 comments on commit 6e6a572

Please sign in to comment.