Skip to content

Commit f2df346

Browse files
committed
Update Jazzy Doc Generation Script
Motivation: Up until now, Jazzy docs were generated on a private CI runner hosting macOS - which doesn't make CI portable as it requires that runner to always be available. Modifications: - Change: CI config to use a Linux Jazzy Docker image for portability - Change: Doc theme templates to not reference GitHub Result: Jazzy docs should be able to be generated at any time, as the CI infrastructure is using GitLab's cloud solution with a Docker image
1 parent fd73e0a commit f2df346

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.gitlab-ci.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@ pages:
77
stage: Docs
88
only:
99
- tags
10+
image: norionomura/jazzy
1011
tags:
11-
- private-macOS
12+
- docker
13+
variables:
14+
MODULE_NAME: "RediStack"
15+
REPO_URL: "https://gitlab.com/mordil/swift-redi-stack"
1216
script: |
13-
version=$(git describe --abbrev=0 --tags || echo "0.0.0")
17+
export VERSION=$(git describe --abbrev=0 --tags || echo "0.0.0")
1418
swift build
15-
sourcekitten doc --spm-module "RedisNIO" > ./RedisNIO.json
16-
swift package generate-xcodeproj
19+
sourcekitten doc --spm-module "$MODULE_NAME" > "./$MODULE_NAME.json"
1720
jazzy --clean \
1821
--author "Nathan Harris (Mordil)" \
1922
--readme "./README.md" \
20-
--author_url "https://mordil.info" \
21-
--github_url "https://gitlab.com/mordil/swift-redis-nio-client" \
22-
--github-file-prefix https://gitlab.com/mordil/swift-redis-nio-client/blob/$version \
23-
--root-url "https://mordil.gitlab.io/swift-redis-nio-client/docs/RedisNIO" \
24-
--module "RedisNIO" \
25-
--module-version "$version" \
23+
--author_url "https://www.mordil.info" \
24+
--github_url "$REPO_URL" \
25+
--github-file-prefix "$REPO_URL/blob/$VERSION" \
26+
--root-url "https://mordil.gitlab.io/swift-redi-stack/" \
27+
--module "$MODULE_NAME" \
28+
--module-version "$VERSION" \
2629
--theme docs/theme \
27-
--xcodebuild-arguments -scheme,swift-redis-nio-client-Package \
28-
--sourcekitten-sourcefile "./RedisNIO.json" \
30+
--sourcekitten-sourcefile "./$MODULE_NAME.json" \
2931
--output "./public"
3032
artifacts:
3133
paths:

docs/theme/templates/task.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
{{/return}}
9393
{{#github_token_url}}
9494
<div class="slightly-smaller">
95-
<a href="{{{github_token_url}}}">Show on GitHub</a>
95+
<a href="{{{github_token_url}}}">Show on GitLab</a>
9696
</div>
9797
{{/github_token_url}}
9898
</section>

0 commit comments

Comments
 (0)