-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
531 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.dotnet/ | ||
.store/ | ||
tools/ | ||
build/ | ||
src/**/obj/ | ||
src/**/node_modules/ | ||
tests/**/obj/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
build.sh text eol=lf | ||
build.cake text eol=lf | ||
*.sh text eol=lf | ||
.dockerignore text eol=lf | ||
Dockerfile text eol=lf | ||
build.cake text eol=lf | ||
distscripts/* eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build installation packages | ||
on: push | ||
|
||
jobs: | ||
build: | ||
name: Build installation packages on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2019, ubuntu-16.04] | ||
include: | ||
- os: windows-2019 | ||
script_name: .\build.cmd | ||
- os: ubuntu-16.04 | ||
script_name: ./build.sh | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Download and install node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
|
||
- name: Install .NET 3.x SDK for build | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.103' | ||
|
||
- name: Restore .NET Core tools | ||
run: dotnet tool restore | ||
|
||
- name: Build - restore nuget packages | ||
run: ${{ matrix.script_name }} --target=restore-nuget-packages --verbosity=verbose | ||
|
||
- name: Publish | ||
run: ${{ matrix.script_name }} --target=Publish --verbosity=verbose | ||
|
||
- name: Upload built packages | ||
uses: actions/upload-artifact@v1 | ||
continue-on-error: true | ||
with: | ||
name: installation packages | ||
path: build/publish/ # We upload *everything*, but I'd rather upload just the zip files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
### BUILD | ||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.201 AS build-env | ||
WORKDIR /source | ||
|
||
# Prerequisites | ||
COPY utils/* utils/ | ||
RUN utils/install-all-prereqs.sh | ||
|
||
# ... libgit2sharp debian 10.x support | ||
RUN dotnet tool install -g GitVersion.Tool --version 5.2.4 | ||
ENV LD_LIBRARY_PATH=/root/.dotnet/tools/.store/gitversion.tool/5.2.4/gitversion.tool/5.2.4/tools/netcoreapp3.1/any/runtimes/debian.9-x64/native/ | ||
|
||
# Copy csproj and restore as distinct layers | ||
# ... sources | ||
COPY src/Return.Application/*.csproj src/Return.Application/ | ||
COPY src/Return.Common/*.csproj src/Return.Common/ | ||
COPY src/Return.Domain/*.csproj src/Return.Domain/ | ||
COPY src/Return.Infrastructure/*.csproj src/Return.Infrastructure/ | ||
COPY src/Return.Persistence/*.csproj src/Return.Persistence/ | ||
COPY src/Return.Web/*.csproj src/Return.Web/ | ||
COPY src/Common.props src/ | ||
|
||
# ... tests | ||
COPY tests/Return.Application.Tests.Unit/*.csproj tests/Return.Application.Tests.Unit/ | ||
COPY tests/Return.Domain.Tests.Unit/*.csproj tests/Return.Domain.Tests.Unit/ | ||
COPY tests/Return.Web.Tests.Unit/*.csproj tests/Return.Web.Tests.Unit/ | ||
COPY tests/Return.Web.Tests.Integration/*.csproj tests/Return.Web.Tests.Integration/ | ||
COPY tests/Common.props tests/ | ||
|
||
COPY *.sln . | ||
COPY dotnet-tools.json . | ||
RUN dotnet restore | ||
RUN dotnet tool restore | ||
|
||
# Yarn (although it isn't as large, still worth caching) | ||
COPY src/Return.Web/package.json src/Return.Web/ | ||
COPY src/Return.Web/yarn.lock src/Return.Web/ | ||
RUN yarn --cwd src/Return.Web/ | ||
|
||
## Skip build script pre-warm | ||
## This causes later invocations of the build script to fail with "Failed to uninstall tool package 'cake.tool': Invalid cross-device link" | ||
#COPY build.* . | ||
#RUN ./build.sh --target=restore-node-packages | ||
|
||
### TEST | ||
FROM build-env AS test | ||
|
||
# ... run tests | ||
COPY . . | ||
ENV RETURN_TEST_WAIT_TIME 30 | ||
ENV SCREENSHOT_TEST_FAILURE_TOLERANCE True | ||
RUN ./build.sh --target=test | ||
|
||
### PUBLISHING | ||
FROM build-env AS publish | ||
|
||
# ... run publish | ||
COPY . . | ||
RUN ./build.sh --target=Publish-Ubuntu-18.04-x64 --publish-dir=publish --verbosity=verbose --skip-compression=true | ||
|
||
### RUNTIME IMAGE | ||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1 | ||
WORKDIR /app | ||
|
||
# ... Run libgdi install | ||
COPY utils/install-app-prereqs.sh utils/ | ||
RUN bash utils/install-app-prereqs.sh | ||
|
||
# ... Copy published app | ||
COPY --from=publish /source/publish/ubuntu.18.04-x64/ . | ||
|
||
ENV ASPNETCORE_ENVIRONMENT Production | ||
|
||
# Config directory | ||
VOLUME ["/etc/return-retro"] | ||
|
||
# Set some defaults for a "direct run" experience | ||
ENV DATABASE__DATABASE "/app/data.db" | ||
ENV DATABASE__DATABASEPROVIDER Sqlite | ||
|
||
# ... enable proxy mode | ||
ENV SECURITY__ENABLEPROXYMODE True | ||
|
||
# ... health check | ||
HEALTHCHECK CMD curl --fail http://localhost/health || exit | ||
|
||
ENTRYPOINT [ "./launch", "run" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.