Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-12 18:26:39 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-12 18:26:39 +0300
commitc119a737935f1e1e8ae7dec814be8accb8980e1d (patch)
tree739f4f05f791518f7c723cd1c68400ceba56ae9d /lib/api/tags.rb
parentd343d9d8c2f3db0ca5f6fab8ad19e0f79f66e138 (diff)
Add releases api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/tags.rb')
-rw-r--r--lib/api/tags.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index da962bd402a..06fa1d23fd6 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -1,5 +1,5 @@
module API
- # Releases API
+ # Git Tags API
class Tags < Grape::API
before { authenticate! }
before { authorize! :download_code, user_project }
@@ -39,6 +39,23 @@ module API
render_api_error!(result[:message], 400)
end
end
+
+ # Add release notes to tag
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # tag (required) - The name of the tag
+ # description (required) - Release notes with markdown support
+ # Example Request:
+ # PUT /projects/:id/repository/tags
+ put ':id/repository/:tag/release', requirements: { tag: /.*/ } do
+ authorize_push_project
+ required_attributes! [:description]
+ release = user_project.releases.find_or_initialize_by(tag: params[:tag])
+ release.update_attributes(description: params[:description])
+
+ present release, with: Entities::Release
+ end
end
end
end