Skip to content

Commit

Permalink
Merge branch 'release/v1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebazzz committed Apr 1, 2020
2 parents 63c4d89 + 6dff292 commit fd4145f
Show file tree
Hide file tree
Showing 48 changed files with 531 additions and 167 deletions.
76 changes: 5 additions & 71 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,14 @@ jobs:
build:
parallelism: 4
docker:
- image: mcr.microsoft.com/dotnet/core/sdk:3.1.201
- image: circleci/buildpack-deps:buster
steps:
- checkout

- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "src/Return.Web/yarn.lock" }}
- setup_remote_docker

- run:
name: Install Chrome
name: Run docker-compose tests
command: |
apt-get -qqy update
apt-get -qqy install lsb-release libappindicator3-1
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt -y install ./google-chrome.deb
sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome
rm google-chrome.deb
- run:
name: Install node.js prereqs
command: apt-get -qq update && apt-get -qqy --no-install-recommends install wget gnupg git unzip

- run:
name: Download and install node.js
command: |
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install --no-install-recommends -y gcc g++ make build-essential nodejs
- run:
name: Install Yarn
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.16.0
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV
- run:
name: Fix TERM var for CIRCLECI builds
command: |
echo 'export TERM=dumb' >> $BASH_ENV
- run:
name: Workaround GitTools/GitVersion/issues/1852
command: |
dotnet tool install -g GitVersion.Tool --version 5.2.4
echo 'export 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/' >> $BASH_ENV
echo 'export PATH="/root/.dotnet/tools:$PATH"' >> $BASH_ENV
echo 'export PATH="/root/.dotnet/tools:$PATH"' >> $BASH_ENV
- run:
name: Output important software versions
command: |
node --version
yarn --version
dotnet --version
echo $LD_LIBRARY_PATH
- run:
name: Build - restore nuget packages
command: |
./build.sh --target=restore-nuget-packages --verbosity=diagnostic
- run:
name: Build - restore node packages
command: ./build.sh --target=restore-node-packages --verbosity=verbose

- run:
name: Build - test
command: |
export MOZ_HEADLESS=1
export CIRCLECI=1
./build.sh --target=test --verbosity=verbose < /dev/null
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "src/Return.Web/yarn.lock" }}
paths:
- ~/.cache/yarn
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
7 changes: 7 additions & 0 deletions .dockerignore
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/
7 changes: 5 additions & 2 deletions .gitattributes
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
3 changes: 2 additions & 1 deletion .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
env:
MOZ_HEADLESS: 1
CIRCLECI: 1
run: ${{ matrix.script_name }} --target=test --verbosity=verbose
RETURN_TEST_WAIT_TIME: 30
run: ${{ matrix.script_name }} --target=test --use-code-coverage=false --verbosity=verbose

- name: Upload artifacts
uses: actions/upload-artifact@v1
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/publish-nightly-build.yml
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
87 changes: 87 additions & 0 deletions Dockerfile
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" ]
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ Retrospective tool built in ASP.NET Core and Blazor

Licensed: GNU GPL v3.0

[![Build status](https://ci.appveyor.com/api/projects/status/7bjrmgtek7j080d7?svg=true)](https://ci.appveyor.com/project/Sebazzz/Return)
[![CircleCI](https://circleci.com/gh/Sebazzz/Return.svg?style=svg)](https://circleci.com/gh/Sebazzz/Return)
[![Github CI](https://github.com/sebazzz/Return/workflows/Continuous%20integration/badge.svg)](https://github.com/Sebazzz/Return/actions?workflow=Continuous+integration)
| | master | develop |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AppVeyor CI** | [![Build status](https://ci.appveyor.com/api/projects/status/7bjrmgtek7j080d7/branch/master?svg=true)](https://ci.appveyor.com/project/Sebazzz/Return/branch/master) | [![Build status](https://ci.appveyor.com/api/projects/status/7bjrmgtek7j080d7/branch/develop?svg=true)](https://ci.appveyor.com/project/Sebazzz/Return/branch/develop) |
| **CircleCI** | [![CircleCI](https://circleci.com/gh/Sebazzz/Return/tree/master.svg?style=shield)](https://circleci.com/gh/Sebazzz/Return/tree/master) | [![CircleCI](https://circleci.com/gh/Sebazzz/Return/tree/develop.svg?style=shield)](https://circleci.com/gh/Sebazzz/Return/tree/develop) |
| **Github actions** | [![Github CI](https://github.com/sebazzz/Return/workflows/Continuous%20integration/badge.svg?branch=master)](https://github.com/Sebazzz/Return/actions?workflow=Continuous+integration&branch=master) | [![Github CI](https://github.com/sebazzz/Return/workflows/Continuous%20integration/badge.svg?branch=develop)](https://github.com/Sebazzz/Return/actions?workflow=Continuous+integration&branch=develop) |
| **Codeconv** | [![codecov](https://codecov.io/gh/Sebazzz/Return/branch/master/graph/badge.svg)](https://codecov.io/gh/Sebazzz/Return) | [![codecov](https://codecov.io/gh/Sebazzz/Return/branch/develop/graph/badge.svg)](https://codecov.io/gh/Sebazzz/Return) |
| **Daily build** | [![Github CI](https://github.com/sebazzz/Return/workflows/Build%20installation%20packages/badge.svg?branch=master)](https://github.com/Sebazzz/Return/actions?workflow=Build+installation+packages&branch=master) | [![Github CI](https://github.com/sebazzz/Return/workflows/Build%20installation%20packages/badge.svg?branch=develop)](https://github.com/Sebazzz/Return/actions?workflow=Build+installation+packages&branch=develop) |

## Features

Expand All @@ -29,6 +33,19 @@ Developed and tested on:

## Download

### Docker

Return is available as a docker image. Simply pull it from the Docker hub, and run it:

docker pull sebazzz/return:latest
docker run -p 80:80 sebazzz/return

For further configuration you may want to mount a directory with [the configuration](doc/Installation.md#Configuration):

docker run -p 80:80 -v /path/to/my/configuration/directory:/etc/return-retro sebazzz/return

### Manual installation

Download the release for your OS from the [releases tab](https://github.com/Sebazzz/Return/releases) or download the cutting edge builds from [AppVeyor](https://ci.appveyor.com/project/Sebazzz/Return).

[Follow the installation instructions](doc/Installation.md) in the documentation to install it.
Expand Down
1 change: 1 addition & 0 deletions Return.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{D6A25E
.gitignore = .gitignore
.prettierrc = .prettierrc
README.md = README.md
version.json = version.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Return.Web.Tests.Integration", "tests\Return.Web.Tests.Integration\Return.Web.Tests.Integration.csproj", "{D120FE6A-74F8-474E-9654-FC4E1CCD2B9E}"
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ install:
cache: '%LOCALAPPDATA%\Yarn'
environment:
RETURN_TEST_WAIT_TIME: 30
SCREENSHOT_TEST_FAILURE_TOLERANCE: True
build_script:
- cmd: build.cmd --target=Publish --verbosity=verbose
- cmd: build.cmd --target=build --verbosity=verbose
after_build:
- ps: Get-ChildItem ./build/publish/* -File | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem ./build/ -File | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
#before_test:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
test_script:
- cmd: build.cmd --target=Test
- cmd: build.cmd --target=test --configuration=debug --use-code-coverage=true
on_finish:
- ps: Compress-Archive -Path .\build\testresults -DestinationPath .\build\testresults-all.zip
- ps: Push-AppveyorArtifact .\build\testresults-all.zip -FileName "testresults-all.zip"
Expand Down
Loading

0 comments on commit fd4145f

Please sign in to comment.