Skip to content

Commit d2f2e9c

Browse files
authored
Merge pull request #57 from sbliven/docker-run
feat: Docker compose.yaml
2 parents c957aa3 + ea6448c commit d2f2e9c

File tree

6 files changed

+62
-57
lines changed

6 files changed

+62
-57
lines changed

Development/Documentation.md

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,30 @@
33
## Overview
44
The documentation consists of three main parts.
55

6-
* The "Home Webgpage" of the project , describing the purpose and use cases for the software. The source is located at https://github.com/SciCatProject/scicatproject.github.io
7-
* The documentation proper, split into User,Operator,Ingestor and Developer manual. The source is located at https://github.com/SciCatProject/documentation . It covers all components of the software, i.e frontend and backend. The documentation tool [honkit](https://honkit.netlify.app/) (successor of gitbook) is used.
8-
* The documentation of the REST API of the backend. This is generated from the swagger.json file, which itself is generated from the model descriptions in loopback
9-
6+
* The "Home Webpage" of the project , describing the purpose and use cases for the software. The source is located at https://github.com/SciCatProject/scicatproject.github.io
7+
* The documentation proper, split into User,Operator,Ingestor and Developer manual. The source is located at https://github.com/SciCatProject/documentation . It covers all components of the software, i.e frontend and backend. The documentation tool [honkit](https://honkit.netlify.app/) (successor of gitbook) is used.
8+
* The documentation of the REST API of the backend. This is generated from the OpenAPI description, which itself is generated from the model descriptions in the backend code.
109

1110
All parts are hosted on the [GitHub Pages platform](https://pages.github.com/). The documentation part is "injected" into the GitHub pages automatically by a travis job, which runs after each commit to the documentation repository
1211

1312
The live web site is then visible on the following URLs respectively
1413
* https://scicatproject.github.io/
1514
* https://scicatproject.github.io/documentation
16-
* https://scicatproject.github.io/api
15+
* The REST API not generated statically but is available from each running SciCat
16+
backend (for example, the public [ESS instance](https://scicat.ess.eu/explorer)).
17+
<!-- TODO update following completion of https://github.com/SciCatProject/documentation/issues/42 -->
1718

1819
## Changes and Deployment of Home Webpage
1920

20-
```
21-
git clone https://github.com/SciCatProject/scicatproject.github.io`
22-
cd scicatproject.github.io
23-
24-
# make your changes on index.html directly, then git add and git commit as usual
25-
26-
git push origin master
27-
```
21+
The homepage is built using [Jekyll](https://jekyllrb.com/) and hosted on GitHub pages.
22+
The source is located in the repository
23+
[SciCatProject/scicatproject.github.io](https://github.com/SciCatProject/scicatproject.github.io).
2824

29-
After pushing the changes they will immediately become visible at the URL https://scicatproject.github.io/
25+
After pushing the changes they will become visible at the URL https://scicatproject.github.io/
3026

3127
## Changes and Deployment of Manuals
3228

33-
```
34-
git clone https://github.com/SciCatProject/documentation.git`
35-
cd documentation
36-
37-
# make your edit/add/commit cycle
38-
39-
npm install honkit --save
40-
npx honkit build
41-
```
42-
43-
### Serving the Documentation locally
44-
45-
`npx honkit serve --port 4040`
46-
47-
### Publishing the documentation
48-
49-
`git push origin master`
50-
51-
The push to the origin repo will trigger a travis job, which will publish the resulting documentation to https://scicatproject.github.io/documentation
52-
53-
## Changes and Deployment of API Documentation
54-
55-
Use the following command to regenerate the API with an up-to-date swagger.json file
56-
57-
```
58-
# to install redoc-cli:
59-
# sudo npm install -g redoc-cli
60-
61-
# to get an updated swagger.json file
62-
# wget https://YOUR-API-SERVER/explorer/swagger.json
63-
64-
redoc-cli bundle -o index.html swagger.json
65-
66-
# the make commit which replaces the index.html file at
67-
# https://github.com/SciCatProject/scicatproject.github.io/tree/master/api
68-
```
69-
29+
Manuals are built using [honkit](https://honkit.netlify.app/) from the
30+
[SciCatProject/documentation](https://github.com/SciCatProject/documentation)
31+
repository. After pushing the changes they will become visible at the URL
32+
https://scicatproject.github.io/documentation.

Development/v3.x/Documentation.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Overview
44
The documentation consists of three main parts.
55

6-
* The "Home Webgpage" of the project , describing the purpose and use cases for the software. The source is located at https://github.com/SciCatProject/scicatproject.github.io
6+
* The "Home Webpage" of the project , describing the purpose and use cases for the software. The source is located at https://github.com/SciCatProject/scicatproject.github.io
77
* The documentation proper, split into User,Operator,Ingestor and Developer manual. The source is located at https://github.com/SciCatProject/documentation . It covers all components of the software, i.e frontend and backend. The documentation tool [honkit](https://honkit.netlify.app/) (successor of gitbook) is used.
88
* The documentation of the REST API of the backend. This is generated from the swagger.json file, which itself is generated from the model descriptions in loopback
99

@@ -63,7 +63,6 @@ Use the following command to regenerate the API with an up-to-date swagger.json
6363
6464
redoc-cli bundle -o index.html swagger.json
6565
66-
# the make commit which replaces the index.html file at
66+
# the make commit which replaces the index.html file at
6767
# https://github.com/SciCatProject/scicatproject.github.io/tree/master/api
6868
```
69-

Development/v4.x/backend/configuration/jobconfig.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ Many actions can be configured using templates, which get filled when the action
135135
Template strings use [Handlebars](https://handlebarsjs.com/) syntax. The following
136136
top-level variables are availabe in the handlebars context:
137137

138+
{% raw %}
138139
| Top-level variable | Type | Examples | Description |
139140
|---|---|---|---|
140141
| `request` | `CreateJobDto` or<br/>`UpdateJobDto` | `{{request.type}}`<br/>`{{request.jobParams}}` | HTTP Request body |
141142
| `job` | `JobClass` | `{{job.id}}` | The job, as stored in the database. Not available for validate actions. |
142143
| `datasets` | `DatasetClass[]` | `{{#each datasets}}{{pid}}{{/each}}` | All datasets referenced in `job.jobParams.datasetsList`. |
143144
| `env` | `object` | `{{env.SECRET_TOKEN}}` | Access environmental variables |
145+
{% endraw %}
144146

145147
Environmental variables are particularly useful for secrets that should not be stored in
146148
the config file.
@@ -545,10 +547,12 @@ an incoming job.
545547

546548
All arguments are optional.
547549

550+
{% raw %}
548551
- `init` (optional): Log message to print during startup. The actions's configuration
549552
section from jobConfig.yaml is available as a Handlebars context. Default: ""
550553
- `validate` (optional): Log message to print when the job request is received. The
551554
request body (aka DTO) is available as a Handlebars context. Default: ""
552555
- `performJob` (optional): Log message to print after the job is saved to the database.
553556
The updated job object is available as a Handlebars context.
554-
Default: `"Performing job for {{ type }}"`
557+
Default: `"Performing job for {{type}}"`
558+
{% endraw %}

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ See the [SciCat Home Webpage](https://scicatproject.github.io) for an overview o
99

1010
## Structure of Documentation
1111

12-
The documentation is split into the following chapters:
12+
SciCat documentation is split into the following chapters:
1313

1414
* [User Guide](Users) - Users of the system can come here to see screen captures, FAQs and find resources on how to better understand SciCat.
1515
* [Operator Guide](Operator) - System admins read this part to set up SciCat for their location
@@ -20,3 +20,29 @@ The documentation is split into the following chapters:
2020

2121
[SciCat Project: Data Catalog System (2017)](https://icatproject.org/wp-content/uploads/2017/12/ICAT_F2F_2017_PSI.pdf)
2222
[SciCat talk from Luke Gorman on Joint ExPaNDS and PaNOSC Meeting Feb 2020](https://indico.esss.lu.se/event/1373/contributions/10773/attachments/9761/15638/Lund2020.pdf)
23+
24+
## Building
25+
26+
Docs are built using [honkit](https://honkit.netlify.app/). This can either be installed locally using npm or run via docker.
27+
28+
### Serving documentation with docker
29+
30+
```
31+
docker compose up -d
32+
```
33+
34+
This should start the honkit server on http://localhost:4040. Honkit will watch for changes in the source files and automatically re-build them.
35+
36+
### Serving the Documentation locally
37+
38+
You can also run the honkit server locally using npm:
39+
40+
```
41+
npm install
42+
npm run start
43+
```
44+
45+
## Publishing the documentation
46+
47+
The [website](https://scicatproject.github.io/documentation) will be automatically
48+
rebuilt after each change to the `master` branch by a github action.

compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services:
2+
serve:
3+
image: honkit/honkit:latest
4+
command: npm run start
5+
ports:
6+
- "4040:4040"
7+
# livereload port. Can't be changed (https://github.com/GitbookIO/plugin-livereload/pull/1)
8+
- "35729:35729"
9+
volumes:
10+
- .:/app
11+
working_dir: /app
12+
platform: linux/amd64

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"start:dev": "honkit serve --port 4500",
7+
"start": "honkit serve --port 4040",
8+
"build": "honkit build",
89
"test": "echo \"Error: no test specified\" && exit 1"
910
},
1011
"keywords": [],

0 commit comments

Comments
 (0)