Skip to content

Commit af571ed

Browse files
Itai GendlerItai Gendler
authored andcommitted
Update top level of resource documentation
1 parent eb954ba commit af571ed

File tree

61 files changed

+4468
-4761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4468
-4761
lines changed

auto-docs/index.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ const recursive = require('recursive-readdir');
33
const path = require('path');
44
const _ = require('lodash');
55

6-
76
recursive(path.resolve(__dirname, '../lib/interface/cli/commands'), (err, files) => {
87

8+
const baseDir = path.resolve(__dirname, '../docs-template/content');
9+
const categories = {};
10+
911
_.forEach(files, (file) => {
1012
if (!file.endsWith('.cmd.js')) {
1113
return;
@@ -27,16 +29,24 @@ recursive(path.resolve(__dirname, '../lib/interface/cli/commands'), (err, files)
2729
const { category } = docs;
2830

2931
// create a directory according to the category
30-
const dir = path.resolve(__dirname, `../docs-template/content/${(category || 'undefined').toLowerCase()}`);
31-
if (!fs.existsSync(dir)){
32+
const dir = path.resolve(baseDir, `${(category || 'undefined').toLowerCase()}`);
33+
if (!fs.existsSync(dir)) {
3234
fs.mkdirSync(dir);
3335
}
3436

35-
// create _index.md file if does not exist for the category
36-
const indexFile = path.resolve(dir, '_index.md');
37-
if (!fs.existsSync(indexFile)){
38-
fs.writeFileSync(indexFile, `+++\ntitle = "${category}"\n+++`);
39-
}
37+
let finalCategoryFileString = categories[category] || `+++\ntitle = "${category}"\n+++\n\n`;
38+
const formattedTitle = docs.title.replace(/\s+/g, '-').toLowerCase();
39+
finalCategoryFileString += `### [${docs.title}](${formattedTitle})\n`;
40+
finalCategoryFileString += `\`${docs.command}\`\n\n`;
41+
finalCategoryFileString += `${docs.description}\n\n`;
42+
categories[category] = finalCategoryFileString;
43+
44+
45+
// // create _index.md file if does not exist for the category
46+
// const indexFile = path.resolve(dir, '_index.md');
47+
// if (!fs.existsSync(indexFile)){
48+
// fs.writeFileSync(indexFile, `+++\ntitle = "${category}"\n+++`);
49+
// }
4050

4151
let finalFileString = '';
4252

@@ -55,4 +65,9 @@ recursive(path.resolve(__dirname, '../lib/interface/cli/commands'), (err, files)
5565

5666
fs.writeFileSync(path.resolve(dir, `./${docs.title}.md`), finalFileString);
5767
});
68+
69+
_.forEach(categories, (content, category) => {
70+
const indexFile = path.resolve(baseDir, `./${(category || 'undefined').toLowerCase()}/_index.md`);
71+
fs.writeFileSync(indexFile, content);
72+
});
5873
});
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
+++
22
title = "Authentication"
3-
date = "2017-04-24T18:36:24+02:00"
4-
weight = 30
53
+++
4+
5+
### [Create authentication context](create-authentication-context)
6+
`codefresh create-context [name]`
7+
8+
Create or update an authentication context
9+
10+
### [Get activated context](get-activated-context)
11+
`codefresh current-context`
12+
13+
Get the current activated authentication context
14+
15+
### [Get all contexts](get-all-contexts)
16+
`codefresh get-contexts`
17+
18+
Get all possible authentication contexts
19+
20+
### [Set active context](set-active-context)
21+
`codefresh use-context <name>`
22+
23+
Set the current active authentication context
24+
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
+++
22
title = "Builds"
3-
weight = 70
43
+++
4+
5+
### [Get a single build](get-a-single-build)
6+
`codefresh builds [id]`
7+
8+
Get a specific builds or an array of builds
9+
10+
### [Show logs](show-logs)
11+
`codefresh logs <id>`
12+
13+
Show logs of a build
14+
15+
### [Restart a build](restart-a-build)
16+
`codefresh restart <id>`
17+
18+
Restart a build by its id
19+
20+
### [Terminate a build](terminate-a-build)
21+
`codefresh terminate <id>`
22+
23+
Terminate a build by its id
24+
25+
### [Wait for a build condition](wait-for-a-build-condition)
26+
`codefresh wait <id..>`
27+
28+
Wait until a condition will be met on a build
29+
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
+++
22
title = "Compositions"
3-
weight = 90
43
+++
4+
5+
### [Create a composition](create-a-composition)
6+
`codefresh composition [name]`
7+
8+
Create a composition
9+
10+
### [Delete a composition](delete-a-composition)
11+
`codefresh composition [name]`
12+
13+
Delete a composition
14+
15+
### [Get a single composition](get-a-single-composition)
16+
`codefresh compositions [id|name]`
17+
18+
Get a specific composition or an array of compositions
19+
20+
### [Replace a composition](replace-a-composition)
21+
`codefresh composition`
22+
23+
Replace a composition resource
24+
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
+++
22
title = "Contexts"
3-
weight = 40
43
+++
4+
5+
### [Updated a context](updated-a-context)
6+
`codefresh context`
7+
8+
Apply changes to a context
9+
10+
### [Create a context](create-a-context)
11+
`codefresh context [type] [name]`
12+
13+
Create a context
14+
15+
### [Delete a context](delete-a-context)
16+
`codefresh context [name]`
17+
18+
Delete a context
19+
20+
### [Get a single context](get-a-single-context)
21+
`codefresh contexts [name]`
22+
23+
Get a specific or an array of contexts
24+
25+
### [Replace a context](replace-a-context)
26+
`codefresh context`
27+
28+
Replace a context
29+
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
+++
22
title = "Environments"
3-
weight = 100
43
+++
4+
5+
### [Delete an environment](delete-an-environment)
6+
`codefresh environment <id>`
7+
8+
Delete an environment
9+
10+
### [Get a single composition](get-a-single-composition)
11+
`codefresh environments [id]`
12+
13+
Get a specific or an array of environments
14+
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
+++
22
title = "Images"
3-
weight = 80
43
+++
4+
5+
### [Annotate an image](annotate-an-image)
6+
`codefresh image <id>`
7+
8+
Annotate an image
9+
10+
### [Get a single image](get-a-single-image)
11+
`codefresh images [id]`
12+
13+
Get a specific or an array of images
14+
15+
### [Tag an image](tag-an-image)
16+
`codefresh tag <id> [tags..]`
17+
18+
Add an image tag
19+

docs-template/content/installation/download.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Navigate to <a href="https://github.com/codefresh-io/cli/releases" target="_blan
99
and download the binary that matches your operating system.<br>
1010
We currently support the following OS: <br>
1111
<ul>
12-
<li><a href="https://github.com/codefresh-io/cli/releases/download/v0.6.6/codefresh-v0.6.6-linux-x64.tar.gz" target="_blank">Linux-x64</a></li>
13-
<li><a href="https://github.com/codefresh-io/cli/releases/download/v0.6.6/codefresh-v0.6.6-macos-x64.tar.gz" target="_blank">Macos-x64</a></li>
14-
<li><a href="https://github.com/codefresh-io/cli/releases/download/v0.6.6/codefresh-v0.6.6-win-x64.tar.gz" target="_blank">Windows-x64</a></li>
12+
<li><a href="https://github.com/codefresh-io/cli/releases/download/v0.7.4/codefresh-v0.7.4-linux-x64.tar.gz" target="_blank">Linux-x64</a></li>
13+
<li><a href="https://github.com/codefresh-io/cli/releases/download/v0.7.4/codefresh-v0.7.4-macos-x64.tar.gz" target="_blank">Macos-x64</a></li>
14+
<li><a href="https://github.com/codefresh-io/cli/releases/download/v0.7.4/codefresh-v0.7.4-win-x64.tar.gz" target="_blank">Windows-x64</a></li>
1515
</ul>
1616

1717
After downloading the binary, untar or unzip it and your are good to go.<br>

docs-template/content/pipelines/Execute a pipeline.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ title = "Execute a pipeline"
55
### Command
66
`codefresh run <id>`
77

8-
Run a pipeline and attach the created workflow logs.
9-
Returns an exist code according to the workflow finish status (Success: 0, Error: 1, Terminated: 2).
8+
Run a pipeline and attach the created workflow logs.<br />Returns an exit code according to the workflow finish status (Success: 0, Error: 1, Terminated: 2).
109
### Positionals
1110

1211
Option | Default | Description
@@ -21,6 +20,5 @@ Option | Default | Description
2120
--no-cache | | Ignore cached images
2221
--reset-volume | | Reset pipeline cached volume
2322
--variable | | Set build variables
24-
--scale | 1 | todo
2523
--detach | | Run pipeline and print build ID
2624
--variable-file | | Set build variables from a file
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
+++
22
title = "Pipelines"
3-
weight = 50
43
+++
4+
5+
### [Update a single pipeline](update-a-single-pipeline)
6+
`codefresh pipeline <id>`
7+
8+
Apply changes to a pipeline
9+
10+
### [Get a single pipeline](get-a-single-pipeline)
11+
`codefresh pipelines [id]`
12+
13+
Get a specific or an array of pipelines
14+
15+
### [Execute a pipeline](execute-a-pipeline)
16+
`codefresh run <id>`
17+
18+
Run a pipeline and attach the created workflow logs.<br />Returns an exit code according to the workflow finish status (Success: 0, Error: 1, Terminated: 2).
19+

0 commit comments

Comments
 (0)