diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 16:37:42 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 16:37:42 +0400 |
commit | 6fdd9008272f268b05aa498a79dc200da52f7bbc (patch) | |
tree | 1283fe1d7b648f945e5ca97be2dffbbc911fe922 /lib/api/repositories.rb | |
parent | ec837932d0296e06ec3d9ca6cf434a62439e39da (diff) | |
parent | 28de31f5200d908551d8372fed7511df80e284fd (diff) |
Merge pull request #7014 from asedge/api_create_tag
Add CreateTagService. Use new service to allow tag creation through API.
Diffstat (limited to 'lib/api/repositories.rb')
-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 a587d4a7bdf..03806d9343b 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -26,6 +26,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: |