Skip to content

Commit

Permalink
Merge pull request #25 from kuzzleio/0.2.0-proposal
Browse files Browse the repository at this point in the history
# [0.2.0](https://github.com/kuzzleio/sdk-csharp/releases/tag/0.2.0) (2019-07-17)


#### New features

- [ [#22](#22) ] Add Admin controller and unit tests   ([Shiranuit](https://github.com/Shiranuit))
- [ [#23](#23) ] Add Index Controller   ([alexandrebouthinon](https://github.com/alexandrebouthinon))

#### Enhancements

- [ [#14](#14) ] Fix optional parameters design   ([scottinet](https://github.com/scottinet))
- [ [#13](#13) ] Add unit tests for the collection controller   ([scottinet](https://github.com/scottinet))
- [ [#12](#12) ] Add unit tests for the auth controller   ([scottinet](https://github.com/scottinet))
- [ [#11](#11) ] Initialize unit tests project   ([scottinet](https://github.com/scottinet))

#### Others

- [ [#24](#24) ] Rewrite WebSocket class   ([scottinet](https://github.com/scottinet), [alexandrebouthinon](https://github.com/alexandrebouthinon))
- [ [#20](#20) ] Add documentation runner   ([Aschen](https://github.com/Aschen))
- [ [#18](#18) ] Add unit test for Realtime Controller    ([ThomasF34](https://github.com/ThomasF34))
- [ [#17](#17) ] Unit tests kuzzle class   ([Aschen](https://github.com/Aschen))
- [ [#16](#16) ] Add unit tests for the server controller   ([ThomasF34](https://github.com/ThomasF34))
- [ [#15](#15) ] Add unit tests for the document controller   ([scottinet](https://github.com/scottinet))
---
  • Loading branch information
scottinet authored Jul 18, 2019
2 parents 857f541 + bf483ae commit 6c43c29
Show file tree
Hide file tree
Showing 58 changed files with 3,406 additions and 547 deletions.
19 changes: 19 additions & 0 deletions .ci/doc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---

snippets:
mount: /mnt
path: doc/**/snippets/*.test.yml
templates: /mnt/.ci/doc/templates

runners:
default: csharp

csharp:
service: doc-runner-csharp
path: /var/snippets/csharp
lint:
cmd: echo "lint me master"
build:
cmd: dotnet build /mnt/Kuzzle/Kuzzle.csproj && mv /mnt/Kuzzle/bin/Debug/netstandard2.0/Kuzzle.dll /var/snippets/csharp/.
run:
cmd: dotnet script {{ snippet.source }}
52 changes: 52 additions & 0 deletions .ci/doc/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: '3'

services:
kuzzle:
image: kuzzleio/kuzzle
ports:
- "7512:7512"
cap_add:
- SYS_PTRACE
depends_on:
- redis
- elasticsearch
container_name: kuzzle
environment:
- kuzzle_services__db__client__host=http://elasticsearch:9200
- kuzzle_services__internalCache__node__host=redis
- kuzzle_services__memoryStorage__node__host=redis
- NODE_ENV=production

redis:
image: redis:5

elasticsearch:
image: kuzzleio/elasticsearch:5.6.10
ulimits:
nofile: 65536
environment:
- cluster.name=kuzzle
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"

doc-tests:
image: kuzzleio/snippets-tests
privileged: true
depends_on:
- kuzzle
- doc-runner-csharp
volumes:
- ../..:/mnt
- /var/run/docker.sock:/var/run/docker.sock
- snippets:/var/snippets
environment:
- CONFIG_FILE=/mnt/.ci/doc/config.yml

doc-runner-csharp:
image: kuzzleio/doc-runner:csharp
command: tail -f /dev/null
volumes:
- ../..:/mnt
- snippets:/var/snippets

volumes:
snippets:
32 changes: 32 additions & 0 deletions .ci/doc/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM amd64/debian:stretch-slim

LABEL io.kuzzle.vendor="Kuzzle <[email protected]>"
LABEL description="Runner for csharp documentation snippets"
LABEL name="kuzzleio/doc-runner:csharp"

ENV DOTNET_CLI_TELEMETRY_OPTOUT 1

RUN apt-get update && apt-get install -y \
make \
pkg-config \
build-essential \
git \
apt-transport-https \
dirmngr \
gnupg \
ca-certificates \
curl

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update \
&& apt-get install -y mono-devel \
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& curl -o /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/debian/9/prod.list \
&& apt-get update \
&& apt-get install -y dotnet-sdk-2.1 \
&& dotnet tool install -g dotnet-script

ENV PATH $PATH:/root/.dotnet/tools

WORKDIR /app
13 changes: 13 additions & 0 deletions .ci/doc/templates/default.tpl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#r "Kuzzle.dll"
using System;
using System.Threading;
using System.Threading.Tasks;
using KuzzleSdk;
using KuzzleSdk.Protocol;

WebSocket socket = new WebSocket(new Uri("ws://kuzzle:7512"));
KuzzleSdk.Kuzzle kuzzle = new KuzzleSdk.Kuzzle(socket);

kuzzle.ConnectAsync(CancellationToken.None).Wait();

[snippet-code]
31 changes: 31 additions & 0 deletions .ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3'

services:
kuzzle:
image: kuzzleio/kuzzle
ports:
- "7512:7512"
cap_add:
- SYS_PTRACE
depends_on:
- redis
- elasticsearch
environment:
- kuzzle_services__db__client__host=http://elasticsearch:9200
- kuzzle_services__internalCache__node__host=redis
- kuzzle_services__memoryStorage__node__host=redis
- NODE_ENV=production

redis:
image: redis:5

elasticsearch:
image: kuzzleio/elasticsearch:5.6.10
ulimits:
nofile: 65536
environment:
- cluster.name=kuzzle
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"

volumes:
snippets:
12 changes: 12 additions & 0 deletions .ci/start_kuzzle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
# Download and launch custom Kuzzle stack

docker-compose -f .ci/docker-compose.yml up -d

printf 'Waiting for Kuzzle stack to be up and running'

until $(curl --output /dev/null --silent --head --fail http://localhost:7512); do
printf '.'
sleep 5
done
5 changes: 5 additions & 0 deletions .ci/stop_kuzzle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
# Download and launch custom Kuzzle stack

docker-compose -f .ci/docker-compose.yml stop
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
build/
packages/
.vscode/
.vs/

*/bin/
*/obj/
*.csproj.nuget.cache
mono_crash.*
lcov.info
codecov
Empty file removed .gitmodules
Empty file.
63 changes: 48 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,50 @@
language: csharp
solution: sdk-csharp.sln
sudo: required
dist: xenial
dotnet: 2.2
mono: latest
install:
- dotnet restore
jobs:
include:
- stage: "Tests"
name: "Unit Tests"
if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-dev$/ OR type = cron
language: csharp
solution: sdk-csharp.sln
sudo: required
dist: xenial
dotnet: 2.2
mono: latest
install:
- dotnet restore

script:
- dotnet build $TRAVIS_BUILD_DIR/Kuzzle/Kuzzle.csproj -c Release
script:
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=$TRAVIS_BUILD_DIR/lcov.info
- curl -s https://codecov.io/bash > codecov && bash codecov

deploy:
skip_cleanup: true
email: [email protected]
provider: script
script: bash deploy.sh
- stage: "Tests"
name: "Documentation"
if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-dev$/ OR type = cron
stage: Tests
language: node_js
node_js: 8

script:
- docker-compose -f .ci/doc/docker-compose.yml run doc-tests node index

- stage: "Deployments"
name: "NuGet"
if: tag IS present AND branch = master
language: csharp
solution: sdk-csharp.sln
sudo: required
dist: xenial
dotnet: 2.2
mono: latest
install:
- dotnet restore

script:
# incompatibilities with msbuild, so building with .net core instead
- dotnet build $TRAVIS_BUILD_DIR/Kuzzle/Kuzzle.csproj -c Release
- dotnet build $TRAVIS_BUILD_DIR/Kuzzle.Tests/Kuzzle.Tests.csproj

deploy:
skip_cleanup: true
email: [email protected]
provider: script
script: bash deploy.sh
Loading

0 comments on commit 6c43c29

Please sign in to comment.