Skip to content

Commit 181e1a2

Browse files
authored
OSS-775: Create docs for C# driver (#169)
1 parent 133c283 commit 181e1a2

File tree

7 files changed

+2776
-2
lines changed

7 files changed

+2776
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
[![NuGet](https://img.shields.io/nuget/v/FaunaDB.Client.svg?maxAge=21600)](https://www.nuget.org/packages/FaunaDB.Client/)
44
[![License](https://img.shields.io/badge/license-MPL_2.0-blue.svg?maxAge=2592000)](https://raw.githubusercontent.com/fauna/faunadb-csharp/main/LICENSE)
55

6+
## Documentation
7+
8+
C# doc are hosted on GitHub:
9+
10+
* [faunadb-csharp](https://fauna.github.io/faunadb-csharp/4.1.0/)
11+
612
## How to Build
713

814
### Requirements

concourse/pipeline.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ resources:
55
icon: github
66
source:
77
uri: https://github.com/fauna/faunadb-csharp
8-
branch: main
8+
branch: v4
9+
10+
- name: fauna-csharp-repository-docs
11+
type: git
12+
icon: github
13+
source:
14+
uri: [email protected]:fauna/faunadb-csharp.git
15+
branch: gh-pages
16+
private_key: ((github_repo_key))
917

1018
jobs:
1119
- name: release
1220
serial: true
1321
public: false
1422
plan:
1523
- get: fauna-csharp-repository
16-
24+
- get: fauna-csharp-repository-docs
25+
1726
- task: integration-tests
1827
file: fauna-csharp-repository/concourse/tasks/integration-tests.yml
1928
privileged: true
@@ -28,3 +37,10 @@ jobs:
2837
file: fauna-csharp-repository/concourse/tasks/publish.yml
2938
params:
3039
NUGET_API_KEY: ((nuget_api_key))
40+
41+
- task: publish-docs
42+
file: fauna-csharp-repository/concourse/tasks/publish-docs.yml
43+
44+
- put: fauna-csharp-repository-docs
45+
params:
46+
repository: fauna-csharp-repository-updated-docs

concourse/scripts/body_gtm.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Google Tag Manager (noscript) --><noscript><iframe src="https:\/\/www.googletagmanager.com\/ns.html?id=GTM-TGTQJ7M" height="0" width="0" style="display:none;visibility:hidden"><\/iframe><\/noscript><!-- End Google Tag Manager (noscript) -->

concourse/scripts/head_gtm.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https:\/\/www.googletagmanager.com\/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-TGTQJ7M');<\/script><!-- End Google Tag Manager -->

concourse/scripts/publish_docs.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/sh
2+
set -eou
3+
cd ./fauna-csharp-repository
4+
5+
apk add xmlstarlet
6+
PACKAGE_VERSION=$(xml sel -t -v "/Project/PropertyGroup/Version" ./FaunaDB.Client/FaunaDB.Client.csproj)
7+
8+
echo "Current docs version: $PACKAGE_VERSION"
9+
cd ../
10+
git clone fauna-csharp-repository-docs fauna-csharp-repository-updated-docs
11+
12+
cd fauna-csharp-repository-updated-docs
13+
14+
mkdir "${PACKAGE_VERSION}"
15+
cd "${PACKAGE_VERSION}"
16+
17+
sed -i.bak "s/_DOC_VERSION_/${PACKAGE_VERSION}/" ../../fauna-csharp-repository/doc/Doxyfile
18+
19+
apk add doxygen
20+
21+
doxygen "../../fauna-csharp-repository/doc/Doxyfile"
22+
rm -r man
23+
rm -r latex
24+
cp -a ./html/. ./
25+
rm -r html
26+
27+
echo "Documentation created"
28+
29+
apk add --no-progress --no-cache sed
30+
31+
echo "================================="
32+
echo "Adding google manager tag to head"
33+
echo "================================="
34+
35+
HEAD_GTM=$(cat ../../fauna-csharp-repository/concourse/scripts/head_gtm.dat)
36+
sed -i.bak "0,/<\/title>/{s/<\/title>/<\/title>${HEAD_GTM}/}" ./index.html
37+
38+
echo "================================="
39+
echo "Adding google manager tag to body"
40+
echo "================================="
41+
42+
BODY_GTM=$(cat ../../fauna-csharp-repository/concourse/scripts/body_gtm.dat)
43+
sed -i.bak "0,/<body>/{s/<body>/<body>${BODY_GTM}/}" ./index.html
44+
45+
rm ./index.html.bak
46+
47+
git config --global user.email "[email protected]"
48+
git config --global user.name "Fauna, Inc"
49+
50+
git add -A
51+
git commit -m "Update docs to version: $PACKAGE_VERSION"

concourse/tasks/publish-docs.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
inputs:
10+
- name: fauna-csharp-repository
11+
- name: fauna-csharp-repository-docs
12+
13+
outputs:
14+
- name: fauna-csharp-repository-updated-docs
15+
16+
run:
17+
path: ./fauna-csharp-repository/concourse/scripts/publish_docs.sh

0 commit comments

Comments
 (0)