Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
13 changes: 13 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🧰 Maintenance'
label: 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
119 changes: 119 additions & 0 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Release

on:
release:
types: [published]

jobs:
build:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v1

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Setup .NET Core 3.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100

- name: Restore Nuget Packages
run: dotnet restore TransactionProcessorACL.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build TransactionProcessorACL.sln --configuration Release

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.Tests.csproj"

- name: Build Docker Images
run: |
docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest --tag stuartferguson/transactionprocessoracl:latest --tag stuartferguson/transactionprocessoracl:${{ steps.get_version.outputs.VERSION }}

- name: Run Integration Tests
run: dotnet test "TransactionProcessorACL.IntegrationTests\TransactionProcessorACL.IntegrationTests.csproj"

- name: Publish Images to Docker Hub
run: |
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/transactionprocessor:latest
docker push stuartferguson/transactionprocessor:${{ steps.get_version.outputs.VERSION }}

- name: Publish API
run: dotnet publish "TransactionProcessorACL\TransactionProcessorACL.csproj" --configuration Release --output publishOutput

- name: Setup .NET Core 2.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.0.0

- name: Extract Octopus Tools
run: |
mkdir /opt/octo
cd /opt/octo
wget -O /opt/octo/octopus.zip https://download.octopusdeploy.com/octopus-tools/6.12.0/OctopusTools.6.12.0.portable.zip
unzip /opt/octo/octopus.zip
chmod +x /opt/octo/Octo

- name: Pack Files for Octopus
run: >-
/opt/octo/Octo pack
--outFolder /home/runner/work/TransactionProcessorACL/TransactionProcessorACL
--basePath /home/runner/work/TransactionProcessorACL/TransactionProcessorACL/publishOutput
--id TransactionProcessorACL
--version ${{ steps.get_version.outputs.VERSION }}
--format zip
--verbose
--logLevel=verbose

- name: Push Package to Octopus
run: >-
/opt/octo/Octo push
--server http://sferguson.ddns.net:9001
--apiKey API-UTN58QCF8HSATACNUBY41XPUC
--package /home/runner/work/TransactionProcessorACL/TransactionProcessorACL/TransactionProcessorACL.${{ steps.get_version.outputs.VERSION }}.zip
--overwrite-mode IgnoreIfExists

- name: Get Release
id: getrelease
uses: octokit/request-action@v1.x
with:
route: GET /repos/StuartFerguson/TransactionProcessorACL/releases/tags/${{ steps.get_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Release Notes
id: buildreleasenotes
uses: gr2m/get-json-paths-action@v1.x
with:
json: ${{ steps.getrelease.outputs.data }}
releasenote: "body"

- name: Create & Deploy Release in Octopus
run: >-
/opt/octo/Octo create-release
--server http://sferguson.ddns.net:9001
--apiKey API-UTN58QCF8HSATACNUBY41XPUC
--project "Transaction Processor ACL"
--version ${{ steps.get_version.outputs.VERSION }}
--channel Default
--deployTo Development
--waitfordeployment
--deploymenttimeout 00:05:00
--releasenotes "${{ steps.buildreleasenotes.outputs.releasenote }}"

- name: Setup .NET Core 3.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100


52 changes: 52 additions & 0 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Nightly Build

on:
schedule:
- cron: "* 23 * * *"

jobs:
build:
name: "Nightly Build"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100

- name: Restore Nuget Packages
run: dotnet restore TransactionProcessorACL.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build TransactionProcessorACL.sln --configuration Release

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"

- name: Setup Node.js for use with actions
uses: actions/setup-node@v1.1.0

- name: Combine Coverage
run: |
npm i lcov-result-merger
./node_modules/lcov-result-merger/bin/lcov-result-merger.js '*.info' 'lcov.info'

- name: Upload Code Coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: lcov.info

- name: Build Docker Image
run: docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest

- name: Run Integration Tests
run: dotnet test "TransactionProcessorACL.IntegrationTests\TransactionProcessorACL.IntegrationTests.csproj"
39 changes: 39 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Test Pull Requests

on:
pull_request:
branches:
- master

jobs:
build:
name: "Build and Test Pull Requests"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100

- name: Restore Nuget Packages
run: dotnet restore TransactionProcessorACL.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build TransactionProcessorACL.sln --configuration Release

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.Tests.csproj"

- name: Build Docker Image
run: docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest

- name: Run Integration Tests
run: dotnet test "TransactionProcessorACL.IntegrationTests\TransactionProcessorACL.IntegrationTests.csproj" --filter Category=PRTest
16 changes: 16 additions & 0 deletions .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Management

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_draft_release:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.user
*.userosscache
*.sln.docstates
*.[Dd]evelopment.json

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace TransactionProcessorACL.BusinessLogic.RequestHandlers
{
using System;
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Models;
using Requests;

public class ProcessLogonTransactionRequestHandler : IRequestHandler<ProcessLogonTransactionRequest, ProcessLogonTransactionResponse>
{
public async Task<ProcessLogonTransactionResponse> Handle(ProcessLogonTransactionRequest request, CancellationToken cancellationToken)
{
return new ProcessLogonTransactionResponse
{
ResponseCode = "1234"
};
}
}
}
Loading