Skip to content

Commit 93ddde8

Browse files
mmulhollaMartin Mulholland
andauthored
Add support for multiple version of the docs (#36)
Co-authored-by: Martin Mulholland <[email protected]>
1 parent 4ff0e74 commit 93ddde8

File tree

5 files changed

+107
-10
lines changed

5 files changed

+107
-10
lines changed

README.md

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Devfile 2.0 website and documentation.
22

3-
The generated JSON Schema documentation for the Devfile 2.0 is available here: https://devfile.github.io/.
3+
The generated JSON Schema documentation for the Devfile 2.x is available here: https://devfile.github.io/.
44

5-
[Devfile 2.0 development documentation](https://github.com/devfile/docs/blob/master/docs/end-user-guide/assembly_making-a-workspace-portable-using-a-devfile.adoc)
5+
[Devfile 2.0 documentation](https://github.com/devfile/docs/blob/v2.0.x/docs/modules/user-guide/nav.adoc)
66

7-
[Devfile 1.0 to 2.0 migration documentation](https://github.com/devfile/docs/blob/master/docs/modules/user-guide/pages/migration_guide.adoc)
7+
[Devfile 2.1 development documentation](https://github.com/devfile/docs/blob/master/docs/modules/user-guide/nav.adoc)
88

99
## Contributing
1010

@@ -20,6 +20,100 @@ These commands will generate the html documentation in folder `build/site`. Open
2020
Additionally, when pushing to a branch or working on a PR, the site is built by a GH action and
2121
made available in a ZIP file as a GH action build artifact, and can be tested locally.
2222

23+
* Updates to the documentation for the Devfile version under development should be merged into the master branch.
24+
* Updates to the documentation for previously released Devfile versions should be merged into the braach for the release version, for example v2.0.x.
25+
2326
# Issue tracking repo
2427

2528
https://github.com/devfile/api with label area/documentation
29+
30+
# Release process
31+
32+
Each release a new git release, tag and branch will be created. The tag marks the initial release documentation
33+
and the branch is used for any post release updates. Next release work then continues on the master branch.
34+
To enable this the following release process must be followed:
35+
36+
## Changes for the new release branch
37+
38+
Set the new branch to be specific to the release version. For example, if the release version is 2.0.0:
39+
40+
1. Prior to this process the api repo is updated to copy a final version of the schema to a directory for that version. For example:
41+
`docs/modules/user-guide/attachments/jsonschemas/2.0.0/devfile.json
42+
1. Create the new branch for the tag:
43+
```git fetch --all```
44+
```git checkout -b v2.0.x v2.0.0```
45+
1. Modify `docs/antora.yaml`:
46+
1. Set the correct title and version.
47+
1. Remove the pre-release attribute.
48+
1. Set `.asciidoc .attributes .prod-ver` for the release
49+
1. For example if release is 2.0.0
50+
```
51+
name: devfile
52+
nav:
53+
- modules/user-guide/nav.adoc
54+
start_page: user-guide:index.adoc
55+
title: Devfile User Guide v2.0.0
56+
version: '2.0.0'
57+
asciidoc:
58+
attributes:
59+
prod-ver: 2.0
60+
```
61+
1. Modify .gitignore to not ignore the doc generated from the schema for the release:
62+
```
63+
docs/modules/user-guide/attachments/api-reference/next
64+
docs/modules/user-guide/attachments/api-reference/stable
65+
docs/modules/user-guide/examples/api-reference/next
66+
docs/modules/user-guide/examples/api-reference/stable
67+
```
68+
1. Modify ```docs/modules/user-guide/partials/ref_api-reference.adoc``` to pull the iframe and link from the newly generated directories.
69+
```
70+
[id="ref_api-reference_{context}"]
71+
= API Reference
72+
73+
This section describes the devfile API.
74+
75+
++++
76+
<iframe src="./_attachments/api-reference/2.0.0/index.html" style="border:none;width: 100%;min-height:50em;height:-webkit-fill-available;"></iframe>
77+
++++
78+
79+
.Additional resources
80+
81+
* link:{attachmentsdir}/jsonschemas/2.0.0/devfile.json[Download the current JSON Schema]```
82+
```
83+
1. Build the docs and verify all looks good.
84+
1. Add the changes, commit the branch and push directly to the docs repo. (There is no merge required for this branch).
85+
86+
## Changes to the master branch
87+
88+
Now the master branch can be updated for the next release and to link the previous release docs
89+
from the newly created ```v.2.0.x``` branch.
90+
91+
1. Modify 'docs/antora.yaml' to set the correct title,version,pre-release and prod-ver. For example:
92+
```
93+
asciidoc:
94+
attributes:
95+
prod-ver: 2.1
96+
name: devfile
97+
nav:
98+
- modules/user-guide/nav.adoc
99+
start_page: user-guide:index.adoc
100+
title: Devfile User Guide 2.1.0
101+
version: '2.1.0'
102+
prerelease: -alpha
103+
```
104+
1. Modify `antora-playbook.yaml` to add content for the new release created:
105+
```
106+
content:
107+
sources:
108+
- branches: HEAD
109+
start_path: docs
110+
url: ./
111+
- branches: v2.0.x
112+
start_path: docs
113+
url: ./
114+
```
115+
1. Build, test, commit and merge the changes
116+
117+
118+
119+

antora-playbook.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ asciidoc:
1212
content:
1313
sources:
1414
- branches: HEAD
15-
edit_url: 'https://github.com/devfile/docs/edit/master/{path}'
15+
start_path: docs
16+
url: ./
17+
- branches: v2.0.x
1618
start_path: docs
1719
url: ./
1820
output:

docs/antora.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
asciidoc:
33
attributes:
4-
prod-ver: 2.0
4+
prod-ver: 2.1
55
name: devfile
66
nav:
77
- modules/user-guide/nav.adoc
88
start_page: user-guide:index.adoc
9-
title: Devfile User Guide 2.0.0
10-
version: '2.0.0'
9+
title: Devfile User Guide 2.1.0
10+
version: '2.1.0'
11+
prerelease: -alpha

docs/modules/user-guide/partials/ref_api-reference.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
This section describes the devfile API.
55

66
++++
7-
<iframe src="./_attachments/api-reference/2.0.0/index.html" style="border:none;width: 100%;min-height:50em;height:-webkit-fill-available;"></iframe>
7+
<iframe src="./_attachments/api-reference/next/index.html" style="border:none;width: 100%;min-height:50em;height:-webkit-fill-available;"></iframe>
88
++++
99

1010
.Additional resources
1111

12-
* link:{attachmentsdir}/jsonschemas/2.0.0/devfile.json[Download the current JSON Schema]
12+
* link:{attachmentsdir}/jsonschemas/next/devfile.json[Download the current JSON Schema]

generate-api-reference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
const { Bootprint } = require('bootprint/index')
44
const bootprintJsonSchema = require('bootprint-json-schema')
55
const bootprintConfig = require('./reference-generator/config.js')
6-
const glob = require('glob-fs')();
76
const fs = require('fs');
87

98
fs.readdir('./docs/modules/user-guide/attachments/jsonschemas/', (err, files) => {
109
if (err) throw err;
1110
files.forEach((version) => {
11+
var glob = require('glob-fs')();
1212
var schemas = glob.readdirSync('./docs/modules/user-guide/attachments/jsonschemas/' + version + '/devfile*.json');
1313
if (! schemas.empty) {
1414
var schemaPath = schemas[0]

0 commit comments

Comments
 (0)