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
7f9cf59f
Commit
7f9cf59f
authored
Sep 24, 2019
by
Hordur Freyr Yngvason
Committed by
Peter Leitzen
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove outdated services:doc rake task
Resolves
https://gitlab.com/gitlab-org/gitlab-ee/issues/30908
parent
9b093011
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
104 deletions
+0
-104
doc/development/rake_tasks.md
doc/development/rake_tasks.md
+0
-6
lib/tasks/services.rake
lib/tasks/services.rake
+0
-98
No files found.
doc/development/rake_tasks.md
View file @
7f9cf59f
...
@@ -143,12 +143,6 @@ This will compile and minify all JavaScript and CSS assets and copy them along
...
@@ -143,12 +143,6 @@ This will compile and minify all JavaScript and CSS assets and copy them along
with all other frontend assets (images, fonts, etc) into
`/public/assets`
where
with all other frontend assets (images, fonts, etc) into
`/public/assets`
where
they can be easily inspected.
they can be easily inspected.
## Generate API documentation for project services (e.g. Slack)
```
bundle exec rake services:doc
```
## Updating Emoji Aliases
## Updating Emoji Aliases
To update the Emoji aliases file (used for Emoji autocomplete) you must run the
To update the Emoji aliases file (used for Emoji autocomplete) you must run the
...
...
lib/tasks/services.rake
deleted
100644 → 0
View file @
9b093011
services_template
=
<<-
ERB
# Services
<% services.each do |service| %>
## <%= service[:title] %>
<% unless service[:description].blank? %>
<%= service[:description] %>
<% end %>
### Create/Edit <%= service[:title] %> service
Set <%= service[:title] %> service for a project.
<% unless service[:help].blank? %>
> <%= service[:help].gsub("
\n
", ' ') %>
<% end %>
```
PUT /projects/:id/services/<%= service[:dashed_name] %>
```
Parameters:
<% service[:params].each do |param| %>
- `<%= param[:name] %>` <%= param[:required] ? "(**required**)" : "(optional)" %><%= [" -", param[:description]].join(" ").gsub("
\n
", '') unless param[:description].blank? %>
<% end %>
### Delete <%= service[:title] %> service
Delete <%= service[:title] %> service for a project.
```
DELETE /projects/:id/services/<%= service[:dashed_name] %>
```
### Get <%= service[:title] %> service settings
Get <%= service[:title] %> service settings for a project.
```
GET /projects/:id/services/<%= service[:dashed_name] %>
```
<% end %>
ERB
namespace
:services
do
task
doc: :environment
do
services
=
Service
.
available_services_names
.
map
do
|
s
|
service_start
=
Time
.
now
klass
=
"
#{
s
}
_service"
.
classify
.
constantize
service
=
klass
.
new
service_hash
=
{}
service_hash
[
:title
]
=
service
.
title
service_hash
[
:dashed_name
]
=
s
.
dasherize
service_hash
[
:description
]
=
service
.
description
service_hash
[
:help
]
=
service
.
help
service_hash
[
:params
]
=
service
.
fields
.
map
do
|
p
|
param_hash
=
{}
param_hash
[
:name
]
=
p
[
:name
]
param_hash
[
:description
]
=
p
[
:placeholder
]
||
p
[
:title
]
param_hash
[
:required
]
=
klass
.
validators_on
(
p
[
:name
].
to_sym
).
any?
do
|
v
|
v
.
class
==
ActiveRecord
::
Validations
::
PresenceValidator
end
param_hash
end
service_hash
[
:params
].
sort_by!
{
|
p
|
p
[
:required
]
?
0
:
1
}
puts
"Collected data for:
#{
service
.
title
}
,
#{
Time
.
now
-
service_start
}
"
service_hash
end
doc_start
=
Time
.
now
doc_path
=
File
.
join
(
Rails
.
root
,
'doc'
,
'api'
,
'services.md'
)
result
=
ERB
.
new
(
services_template
,
trim_mode:
'>'
)
.
result
(
OpenStruct
.
new
(
services:
services
).
instance_eval
{
binding
})
File
.
open
(
doc_path
,
'w'
)
do
|
f
|
f
.
write
result
end
puts
"write a new service.md to:
#{
doc_path
}
,
#{
Time
.
now
-
doc_start
}
"
end
end
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