lib/gitlab/client/repositories.rb in gitlab-3.1.0 vs lib/gitlab/client/repositories.rb in gitlab-3.2.0
- old
+ new
@@ -14,9 +14,23 @@
def tags(project, options={})
get("/projects/#{project}/repository/tags", :query => options)
end
alias_method :repo_tags, :tags
+ # Creates a new project repository tag.
+ #
+ # @example
+ # Gitlab.create_tag(42,'new_tag','master'))
+ #
+ # @param [Integer] project The ID of a project.
+ # @param [String] tag_name The name of the new tag.
+ # @param [String] ref The ref (commit sha, branch name, or another tag) the tag will point to.
+ # @return [Gitlab::ObjectifiedHash]
+ def create_tag(project, tag_name, ref)
+ post("/projects/#{project}/repository/tags", body: {tag_name: tag_name, ref: ref})
+ end
+ alias_method :repo_create_tag, :create_tag
+
# Gets a list of project commits.
#
# @example
# Gitlab.commits('viking')
# Gitlab.repo_commits('gitlab', :ref_name => 'api')