diff --git a/404.html b/404.html index e6a7a6aac..dc9341440 100644 --- a/404.html +++ b/404.html @@ -585,52 +585,52 @@ Triggers
After downloading the binary, untar or unzip it and your are good to go.
diff --git a/installation/homebrew/index.html b/installation/homebrew/index.html
index 6b1d01862..d9a6702a0 100644
--- a/installation/homebrew/index.html
+++ b/installation/homebrew/index.html
@@ -586,52 +586,52 @@
Triggers
Use create/replace/delete commands to manage your pipeline
+# create pipeline
+codefresh create -f pipeline.yaml
+
+# get created/modified pipeline spec
+codefresh get pipeline <name> -o yaml > pipeline.yaml
+
+# update pipeline with modified pipeline spec
+codefresh replace -f pipeline.yaml
+
+# delete pipeline using spec file
+codefresh delete -f pipeline.yaml
See the examples of pipeline spec below to manage your pipelines.
+ +version: '1.0'
+kind: pipeline
+metadata:
+ name: cron
+spec:
+ cronTriggers:
+ - name: every minute
+ type: cron
+ message: every minute
+ expression: 0/1 * 1/1 * *
+ steps:
+ test:
+ image: alpine
+ commands:
+ - echo test
version: '1.0'
+kind: pipeline
+metadata:
+ name: cron
+spec:
+ cronTriggers:
+ - name: every minute
+ type: cron
+ message: every minute
+ expression: 0/1 * 1/1 * *
+ variables:
+ - key: TEST_VAR
+ value: 'my-test'
+ steps:
+ test:
+ image: alpine
+ commands:
+ - echo ${{TEST_VARIABLE}}
version: '1.0'
+kind: pipeline
+metadata:
+ name: cron
+spec:
+ cronTriggers:
+ - name: every minute
+ type: cron
+ message: every minute
+ expression: 0/1 * 1/1 * *
+ options:
+ resetVolume: true
+ steps:
+ test:
+ image: alpine
+ commands:
+ - echo test >> test.txt
+ - cat test.txt
Note that spec.triggers.0.id
and spec.cronTriggers.gitTriggerId
+should be the same value and a valid ObjectId.
version: '1.0'
kind: pipeline
metadata:
- name: codefresh-io/cli/default-pipeline
- labels:
- tags: []
- deprecate:
- applicationPort: '8080'
- repoPipeline: true
+ name: cron
spec:
triggers:
- type: git
- repo: codefresh-io/cli
+ name: test
+ repo: repo-owner/repo-name
events:
- push.heads
pullRequestAllowForkEvents: false
commentRegex: /.*/gi
branchRegex: /.*/gi
branchRegexInput: regex
- provider: github
- contexts: []
- variables:
- - key: PORT
- value: '3000'
- - key: SECRET
- value: 'secret-value'
- encrypted: true
+ provider: git-context-name
+ id: 65329431edb87250ff128acc
+
+ cronTriggers:
+ - name: every minute
+ type: cron
+ message: every minute
+ expression: 0/1 * 1/1 * *
+ gitTriggerId: 65329431edb87250ff128acc
+ branch: master
+
steps:
- test_step_1:
+ test:
image: alpine
- working_directory: '${{clone_step}}'
commands:
- - echo ls
- - echo "hello world"
- - echo "plain value $PORT"
- - echo "encrypted value $PAPA"
- - echo "value from context $COOKIE"
- build:
- type: build
- working_directory: '${{clone_step}}'
- dockerfile: ./Dockerfile
- image_name: my-custom-docker-image
- tag: foo
- stages: []
version: '1.0'
kind: pipeline
metadata:
- name: codefresh-io/cli/basic-pipeline
- labels:
- tags: []
- deprecate:
- applicationPort: '8080'
- repoPipeline: true
+ name: cron
+spec:
+ cronTriggers:
+ - name: every minute
+ type: cron
+ message: every minute
+ expression: 0/1 * 1/1 * *
+ disabled: true
+ steps:
+ test:
+ image: alpine
+ commands:
+ - echo test
version: '1.0'
+kind: pipeline
+metadata:
+ name: basic-pipeline
spec:
triggers:
- type: git
- repo: codefresh-io/cli
+ name: test
+ repo: repo-owner/repo-name
events:
- push.heads
pullRequestAllowForkEvents: false
commentRegex: /.*/gi
branchRegex: /.*/gi
branchRegexInput: regex
- provider: github
- contexts: []
+ provider: git-context-name
variables:
- key: PORT
value: '3000'
@@ -1808,30 +1882,24 @@ Basic Pipeline with explicit cl
working_directory: '${{clone_step}}'
dockerfile: ./Dockerfile
image_name: my-custom-docker-image
- tag: bla
- stages: []
version: '1.0'
kind: pipeline
metadata:
- name: codefresh-io/cli/from-repo
- isPublic: false
- labels:
- tags: []
- deprecate:
- applicationPort: '8080'
- repoPipeline: true
+ name: basic-pipeline
spec:
triggers:
- type: git
- repo: codefresh-io/cli
+ name: test
+ repo: repo-owner/repo-name
events:
- push.heads
pullRequestAllowForkEvents: false
commentRegex: /.*/gi
branchRegex: /.*/gi
branchRegexInput: regex
- provider: github
+ provider: git-context-name
contexts: []
variables:
- key: PORT
@@ -1844,32 +1912,24 @@ Pipe
context: git-context-name # if not specified will use the default git-context
repo: codefresh-io/cli
path: codefresh.yml
- revision: master # can be a branch or commit. if not specified will use CF_BRANCH variable value
- steps: {}
- stages: []
version: '1.0'
kind: pipeline
metadata:
- name: codefresh-io/cli/from-external
- isPublic: false
- labels:
- tags: []
- deprecate:
- applicationPort: '8080'
- repoPipeline: true
- project: codefresh-io/cli
+ name: basic-pipeline
spec:
triggers:
- type: git
- repo: codefresh-io/cli
+ name: test
+ repo: repo-owner/repo-name
events:
- push.heads
pullRequestAllowForkEvents: false
commentRegex: /.*/gi
branchRegex: /.*/gi
branchRegexInput: regex
- provider: github
+ provider: git-context-name
contexts: []
variables:
- key: PORT
@@ -1879,9 +1939,7 @@ Pipeline wit
encrypted: true
specTemplate:
location: url
- url: 'https://raw.githubusercontent.com/codefresh-io/cli/master/codefresh.yml'
- steps: {}
- stages: []
[Deprecated] Create trigger: link pipeline to trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh create trigger [event-uri] [pipeline]
codefresh create t [event-uri] [pipeline]
Option | +Alias | +Default | +Description | +
---|---|---|---|
event-uri | ++ | + | trigger-event URI |
+
pipeline | ++ | + | pipeline to be triggered by the trigger-event |
+
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
--filter | ++ | array | ++ | trigger filter name=condition pairs |
+
codefresh/fortune
push
eventcodefresh create trigger registry:dockerhub:codefresh:fortune:push 5a439664af73ad0001f3ece0
[Deprecated] Create new trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh create trigger-event
codefresh create te trigger-event
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
--type | ++ | + | + | trigger-event type. required |
+
--kind | ++ | + | + | trigger-event kind. required |
+
--public | ++ | boolean | +false | +wether trigger-event is public (system-wide): can be linked to any pipeline in any account | +
--secret | ++ | string | +!generate | +trigger-event secret (omit to auto-generate). required |
+
--value | +-v | +array | ++ | trigger-event specific values pairs (key=value), as required by trigger-type | +
--context | ++ | + | + | context with credentials required to setup event on remote system | +
codefresh create trigger-event --type registry --kind dockerhub --value namespace=codefresh --value name=fortune --value action=push
codefresh create trigger-event --type cron --kind codefresh --value expression="0 0 */1 * * *" --value message=hello
codefresh create trigger-event --type cron --kind codefresh --value expression="@daily" --value message=hello-all
Delete trigger: unlink pipeline from trigger-event
.
codefresh delete trigger [event-uri] [pipeline]
codefresh delete t [event-uri] [pipeline]
Option | +Alias | +Default | +Description | +
---|---|---|---|
event-uri | ++ | + | trigger-event URI (as defined by trigger type[/kind] ). required |
+
pipeline | ++ | + | pipeline ID. required |
+
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
codefresh/fortune
push
eventcodefresh delete trigger registry:dockerhub:codefresh:fortune:push 5a439664af73ad0001f3ece0
[Deprecated] Delete trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh delete trigger-event [event-uri]
codefresh delete te [event-uri]
Option | +Alias | +Default | +Description | +
---|---|---|---|
event-uri | ++ | + | trigger-event URI | +
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
--context | ++ | + | + | context with credentials required to setup event on remote system | +
codefresh delete trigger-event --context dockerhub registry:dockerhub:codefresh:fortune:push
[Deprecated] Get trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh get trigger-events [event-uri]
codefresh get trigger-event [event-uri]
codefresh get te [event-uri]
Option | +Alias | +Default | +Description | +
---|---|---|---|
event-uri | ++ | + | trigger-event URI) | +
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
--type | ++ | + | + | trigger-event type | +
--kind | ++ | + | + | trigger-event kind | +
--filter | ++ | + | + | trigger-event URI filter (regex) | +
--public | ++ | boolean | +true | +get public trigger-event(s) | +
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--select-columns | +--sc | ++ | + | Columns to select for table output | +
--output | +-o | ++ | + | Output format Possible values: - json - yaml - wide - name - id |
+
--date-format | +--df | ++ | + | Provide predefined or custom date format. Predefined options: [“default”, “date”, “datetime”, “date-diff”] | +
--pretty | ++ | + | + | Use colors and signs for output | +
--watch | +-w | +boolean | +false | +Watching updates to a particular resource | +
--watch-interval | ++ | number | +3 | +Interval time at watching mode (in seconds) | +
trigger-event
codefresh get trigger-event registry:dockerhub:codefresh:fortune:push
trigger-events
codefresh get trigger-event --type registry --kind dockerhub --filter *codefresh
[Deprecated] Get a list of available trigger-types. Deprecated - please use pipeline spec to manager cron trigger.
+ +codefresh get trigger-types
codefresh get trigger-type trigger-types
codefresh get tt trigger-types
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
--type | ++ | + | + | filter by a specific trigger type (e.g. registry , cron ) |
+
--kind | ++ | + | + | filter by a specific trigger kind (e.g. dockerhub , cfcr , gcr , acr ); only some trigger-types may have kinds |
+
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--select-columns | +--sc | ++ | + | Columns to select for table output | +
--output | +-o | ++ | + | Output format Possible values: - json - yaml - wide - name - id |
+
--date-format | +--df | ++ | + | Provide predefined or custom date format. Predefined options: [“default”, “date”, “datetime”, “date-diff”] | +
--pretty | ++ | + | + | Use colors and signs for output | +
--watch | +-w | +boolean | +false | +Watching updates to a particular resource | +
--watch-interval | ++ | number | +3 | +Interval time at watching mode (in seconds) | +
codefresh get trigger-types --type registry
[Deprecated] Get triggers, optionally filtered by pipeline or event. Deprecated - please use pipeline spec to manager cron triggers.
+ +Only cron/registry triggers are supported (for git triggers use codefresh get pip <pip-name> -o json
).
codefresh get triggers
codefresh get trigger triggers
codefresh get t triggers
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--help | ++ | + | + | Print help information | +
--pipeline | +-p | ++ | + | pipeline id | +
--event-uri | +-e | ++ | + | event URI | +
Option | +Alias | +Type | +Default | +Description | +
---|---|---|---|---|
--select-columns | +--sc | ++ | + | Columns to select for table output | +
--output | +-o | ++ | + | Output format Possible values: - json - yaml - wide - name - id |
+
--date-format | +--df | ++ | + | Provide predefined or custom date format. Predefined options: [“default”, “date”, “datetime”, “date-diff”] | +
--pretty | ++ | + | + | Use colors and signs for output | +
--watch | +-w | +boolean | +false | +Watching updates to a particular resource | +
--watch-interval | ++ | number | +3 | +Interval time at watching mode (in seconds) | +
codefresh create trigger [event-uri] [pipeline]
Create trigger: link pipeline to trigger-event
.
[Deprecated] Create trigger: link pipeline to trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh get triggers
Get triggers, optionally filtered by pipeline or event.
+[Deprecated] Get triggers, optionally filtered by pipeline or event. Deprecated - please use pipeline spec to manager cron triggers.
Only cron/registry triggers are supported (for git triggers use codefresh get pip <pip-name> -o json
).
codefresh get trigger-events [event-uri]
Get trigger-event
.
[Deprecated] Get trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh get trigger-types
Get a list of available trigger-types.
+[Deprecated] Get a list of available trigger-types. Deprecated - please use pipeline spec to manager cron trigger.
-codefresh delete trigger [event-uri] [pipeline]
Delete trigger: unlink pipeline from trigger-event
.
codefresh create trigger-event
Create new trigger-event
.
[Deprecated] Create new trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.
codefresh delete trigger-event [event-uri]
Delete trigger-event
.
[Deprecated] Delete trigger-event
. Deprecated - please use pipeline spec to manager cron trigger.