Skip to content

Commit

Permalink
Set triggers via the CLI
Browse files Browse the repository at this point in the history
`oc set triggers` will display, remove, update, or alter triggers on
deployment configs and build configs.
  • Loading branch information
smarterclayton committed Feb 25, 2016
1 parent 04cc91b commit 304a2b2
Show file tree
Hide file tree
Showing 7 changed files with 1,038 additions and 4 deletions.
69 changes: 69 additions & 0 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -1412,13 +1412,82 @@ _oc_set_probe()
must_have_one_noun=()
}

_oc_set_triggers()
{
last_command="oc_set_triggers"
commands=()

flags=()
two_word_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--all")
flags+=("--auto")
flags+=("--containers=")
two_word_flags+=("-c")
flags+=("--filename=")
flags_with_completion+=("--filename")
flags_completion+=("__handle_filename_extension_flag yaml|yml|json")
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag yaml|yml|json")
flags+=("--from-config")
flags+=("--from-github")
flags+=("--from-image=")
flags+=("--from-webhook")
flags+=("--manual")
flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--output-version=")
flags+=("--remove")
flags+=("--remove-all")
flags+=("--selector=")
two_word_flags+=("-l")
flags+=("--show-all")
flags+=("-a")
flags+=("--show-labels")
flags+=("--sort-by=")
flags+=("--template=")
two_word_flags+=("-t")
flags+=("--api-version=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
flags_completion+=("_filedir")
flags+=("--client-certificate=")
flags_with_completion+=("--client-certificate")
flags_completion+=("_filedir")
flags+=("--client-key=")
flags_with_completion+=("--client-key")
flags_completion+=("_filedir")
flags+=("--cluster=")
flags+=("--config=")
flags_with_completion+=("--config")
flags_completion+=("_filedir")
flags+=("--context=")
flags+=("--google-json-key=")
flags+=("--insecure-skip-tls-verify")
flags+=("--log-flush-frequency=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_noun=()
}

_oc_set()
{
last_command="oc_set"
commands=()
commands+=("env")
commands+=("volumes")
commands+=("probe")
commands+=("triggers")

flags=()
two_word_flags=()
Expand Down
69 changes: 69 additions & 0 deletions contrib/completions/bash/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -4749,13 +4749,82 @@ _openshift_cli_set_probe()
must_have_one_noun=()
}

_openshift_cli_set_triggers()
{
last_command="openshift_cli_set_triggers"
commands=()

flags=()
two_word_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--all")
flags+=("--auto")
flags+=("--containers=")
two_word_flags+=("-c")
flags+=("--filename=")
flags_with_completion+=("--filename")
flags_completion+=("__handle_filename_extension_flag yaml|yml|json")
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag yaml|yml|json")
flags+=("--from-config")
flags+=("--from-github")
flags+=("--from-image=")
flags+=("--from-webhook")
flags+=("--manual")
flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--output-version=")
flags+=("--remove")
flags+=("--remove-all")
flags+=("--selector=")
two_word_flags+=("-l")
flags+=("--show-all")
flags+=("-a")
flags+=("--show-labels")
flags+=("--sort-by=")
flags+=("--template=")
two_word_flags+=("-t")
flags+=("--api-version=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
flags_completion+=("_filedir")
flags+=("--client-certificate=")
flags_with_completion+=("--client-certificate")
flags_completion+=("_filedir")
flags+=("--client-key=")
flags_with_completion+=("--client-key")
flags_completion+=("_filedir")
flags+=("--cluster=")
flags+=("--config=")
flags_with_completion+=("--config")
flags_completion+=("_filedir")
flags+=("--context=")
flags+=("--google-json-key=")
flags+=("--insecure-skip-tls-verify")
flags+=("--log-flush-frequency=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_noun=()
}

_openshift_cli_set()
{
last_command="openshift_cli_set"
commands=()
commands+=("env")
commands+=("volumes")
commands+=("probe")
commands+=("triggers")

flags=()
two_word_flags=()
Expand Down
32 changes: 32 additions & 0 deletions docs/generated/oc_by_example_content.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,38 @@ Update a probe on a pod template
====


== oc set triggers
Update the triggers on a build or deployment config

====
[options="nowrap"]
----
# Print the triggers on the registry
$ oc set triggers dc/registry
# Set all triggers to manual
$ oc set triggers dc/registry --manual
# Enable all automatic triggers
$ oc set triggers dc/registry --auto
# Reset the GitHub webhook on a build to a new, generated secret
$ oc set triggers bc/webapp --from-github=
$ oc set triggers bc/webapp --from-webhook=
# Remove all triggers
$ oc set triggers bc/webapp --remove-all
# Stop triggering on config change
$ oc set triggers dc/registry --from-config --remove
# Add an image trigger to a build config
$ oc set triggers bc/webapp --from-image=namespace1/image:latest
----
====


== oc set volumes
Update volumes on a pod template

Expand Down
6 changes: 6 additions & 0 deletions pkg/cmd/cli/cmd/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func NewCmdSet(fullName string, f *clientcmd.Factory, in io.Reader, out, errout
NewCmdProbe(name, f, out, errout),
},
},
{
Message: "Manage application flows:",
Commands: []*cobra.Command{
NewCmdTriggers(name, f, out, errout),
},
},
}
groups.Add(set)
templates.ActsAsRootCommand(set, []string{"options"}, groups...)
Expand Down
Loading

0 comments on commit 304a2b2

Please sign in to comment.