Skip to content

Commit 428f30d

Browse files
Add documentation information (#119)
1 parent e5e164c commit 428f30d

Some content is hidden

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

65 files changed

+901
-571
lines changed

docs/content/contexts/spec.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
+++
2+
title = "Spec"
3+
description = ""
4+
date = "2017-04-24T18:36:24+02:00"
5+
weight = 0
6+
+++
7+
8+
A Context needs `.apiVersion`, `.kind`, and `.metadata` fields.
9+
10+
A Context also needs a `.spec` section.
11+
12+
### Owner
13+
A context can be either attached to a user or to an account.<br>
14+
`.owner` can be either `account` or `user`. <br>
15+
The default is `account`. <br>
16+
17+
### Type
18+
`.spec.type` should be one of the following: `secret`, `config`, `yaml`, `secret-yaml`, `helm-repository`.
19+
20+
### Data
21+
`.spec.data` should be an array of keys and values.
22+
23+
### Examples
24+
25+
#### Create a Context of type config with two keys
26+
```yaml
27+
apiVersion: "v1"
28+
kind: "context"
29+
owner: "account"
30+
metadata:
31+
name: "my-config-context"
32+
spec:
33+
type: "config"
34+
data:
35+
dbUrl: "db-url"
36+
sysUrl: "sys-url"
37+
```
38+
39+
#### Context of type secret with two keys
40+
```yaml
41+
apiVersion: "v1"
42+
kind: "context"
43+
owner: "account"
44+
metadata:
45+
name: "my-secret-context"
46+
spec:
47+
type: "secret"
48+
data:
49+
dbPassword: "secret-db-password"
50+
adminPassword: "secret-admin-password"
51+
```
52+
53+
#### Context of type yaml with two keys
54+
```yaml
55+
apiVersion: "v1"
56+
kind: "context"
57+
owner: "account"
58+
metadata:
59+
name: "my-yaml-context"
60+
spec:
61+
type: "yaml"
62+
data:
63+
serviceType: "LoadBalancer"
64+
image: "mongo"
65+
```
66+
67+
#### Context of type secret-yaml with two keys
68+
```yaml
69+
apiVersion: "v1"
70+
kind: "context"
71+
owner: "account"
72+
metadata:
73+
name: "my-secret-yaml-context"
74+
spec:
75+
type: "secret-yaml"
76+
data:
77+
serviceType: "LoadBalancer"
78+
image: "mongo"
79+
type:
80+
- "encrypted"
81+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
+++
2+
title = "Operate On Resources"
3+
weight = 30
4+
+++
5+
6+
The CLI supports the ability to work with `spec` files when working with resources.<br>
7+
The supported formats are `yaml` and `json`. <br>
8+
Check each specific resource `spec` for its documentation
9+
10+
{{COMMANDS}}

docs/content/pipelines v2/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
title = "Pipelines V2 (beta)"
3+
weight = 0
4+
+++
5+
6+
7+
{{COMMANDS}}

docs/content/pipelines v2/spec.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
+++
2+
title = "Spec"
3+
weight = 10
4+
+++
5+
6+
A Pipeline needs `.apiVersion`, `.kind`, and `.metadata` fields.
7+
8+
A Pipeline also needs a `.spec` section.
9+
10+
### Examples
11+
12+
#### Pipeline which is stored entirely in Codefresh
13+
```yaml
14+
apiVersion: "v1"
15+
kind: "context"
16+
name: "new-pipeline"
17+
metadata:
18+
labels:
19+
repo: "github:ArikMaor/ping-server"
20+
spec:
21+
triggers:
22+
- type: "scm"
23+
repo: "ArikMaor/ping-server"
24+
events: ["push", "pullrequest"]
25+
branchRegex: '.'
26+
contexts: []
27+
variables:
28+
- key: "PORT"
29+
value: 3000
30+
encrypted: false
31+
- key: "PAPA"
32+
value: "BLA BLA"
33+
encrypted: true
34+
steps:
35+
test_step:
36+
image: "alpine"
37+
commands:
38+
- echo "hello world"
39+
- echo "plain value $PORT"
40+
- echo "encrypted value $PAPA"
41+
- echo "value from context $COOKIE"
42+
```
43+
44+
#### Pipeline which is stored on a remote git
45+
```yaml
46+
apiVersion: "v1"
47+
metadata:
48+
name: "ew-pipeline-git"
49+
labels:
50+
repo: "github:ArikMaor/ping-server"
51+
spec:
52+
triggers:
53+
- type: "scm"
54+
repo: "ArikMaor/ping-server"
55+
events: ["push", "pullrequest"]
56+
branchRegex: '.'
57+
contexts: []
58+
variables:
59+
- key: "PORT"
60+
value: 3000
61+
encrypted: false
62+
- key: "PAPA"
63+
value: "BLA BLA"
64+
encrypted: true
65+
source:
66+
location: "git"
67+
repo: "codefresh-io/cli"
68+
path: "codefresh.yml"
69+
```
70+
71+
#### Pipeline which is stored on a specific url
72+
```yaml
73+
apiVersion: "v1"
74+
metadata:
75+
name: "new-pipeline-url"
76+
labels:
77+
repo: "github:codefresh-io/cli"
78+
spec:
79+
triggers:
80+
- type: "scm"
81+
repo: "ArikMaor/ping-server"
82+
events: ["push", "pullrequest"]
83+
branchRegex: '.'
84+
contexts: []
85+
variables:
86+
- key: "PORT"
87+
value: 3000
88+
encrypted: false
89+
- key: "PAPA"
90+
value: "BLA BLA"
91+
encrypted: true
92+
source:
93+
location: "url"
94+
url: "https://raw.githubusercontent.com/codefresh-io/cli/master/codefresh.yml"
95+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{HEADER}}
2+
3+
{{DESCRIPTION}}
4+
5+
{{COMMANDS}}
6+
7+
{{ARGUMENTS}}
8+
9+
{{OPTIONS}}
10+
11+
### variable-file (var-file)
12+
It is possible to pass build variables using a file. (supported format: json and yaml) <br>
13+
The variables file structure should be an array. <br>
14+
The pipeline will be triggered multiple times according to the array length.
15+
16+
#### Variable json file with 2 sets of variables
17+
```yaml
18+
- key: value
19+
key2: key1
20+
- key: value
21+
key2: key2
22+
```
23+
24+
#### Variable yaml file with 2 sets of variables
25+
```json
26+
[
27+
{
28+
"key": "value",
29+
"key2": "key1"
30+
},
31+
{
32+
"key": "value",
33+
"key2": "key2"
34+
}
35+
]
36+
```
37+
38+
{{EXAMPLES}}

0 commit comments

Comments
 (0)