Skip to content

Commit fab257b

Browse files
ziv-codefreshitai-codefresh
authored andcommitted
Refactor context creation of different types into specific subcommands (#137)
1 parent fb506ad commit fab257b

File tree

19 files changed

+602
-165
lines changed

19 files changed

+602
-165
lines changed

docs/content/contexts/spec.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

docs/content/contexts/spec/_index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
+++
2+
title = "Spec"
3+
+++
4+
5+
A Context needs `.apiVersion`, `.kind`, and `.metadata` fields.
6+
7+
A Context also needs a `.spec` section.
8+
9+
### Owner
10+
A context can be either attached to a user or to an account.<br>
11+
`.owner` can be either `account` or `user`. <br>
12+
The default is `account`. <br>
13+
14+
### Type
15+
`.spec.type` should be one of the following: <br>
16+
<ul>
17+
<li>[config](/contexts/spec/config) </li>
18+
<li>[secret](/contexts/spec/secret) </li>
19+
<li>[yaml](/contexts/spec/yaml) </li>
20+
<li>[secret-yaml](/contexts/spec/secret-yaml) </li>
21+
<li>[helm-repository](/contexts/spec/helm-repository) </li>
22+
</ul>
23+
24+
### Data
25+
`.spec.data` should be different according to the type of the context
26+
27+
28+

docs/content/contexts/spec/config.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
+++
2+
title = "Config"
3+
description = ""
4+
date = "2017-04-24T18:36:24+02:00"
5+
weight = 10
6+
+++
7+
8+
Config context stores a set of keys and values.
9+
10+
### Type
11+
`.spec.type` should be `config`.
12+
13+
### Data
14+
`.spec.data` should be an array of keys and values.
15+
16+
### Examples
17+
18+
#### config with two keys
19+
```yaml
20+
apiVersion: "v1"
21+
kind: "context"
22+
owner: "account"
23+
metadata:
24+
name: "my-config-context"
25+
spec:
26+
type: "config"
27+
data:
28+
dbUrl: "db-url"
29+
sysUrl: "sys-url"
30+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
+++
2+
title = "Helm Repository"
3+
description = ""
4+
date = "2017-04-24T18:36:24+02:00"
5+
weight = 50
6+
+++
7+
8+
Helm-Repository context stores an integration with a helm repository.
9+
10+
### Type
11+
`.spec.type` should be `helm-repository`.
12+
13+
### Data
14+
`.spec.data` should be an array of keys and values.
15+
16+
### Examples
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
+++
2+
title = "Secret Yaml"
3+
description = ""
4+
date = "2017-04-24T18:36:24+02:00"
5+
weight = 40
6+
+++
7+
8+
Secret-Yaml context stores an yaml file encrypted.
9+
10+
### Type
11+
`.spec.type` should be `secret-yaml`.
12+
13+
### Data
14+
`.spec.data` should be an array of keys and values.
15+
16+
### Examples
17+
18+
#### secret-yaml with two keys
19+
```yaml
20+
apiVersion: "v1"
21+
kind: "context"
22+
owner: "account"
23+
metadata:
24+
name: "my-secret-yaml-context"
25+
spec:
26+
type: "secret-yaml"
27+
data:
28+
serviceType: "LoadBalancer"
29+
image: "mongo"
30+
type:
31+
- "encrypted"
32+
```

docs/content/contexts/spec/secret.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
+++
2+
title = "Secret"
3+
description = ""
4+
date = "2017-04-24T18:36:24+02:00"
5+
weight = 20
6+
+++
7+
8+
Secret context stores a set of keys and values encrypted.
9+
10+
### Type
11+
`.spec.type` should be `secret`.
12+
13+
### Data
14+
`.spec.data` should be an array of keys and values.
15+
16+
### Examples
17+
18+
#### secret with two keys
19+
```yaml
20+
apiVersion: "v1"
21+
kind: "context"
22+
owner: "account"
23+
metadata:
24+
name: "my-secret-context"
25+
spec:
26+
type: "secret"
27+
data:
28+
dbPassword: "secret-db-password"
29+
adminPassword: "secret-admin-password"
30+
```

docs/content/contexts/spec/yaml.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
+++
2+
title = "Yaml"
3+
description = ""
4+
date = "2017-04-24T18:36:24+02:00"
5+
weight = 30
6+
+++
7+
8+
Yaml context stores an yaml file.
9+
10+
### Type
11+
`.spec.type` should be `yaml`.
12+
13+
### Data
14+
`.spec.data` should be an array of keys and values.
15+
16+
### Examples
17+
18+
#### yaml with two keys
19+
```yaml
20+
apiVersion: "v1"
21+
kind: "context"
22+
owner: "account"
23+
metadata:
24+
name: "my-yaml-context"
25+
spec:
26+
type: "yaml"
27+
data:
28+
serviceType: "LoadBalancer"
29+
image: "mongo"
30+
```

docs/content/installation/download.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/content/installation/homebrew.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title = "HOMEBREW"
33
description = "Homebrew install"
44
date = "2018-01-30T12:00:00+02:00"
5-
weight = 20
5+
weight = 60
66
+++
77

88
Install Codefresh CLI on macOS with [Homebrew](https://brew.sh).
@@ -26,4 +26,4 @@ brew upgrade codefresh
2626

2727
```sh
2828
brew uninstall codefresh
29-
```
29+
```

0 commit comments

Comments
 (0)