Adding new gitlab-ctl
commands
contribute
New gitlab-ctl
commands can be added to two directory : files/gitlab-ctl-commands
and files/gitlab-ctl-commands-ee
. Chef stores gitlab-ctl
commands in /opt/gitlab/embedded/service/omnibus-ctl
.
There are two main functions you will use to add commands (https://github.com/chef/omnibus-ctl):
add_command_under_category(string, string, string, int, ruby_block)
This method will add a new command to your gitlab-ctl
under a category, useful for grouping similar commands together logically in help output.
Input arguments:
- Name of the command.
- Category of the command. It should be string consisting of only characters and “-”. If the category does not exist, it will be added. Default categories are “general” and “service-management” (if the latter is enabled).
- Description. This will be outputted below the command name when the help command is run.
- Arity. Always set to
2
, due to a bug inomnibus-ctl
. - Ruby block. Ruby code to be executed when your command is run (arguments to that command will be passed into the block).
add_command(string, string, int, ruby_block)
This method will add a new command to your gitlab-ctl
without a category. It will be displayed above all categories when the help command is called.
Input arguments are the same as add_command_under_category
except 2 doesn’t exist.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support