diff options
author | Sean Edge <asedge@gmail.com> | 2014-05-21 21:46:01 -0400 |
---|---|---|
committer | Sean Edge <asedge@gmail.com> | 2014-05-23 11:02:47 -0400 |
commit | 1e6766f9edb2a9bda18e89acef64ee03e8d3b2e4 (patch) | |
tree | f99b63ca4310cddb7a1c566459fe9a0c8b4e9e7a /lib | |
parent | 3e1853c5a0d89147a6a44a31a302f93e96c2ed92 (diff) | |
download | gitlab-ce-1e6766f9edb2a9bda18e89acef64ee03e8d3b2e4.tar.gz |
Add CreateTagService. Use new service to allow tag creation through API.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/repositories.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index 076a9ceeb74..e90d7c66125 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -25,6 +25,22 @@ module API present user_project.repo.tags.sort_by(&:name).reverse, with: Entities::RepoObject, project: user_project end + # Create tag + # + # Parameters: + # id (required) - The ID of a project + # tag_name (required) - The name of the tag + # ref (required) - Create tag from commit sha or branch + # Example Request: + # POST /projects/:id/repository/tags + post ':id/repository/tags' do + authorize_push_project + @tag = CreateTagService.new.execute(user_project, params[:tag_name], + params[:ref], current_user) + + present @tag, with: Entities::RepoObject, project: user_project + end + # Get a project repository tree # # Parameters: |