Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit e1ff251

Browse files
Merge pull request #90 from thefringeninja/head
Various Improvements
2 parents 85efcd3 + 9e7dba3 commit e1ff251

File tree

7 files changed

+45
-32
lines changed

7 files changed

+45
-32
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,41 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
env:
15-
- library-version: 1.2.0-beta.4
15+
- library-version: 1.2.0-beta.5
1616
container-runtime-version: 2.2.5
1717
container-runtime: alpine3.9
1818
runtime: alpine-x64
19-
- library-version: 1.2.0-beta.4
19+
- library-version: 1.2.0-beta.5
2020
container-runtime-version: 2.2.5
2121
container-runtime: alpine3.8
2222
runtime: alpine-x64
23-
- library-version: 1.2.0-beta.4
23+
- library-version: 1.2.0-beta.5
2424
container-runtime-version: 2.2.5
2525
container-runtime: stretch-slim
2626
runtime: debian.9-x64
27-
- library-version: 1.2.0-beta.4
27+
- library-version: 1.2.0-beta.5
2828
container-runtime-version: 2.2.5
2929
container-runtime: bionic
3030
runtime: ubuntu.18.04-x64
3131
runs-on: ubuntu-latest
3232
name: continuous-integration/github/${{ matrix.env.container-runtime }}
3333
steps:
34-
- name: filter
35-
if: github.event_name == 'pull_request'
36-
uses: actions/bin/filter@master
37-
with:
38-
action: "opened|synchronize|reopened"
3934
- name: checkout
4035
uses: actions/checkout@master
4136
- name: build
4237
run: "./build.sh"
4338
env:
39+
REMOTE_IMAGE: sqlstreamstore/server
4440
LIBRARY_VERSION: ${{ matrix.env.library-version }}
4541
CONTAINER_RUNTIME_VERSION: ${{ matrix.env.container-runtime-version }}
4642
CONTAINER_RUNTIME: ${{ matrix.env.container-runtime }}
47-
RUNTIME: ${{ matrix.env.runtime }}
43+
RUNTIME: ${{ matrix.env.runtime }}
44+
- name: Docker Login
45+
uses: actions/docker/login@master
46+
if: github.event_name == 'push'
47+
env:
48+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
49+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
50+
- name: Docker Push
51+
if: github.event_name == 'push'
52+
run: docker push sqlstreamstore/server

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ env:
88
- secure: fKxyki9JzY95G17hNHSy4dgDmH+zXIk50BR6honAz7LmsA9jGv2gg+l1AIUERH3eckdJwxze4K0e5hX88Xfn4j5nN8TnEw7Wwn7c1vjR9FxvRr5cjaJC0SVsOTZj4VC1R9Sqjzrkqv3jJDtDdz9B8aZMdEzJ+BkHwUMFxmuko2p2qabKnAonaGk5VDSTtDyvDMa0aFjKDYuB6MrnrxhfCzLk1ciyGL61SNfz0/u7Hj3xC6v4U0f0BQ9n65l5dIVn+mpuCdQ7GO0HGj0ySo7ffif3qqXXTx7ZWIl3wvf5RCp0PouA8q2dRHYYyGqhhCwuRNU7dfhS/eFtUtcITclZ/DJE86NBQGJ9tpUUhL7BJ3sNJZzbajh1F28paJgi595SKpScp4VGx3iBuDSKH4eb3cRj5TJqCUoscue8/uIZGgR4PGkGF4lbad3b7xexIk1YY/2Rwun1J0N7tqS0rej3ZRZBtipMF64NrVnt9dZzgsIlssZ0W2NvG0vcLX6DUdeZaR0diz8bUl1DXrMFxAUQ/QYxilvaESmCslRElzlb+5eaqQTG5lSP5l6f3ZcKAhvcUGggu9t3vjzpEq3zFa5dorCyK+es1ASNlwZtZr8in9oYkvam9aiDkZD8cEc+9u+qxvnX9w3MsA0P047YCMQGgwRl5dpizoySC3wr52voK7I=
99
- secure: HvSSWjsLR6qFi9/iHMKKoVUT4BDN7h4QjKHLvcrznwpfojrA1+nIlIwgcaIkxi5WClsoPmwW8YInPlyIyV+37+SaNK4sxB2puzwaC3iHBi6Ql38q+olsLdCE8u+DcfEcnzQo8pinNoyBLRjBgHjTAbrwIkLETNOZchss4A4UVhvPSznuNz5imlZxp4LqZ2pW/YcaLeCMQzuJHt5iRM6O4CMu7O4kMP/SPQXIXcqqYWI+o4um1JFO5juXBXtrhcTkOHfvGjqZghwma1F3v7zLHtqrbGBxaTLGNj0EIWPQhQEE5wDpvAqLEZcySl0ZjsPQUJd2Uxi9b8mWM1x6WaZTu9uqIy5t9lkCwUkEAwc/LUXZxwL0oi8HncgJvu7Q5KwVn375sJ0CER0Vn1FO8jphnMbpfkqUmbZmkwoIAUENNNYyGEp6zoNnRvaFQTjEW4bL2huPS0g3BgC2xyh8d5ZsPykIgQXlM8EEA2BZkd+ep2rKjOPT94rs5V5IPuVi9FYzFIsc2kpEkKZO/38j6pEAdCVIZp1m0+KRlLNQ9FeaI+xtil95V5ALIEXpc44o5OuUSoxt5ZirYaGSJtUtxo8E+HqpNL5WrTUeE8+aZos6Tu7jF63U2ehwg5xR6EubvrBjWvSHsQKcwDfdeHK2m15S/mVlahpwyyoCASAJtV7mRJI=
1010
matrix:
11-
- LIBRARY_VERSION=1.2.0-beta.4 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=alpine3.9 RUNTIME=alpine-x64
12-
- LIBRARY_VERSION=1.2.0-beta.4 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=alpine3.8 RUNTIME=alpine-x64
13-
- LIBRARY_VERSION=1.2.0-beta.4 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=bionic RUNTIME=ubuntu.18.04-x64
14-
- LIBRARY_VERSION=1.2.0-beta.4 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=stretch-slim RUNTIME=debian.9-x64
11+
- LIBRARY_VERSION=1.2.0-beta.5 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=alpine3.9 RUNTIME=alpine-x64
12+
- LIBRARY_VERSION=1.2.0-beta.5 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=alpine3.8 RUNTIME=alpine-x64
13+
- LIBRARY_VERSION=1.2.0-beta.5 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=bionic RUNTIME=ubuntu.18.04-x64
14+
- LIBRARY_VERSION=1.2.0-beta.5 CONTAINER_RUNTIME_VERSION=2.2.5 CONTAINER_RUNTIME=stretch-slim RUNTIME=debian.9-x64
1515
git:
1616
depth: false

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG CONTAINER_RUNTIME_VERSION=2.2.5
1+
ARG CONTAINER_RUNTIME_VERSION=2.2.6
22
ARG CONTAINER_RUNTIME=alpine3.9
33

44
FROM node:10.12.0-alpine AS build-javascript
@@ -20,7 +20,7 @@ RUN yarn && \
2020
yarn react-scripts-ts build && \
2121
echo ${CLIENT_VERSION} > /app/.clientversion
2222

23-
FROM mcr.microsoft.com/dotnet/core/sdk:2.2.300-stretch AS build-dotnet
23+
FROM mcr.microsoft.com/dotnet/core/sdk:2.2.401-stretch AS build-dotnet
2424
ARG CLIENT_PACKAGE=@sqlstreamstore/browser
2525
ARG RUNTIME=alpine-x64
2626
ARG LIBRARY_VERSION=1.2.0

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# SQL Stream Store HTTP Server [![Build Status](https://travis-ci.org/SQLStreamStore/SQLStreamStore.HAL.svg?branch=master)](https://travis-ci.org/SQLStreamStore/SQLStreamStore.HAL)
1+
# SQL Stream Store HTTP Server [![Build Status](https://github.com/SQLStreamStore/SQLStreamStore.Docker/workflows/Build/badge.svg)](https://github.com/SQLStreamStore/SQLStreamStore.Docker/actions?workflowID=Build)
22

33
Fully RESTful HTTP Server for [SQL Stream Store](https://github.com/SQLStreamStore/SQLStreamStore). Uses [application/hal+json](https://tools.ietf.org/html/draft-kelly-json-hal-08) for resource navigation, with [JSON Hyper-Schema](https://json-schema.org/latest/json-schema-hypermedia.html) as [embedded resources](https://tools.ietf.org/html/draft-kelly-json-hal-08#section-4.1.2).
44

5-
The solution includes example of use LittleHalHost.Example project. The url structure and parameters are described in LittleHalHost.Example/readme.md
6-
75
# Development
86

97
- `./build.sh` or `./build.cmd` to run the complete dockerized build.

build.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-alpine3.9}
6-
LIBRARY_VERSION=${LIBRARY_VERSION:-1.2.0-beta.3.28}
6+
LIBRARY_VERSION=${LIBRARY_VERSION:-1.2.0-beta.5.5}
77
CLIENT_VERSION=${CLIENT_VERSION:-0.9.3}
88

99
LOCAL_IMAGE="sql-stream-store-server"
@@ -12,16 +12,14 @@ LOCAL="${LOCAL_IMAGE}:latest"
1212
REMOTE_IMAGE="sqlstreamstore/server"
1313

1414
docker build \
15-
--build-arg MYGET_API_KEY=$MYGET_API_KEY \
16-
--build-arg CONTAINER_RUNTIME_VERSION=${CONTAINER_RUNTIME_VERSION:-2.2.5} \
15+
--build-arg CONTAINER_RUNTIME_VERSION=${CONTAINER_RUNTIME_VERSION:-2.2.6} \
1716
--build-arg CONTAINER_RUNTIME=${CONTAINER_RUNTIME} \
1817
--build-arg RUNTIME=${RUNTIME:-alpine-x64} \
1918
--build-arg LIBRARY_VERSION=${LIBRARY_VERSION} \
2019
--build-arg CLIENT_VERSION=${CLIENT_VERSION} \
2120
--tag ${LOCAL} \
2221
.
2322

24-
2523
SEMVER_REGEX="^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$"
2624

2725
[[ $LIBRARY_VERSION =~ $SEMVER_REGEX ]]
@@ -39,9 +37,4 @@ else
3937
docker tag $LOCAL $MAJOR_MINOR_PATCH_PRE
4038
fi
4139

42-
if [[ -n $DOCKER_USER ]]; then
43-
echo "${DOCKER_PASS}" | docker login --username "${DOCKER_USER}" --password-stdin
44-
docker push $REMOTE_IMAGE
45-
fi
46-
4740
docker images --filter=reference="${REMOTE_IMAGE}"

src/SqlStreamStore.Server/HealthProbeMiddleware.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ internal static class HealthProbeMiddleware
1313
{
1414
public static IApplicationBuilder UseHealthProbe(
1515
this IApplicationBuilder builder, IReadonlyStreamStore streamStore)
16-
=> builder.UseRouter(router => router
17-
.MapMiddlewareGet("ready", inner => inner.Use(Ready(streamStore)))
18-
.MapMiddlewareGet("live", inner => inner.Use(Live)));
16+
=> builder
17+
.Use(GetAndHeadOnly)
18+
.UseRouter(router => router
19+
.MapMiddlewareGet("ready", inner => inner.Use(Ready(streamStore)))
20+
.MapMiddlewareGet("live", inner => inner.Use(Live)));
1921

2022
private static MidFunc Live => (context, next) =>
2123
{
@@ -37,5 +39,20 @@ private static MidFunc Ready(IReadonlyStreamStore streamStore) => async (context
3739

3840
context.Response.StatusCode = 204;
3941
};
42+
43+
private static MidFunc GetAndHeadOnly => (context, next) =>
44+
{
45+
switch (context.Request.Method)
46+
{
47+
case "HEAD":
48+
context.Request.Method = "GET";
49+
return next();
50+
case "GET":
51+
return next();
52+
default:
53+
context.Response.StatusCode = 405;
54+
return Task.CompletedTask;
55+
}
56+
};
4057
}
4158
}

src/SqlStreamStore.Server/SqlStreamStore.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
66
<LangVersion>latest</LangVersion>
77
<CrossGenDuringPublish>false</CrossGenDuringPublish>
8-
<LibraryVersion Condition="$(LibraryVersion) == ''">1.2.0-beta.3.28</LibraryVersion>
8+
<LibraryVersion Condition="$(LibraryVersion) == ''">1.2.0-beta.5.5</LibraryVersion>
99
<StartupObject></StartupObject>
1010
</PropertyGroup>
1111
<ItemGroup>

0 commit comments

Comments
 (0)