Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
79a39a5c
Commit
79a39a5c
authored
Aug 05, 2019
by
Ronald van Zon
Committed by
Evan Read
Aug 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add example to plugins file
parent
baaba23f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
doc/administration/plugins.md
doc/administration/plugins.md
+31
-1
No files found.
doc/administration/plugins.md
View file @
79a39a5c
...
@@ -52,7 +52,37 @@ as appropriate. The plugins file list is updated for each event, there is no
...
@@ -52,7 +52,37 @@ as appropriate. The plugins file list is updated for each event, there is no
need to restart GitLab to apply a new plugin.
need to restart GitLab to apply a new plugin.
If a plugin executes with non-zero exit code or GitLab fails to execute it, a
If a plugin executes with non-zero exit code or GitLab fails to execute it, a
message will be logged to
`plugin.log`
.
message will be logged to:
-
`gitlab-rails/plugin.log`
in an Omnibus installation.
-
`log/plugin.log`
in a source installation.
## Creating plugins
Below is an example that will only response on the event
`project_create`
and
will inform the admins from the GitLab instance that a new project has been created.
```
ruby
# By using the embedded ruby version we eliminate the possibility that our chosen language
# would be unavailable from
#!/opt/gitlab/embedded/bin/ruby
require
'json'
require
'mail'
# The incoming variables are in JSON format so we need to parse it first.
ARGS
=
JSON
.
parse
(
STDIN
.
read
)
# We only want to trigger this plugin on the event project_create
return
unless
ARGS
[
'event_name'
]
==
'project_create'
# We will inform our admins of our gitlab instance that a new project is created
Mail
.
deliver
do
from
'info@gitlab_instance.com'
to
'admin@gitlab_instance.com'
subject
"new project "
+
ARGS
[
'name'
]
body
ARGS
[
'owner_name'
]
+
'created project '
+
ARGS
[
'name'
]
end
```
## Validation
## Validation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment