Skip to content

Commit 29552af

Browse files
authored
feat(OSS-705): Concourse CI release pipeline (#159)
1 parent 74dee6f commit 29552af

File tree

7 files changed

+148
-0
lines changed

7 files changed

+148
-0
lines changed

concourse/pipeline.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
resources:
3+
- name: fauna-csharp-repository
4+
type: git
5+
icon: github
6+
source:
7+
uri: https://github.com/fauna/faunadb-csharp
8+
branch: master
9+
10+
jobs:
11+
- name: release
12+
serial: true
13+
public: false
14+
plan:
15+
- get: fauna-csharp-repository
16+
17+
- task: integration-tests
18+
file: fauna-csharp-repository/concourse/tasks/integration-tests.yml
19+
privileged: true
20+
params:
21+
FAUNA_ROOT_KEY: ((fauna.secret))
22+
FAUNA_DOMAIN: ((fauna.domain))
23+
FAUNA_SCHEME: ((fauna.scheme))
24+
FAUNA_PORT: ((fauna.port))
25+
FAUNA_REPO_PASSWORD: ((gcr-key))
26+
27+
- task: publish
28+
file: fauna-csharp-repository/concourse/tasks/publish.yml
29+
params:
30+
NUGET_API_KEY: ((nuget_api_key))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -eou
4+
5+
apk add --no-cache -X http://dl-4.alpinelinux.org/alpine/edge/testing mono
6+
apk add --no-cache ca-certificates
7+
update-ca-certificates
8+
9+
dotnet test --framework net45
10+
dotnet test --framework net5.0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
set -eou
4+
5+
dotnet test --framework netcoreapp3.1

concourse/scripts/publish.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
set -eou
4+
5+
cd ./fauna-csharp-repository
6+
7+
dotnet clean
8+
dotnet restore
9+
dotnet build ./FaunaDB.Client --configuration Release
10+
dotnet pack ./FaunaDB.Client/FaunaDB.Client.csproj --no-build --no-restore --include-symbols -p:SymbolPackageFormat=snupkg --include-source --configuration Release
11+
12+
dotnet nuget push ./FaunaDB.Client/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
platform: linux
3+
image_resource:
4+
type: registry-image
5+
source:
6+
repository: karlkfi/concourse-dcind
7+
8+
params:
9+
FAUNA_ROOT_KEY:
10+
FAUNA_DOMAIN:
11+
FAUNA_SCHEME:
12+
FAUNA_PORT:
13+
FAUNA_REPO_PASSWORD:
14+
15+
inputs:
16+
- name: fauna-csharp-repository
17+
18+
run:
19+
path: entrypoint.sh
20+
args:
21+
- bash
22+
- -ceu
23+
- |
24+
docker login -u _json_key -p "$FAUNA_REPO_PASSWORD" https://gcr.io > /dev/null 2>&1
25+
# start containers
26+
docker-compose -f fauna-csharp-repository/concourse/tasks/integration.yml run tests-net5
27+
docker-compose -f fauna-csharp-repository/concourse/tasks/integration.yml run tests-netcore
28+
# stop and remove containers
29+
docker-compose -f fauna-csharp-repository/concourse/tasks/integration.yml down
30+
# remove volumes
31+
docker volume rm $(docker volume ls -q)
32+
docker logout

concourse/tasks/integration.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: "3.3"
2+
3+
services:
4+
faunadb:
5+
image: gcr.io/faunadb-cloud/faunadb/enterprise/stable:latest
6+
container_name: faunadb
7+
healthcheck:
8+
test: ["CMD", "curl" ,"http://faunadb:8443/ping"]
9+
interval: 1s
10+
timeout: 3s
11+
retries: 30
12+
13+
tests-net5:
14+
environment:
15+
- FAUNA_ROOT_KEY
16+
- FAUNA_DOMAIN
17+
- FAUNA_SCHEME
18+
- FAUNA_PORT
19+
image: mcr.microsoft.com/dotnet/sdk:5.0-alpine
20+
container_name: mytests-net5
21+
depends_on:
22+
- faunadb
23+
volumes:
24+
- "../../:/tmp/app"
25+
working_dir: "/tmp/app"
26+
command:
27+
- concourse/scripts/integration-tests-net5.sh
28+
29+
tests-netcore:
30+
environment:
31+
- FAUNA_ROOT_KEY
32+
- FAUNA_DOMAIN
33+
- FAUNA_SCHEME
34+
- FAUNA_PORT
35+
image: mcr.microsoft.com/dotnet/sdk:3.1-alpine
36+
container_name: mytests-netcore
37+
depends_on:
38+
- faunadb
39+
volumes:
40+
- "../../:/tmp/app"
41+
working_dir: "/tmp/app"
42+
command:
43+
- concourse/scripts/integration-tests-netcore.sh

concourse/tasks/publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
platform: linux
3+
image_resource:
4+
type: registry-image
5+
source:
6+
repository: mcr.microsoft.com/dotnet/sdk
7+
tag: 5.0-alpine
8+
9+
params:
10+
NUGET_API_KEY:
11+
12+
inputs:
13+
- name: fauna-csharp-repository
14+
15+
run:
16+
path: ./fauna-csharp-repository/concourse/scripts/publish.sh

0 commit comments

Comments
 (0)