Skip to content

Commit 6c43c29

Browse files
authored
Merge pull request #25 from kuzzleio/0.2.0-proposal
# [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)) ---
2 parents 857f541 + bf483ae commit 6c43c29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3406
-547
lines changed

.ci/doc/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
3+
snippets:
4+
mount: /mnt
5+
path: doc/**/snippets/*.test.yml
6+
templates: /mnt/.ci/doc/templates
7+
8+
runners:
9+
default: csharp
10+
11+
csharp:
12+
service: doc-runner-csharp
13+
path: /var/snippets/csharp
14+
lint:
15+
cmd: echo "lint me master"
16+
build:
17+
cmd: dotnet build /mnt/Kuzzle/Kuzzle.csproj && mv /mnt/Kuzzle/bin/Debug/netstandard2.0/Kuzzle.dll /var/snippets/csharp/.
18+
run:
19+
cmd: dotnet script {{ snippet.source }}

.ci/doc/docker-compose.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: '3'
2+
3+
services:
4+
kuzzle:
5+
image: kuzzleio/kuzzle
6+
ports:
7+
- "7512:7512"
8+
cap_add:
9+
- SYS_PTRACE
10+
depends_on:
11+
- redis
12+
- elasticsearch
13+
container_name: kuzzle
14+
environment:
15+
- kuzzle_services__db__client__host=http://elasticsearch:9200
16+
- kuzzle_services__internalCache__node__host=redis
17+
- kuzzle_services__memoryStorage__node__host=redis
18+
- NODE_ENV=production
19+
20+
redis:
21+
image: redis:5
22+
23+
elasticsearch:
24+
image: kuzzleio/elasticsearch:5.6.10
25+
ulimits:
26+
nofile: 65536
27+
environment:
28+
- cluster.name=kuzzle
29+
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
30+
31+
doc-tests:
32+
image: kuzzleio/snippets-tests
33+
privileged: true
34+
depends_on:
35+
- kuzzle
36+
- doc-runner-csharp
37+
volumes:
38+
- ../..:/mnt
39+
- /var/run/docker.sock:/var/run/docker.sock
40+
- snippets:/var/snippets
41+
environment:
42+
- CONFIG_FILE=/mnt/.ci/doc/config.yml
43+
44+
doc-runner-csharp:
45+
image: kuzzleio/doc-runner:csharp
46+
command: tail -f /dev/null
47+
volumes:
48+
- ../..:/mnt
49+
- snippets:/var/snippets
50+
51+
volumes:
52+
snippets:

.ci/doc/docker/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM amd64/debian:stretch-slim
2+
3+
LABEL io.kuzzle.vendor="Kuzzle <support@kuzzle.io>"
4+
LABEL description="Runner for csharp documentation snippets"
5+
LABEL name="kuzzleio/doc-runner:csharp"
6+
7+
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
8+
9+
RUN apt-get update && apt-get install -y \
10+
make \
11+
pkg-config \
12+
build-essential \
13+
git \
14+
apt-transport-https \
15+
dirmngr \
16+
gnupg \
17+
ca-certificates \
18+
curl
19+
20+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
21+
&& echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
22+
&& apt-get update \
23+
&& apt-get install -y mono-devel \
24+
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
25+
&& curl -o /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/debian/9/prod.list \
26+
&& apt-get update \
27+
&& apt-get install -y dotnet-sdk-2.1 \
28+
&& dotnet tool install -g dotnet-script
29+
30+
ENV PATH $PATH:/root/.dotnet/tools
31+
32+
WORKDIR /app

.ci/doc/templates/default.tpl.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#r "Kuzzle.dll"
2+
using System;
3+
using System.Threading;
4+
using System.Threading.Tasks;
5+
using KuzzleSdk;
6+
using KuzzleSdk.Protocol;
7+
8+
WebSocket socket = new WebSocket(new Uri("ws://kuzzle:7512"));
9+
KuzzleSdk.Kuzzle kuzzle = new KuzzleSdk.Kuzzle(socket);
10+
11+
kuzzle.ConnectAsync(CancellationToken.None).Wait();
12+
13+
[snippet-code]

.ci/docker-compose.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: '3'
2+
3+
services:
4+
kuzzle:
5+
image: kuzzleio/kuzzle
6+
ports:
7+
- "7512:7512"
8+
cap_add:
9+
- SYS_PTRACE
10+
depends_on:
11+
- redis
12+
- elasticsearch
13+
environment:
14+
- kuzzle_services__db__client__host=http://elasticsearch:9200
15+
- kuzzle_services__internalCache__node__host=redis
16+
- kuzzle_services__memoryStorage__node__host=redis
17+
- NODE_ENV=production
18+
19+
redis:
20+
image: redis:5
21+
22+
elasticsearch:
23+
image: kuzzleio/elasticsearch:5.6.10
24+
ulimits:
25+
nofile: 65536
26+
environment:
27+
- cluster.name=kuzzle
28+
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
29+
30+
volumes:
31+
snippets:

.ci/start_kuzzle.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
# Download and launch custom Kuzzle stack
4+
5+
docker-compose -f .ci/docker-compose.yml up -d
6+
7+
printf 'Waiting for Kuzzle stack to be up and running'
8+
9+
until $(curl --output /dev/null --silent --head --fail http://localhost:7512); do
10+
printf '.'
11+
sleep 5
12+
done

.ci/stop_kuzzle.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
# Download and launch custom Kuzzle stack
4+
5+
docker-compose -f .ci/docker-compose.yml stop

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
build/
22
packages/
3+
.vscode/
34
.vs/
45

56
*/bin/
67
*/obj/
78
*.csproj.nuget.cache
9+
mono_crash.*
10+
lcov.info
11+
codecov

.gitmodules

Whitespace-only changes.

.travis.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,50 @@
1-
language: csharp
2-
solution: sdk-csharp.sln
3-
sudo: required
4-
dist: xenial
5-
dotnet: 2.2
6-
mono: latest
7-
install:
8-
- dotnet restore
1+
jobs:
2+
include:
3+
- stage: "Tests"
4+
name: "Unit Tests"
5+
if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-dev$/ OR type = cron
6+
language: csharp
7+
solution: sdk-csharp.sln
8+
sudo: required
9+
dist: xenial
10+
dotnet: 2.2
11+
mono: latest
12+
install:
13+
- dotnet restore
914

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

13-
deploy:
14-
skip_cleanup: true
15-
email: support@kuzzle.io
16-
provider: script
17-
script: bash deploy.sh
19+
- stage: "Tests"
20+
name: "Documentation"
21+
if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-dev$/ OR type = cron
22+
stage: Tests
23+
language: node_js
24+
node_js: 8
25+
26+
script:
27+
- docker-compose -f .ci/doc/docker-compose.yml run doc-tests node index
28+
29+
- stage: "Deployments"
30+
name: "NuGet"
31+
if: tag IS present AND branch = master
32+
language: csharp
33+
solution: sdk-csharp.sln
34+
sudo: required
35+
dist: xenial
36+
dotnet: 2.2
37+
mono: latest
38+
install:
39+
- dotnet restore
40+
41+
script:
42+
# incompatibilities with msbuild, so building with .net core instead
43+
- dotnet build $TRAVIS_BUILD_DIR/Kuzzle/Kuzzle.csproj -c Release
44+
- dotnet build $TRAVIS_BUILD_DIR/Kuzzle.Tests/Kuzzle.Tests.csproj
45+
46+
deploy:
47+
skip_cleanup: true
48+
email: support@kuzzle.io
49+
provider: script
50+
script: bash deploy.sh

0 commit comments

Comments
 (0)