Skip to content

Commit

Permalink
feat: open source with MIT license as 'agentschap Informatie Vlaanderen'
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Dec 16, 2018
0 parents commit 3d3787b
Show file tree
Hide file tree
Showing 25 changed files with 10,080 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: 2

jobs:
build:
docker:
- image: basisregisters/build-agent:latest

environment:
MYGET_FEED: /F/basisregisters
MYGET_FEED_USER: informatievlaanderen
MYGET_HOST: https://informatievlaanderen.myget.org
GIT_USERNAME: release-bot
GIT_AUTHOR_NAME: release-bot
GIT_COMMITTER_NAME: release-bot
GIT_EMAIL: informatie.vlaanderen@vlaanderen.be
GIT_AUTHOR_EMAIL: informatie.vlaanderen@vlaanderen.be
GIT_COMMITTER_EMAIL: informatie.vlaanderen@vlaanderen.be
CONFLUENCE_USERNAME: david.cumps@kb.vlaanderen.be

steps:
- checkout

- restore_cache:
name: Restore node_modules cache
keys:
- v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
- v1-node-{{ arch }}-{{ .Branch }}-
- v1-node-{{ arch }}-

- restore_cache:
name: Restore Paket cache
keys:
- v1-paket-{{ arch }}-{{ .Branch }}-{{ checksum "paket.dependencies" }}
- v1-paket-{{ arch }}-{{ .Branch }}-
- v1-paket-{{ arch }}-

- run:
name: Nodejs Version
command: node --version

- run:
name: Install NPM dependencies (master)
command: |
if [ "$CIRCLE_BRANCH" == "master" ];
then
npm install;
fi
- run:
name: Run Semantic Release (master)
command: |
if [ "$CIRCLE_BRANCH" == "master" ];
then
npx semantic-release;
fi
- run:
name: Run Build (non-master)
command: |
if [ "$CIRCLE_BRANCH" != "master" ];
then
./build.sh;
fi
- save_cache:
name: Save node_modules cache
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules

- save_cache:
name: Save Paket cache
key: v1-paket-{{ arch }}-{{ .Branch }}-{{ checksum "paket.dependencies" }}
paths:
- ~/.nuget/packages
- packages
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.cs]
indent_size = 4
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto

*.js text eol=lf
*.ts text eol=lf
*.vue text eol=lf
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.vs/
.fake/
.idea/

[Pp]ackages/
[Pp]aket-files/
[Dd]ebug/
[Rr]elease/
[Bb]build/
[Bb]in/
[Oo]bj/
[Xx]64/
[Dd]ist/

*.suo
*.user
*.sln.docstates
*.ntvs*
*.njsproj
*.trx

node_modules/
bower_components/
debug.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.ncrunchproject
*ncrunchsolution
_Ncrunch_*
TestResults.xml

.DS_Store
ehthumbs.db
Icon?
Thumbs.db
383 changes: 383 additions & 0 deletions .paket/Paket.Restore.targets

Large diffs are not rendered by default.

Binary file added .paket/paket.exe
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{ED752CB6-0C58-4520-8091-2630647230C6}"
ProjectSection(SolutionItems) = preProject
paket.dependencies = paket.dependencies
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C2F8FF63-7A48-4179-A720-86206C42F496}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A1834318-2802-4E88-B720-A33B9214F680}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress", "src\Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress\Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress.csproj", "{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{453A566F-E4D5-4D12-A5A7-67D02B4330FD}"
ProjectSection(SolutionItems) = preProject
build.fsx = build.fsx
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Debug|x64.ActiveCfg = Debug|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Debug|x64.Build.0 = Debug|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Debug|x86.ActiveCfg = Debug|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Debug|x86.Build.0 = Debug|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Release|Any CPU.Build.0 = Release|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Release|x64.ActiveCfg = Release|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Release|x64.Build.0 = Release|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Release|x86.ActiveCfg = Release|Any CPU
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7FA0BF0A-B98F-4455-A9D1-01B22538A9B9} = {C2F8FF63-7A48-4179-A720-86206C42F496}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2EB87445-E263-4E1E-89CC-3839170028E5}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMIXED_005FENUM/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/ExternalSources/PdbNavigation/UseSymbolFiles/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\Users\cumpsda\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v09_ca8ad1ed\SolutionCaches</s:String></wpf:ResourceDictionary>
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 agentschap Informatie Vlaanderen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress

Middleware component which adds a the remote IP id as a claim `urn:be:vlaanderen:vbr:ip` for the user on the request context.

## Usage

```csharp
public void Configure(IApplicationBuilder app, ...)
{
app
...
.UseMiddleware<AddRemoteIpAddressMiddleware>()
...
}
```
76 changes: 76 additions & 0 deletions SEMVER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Versioning approach

## Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the change log**.

The commit message formatting can be added using a typical git workflow or through the use of a CLI
wizard ([Commitizen](https://github.com/commitizen/cz-cli)). To use the wizard, run `yarn run commit`
in your terminal after staging your changes in git.

### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read in various git tools.

### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header
of the reverted commit.
In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit
being reverted.
A commit with this format is automatically created by the [`git revert`][git-revert] command.

### Type
Must be one of the following:

* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing or correcting existing tests
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
* **revert**: Reverts a previous commit

### Scope
The scope could be anything specifying place of the commit change. For example `core`,
`README`, `ui`, etc...

You can use `*` when the change affects more than a single scope.

### Subject
The subject contains succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end

### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
[reference Jira issues that this commit closes][https://confluence.atlassian.com/bitbucket/processing-jira-software-issues-with-smart-commit-messages-298979931.html].

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
The rest of the commit message is then used for this.

A detailed explanation can be found in this [document][https://docs.google.com/document/d/1FL1N2tXY3B7rKAYEsson8cmERao5x73Z4aaSsrhjpFI/edit?usp=sharing].
10 changes: 10 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
cls

.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)

"packages\FAKE\tools\Fake.exe" build.fsx %*
pause
40 changes: 40 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#load "packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/build-generic.fsx"

open Fake
open ``Build-generic``

let assemblyVersionNumber = (sprintf "%s.0")
let nugetVersionNumber = (sprintf "%s")

let build = buildSolution assemblyVersionNumber
let publish = publishSolution assemblyVersionNumber
let pack = packSolution nugetVersionNumber

Target "Clean" (fun _ ->
CleanDir buildDir
)

// Library ------------------------------------------------------------------------

Target "Lib_Build" (fun _ -> build "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress")

Target "Lib_Publish" (fun _ -> publish "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress")
Target "Lib_Pack" (fun _ -> pack "Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Middleware.AddRemoteIpAddress")

// --------------------------------------------------------------------------------

Target "PublishLibrary" DoNothing
Target "PublishAll" DoNothing

Target "PackageMyGet" DoNothing
Target "PackageAll" DoNothing

// Publish ends up with artifacts in the build folder
"DotNetCli" ==> "Clean" ==> "Restore" ==> "Lib_Build" ==> "Lib_Publish" ==> "PublishLibrary"
"PublishLibrary" ==> "PublishAll"

// Package ends up with local NuGet packages
"PublishLibrary" ==> "Lib_Pack" ==> "PackageMyGet"
"PackageMyGet" ==> "PackageAll"

RunTargetOrDefault "Lib_Build"
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e

PAKET_EXE=.paket/paket.exe
FAKE_EXE=packages/FAKE/tools/FAKE.exe

run() {
if [ "$OS" != "Windows_NT" ]
then
mono "$@"
else
"$@"
fi
}

run $PAKET_EXE restore

chmod +x packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/*

run $FAKE_EXE build.fsx "$@"
8 changes: 8 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"sdk": {
"version": "2.2.101"
},
"clr": {
"version": "2.2.0"
}
}
Loading

0 comments on commit 3d3787b

Please sign in to comment.