diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-03-05 21:23:49 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-03-05 21:23:49 +0100 |
commit | 13d2bcc3b4d6141643fe31dc4d7212ebca0612a5 (patch) | |
tree | 5972611479cde53e840ad1a38e95b65d66785008 /app/services | |
parent | 9a676ccc0a8dd26eb1ebd5042acbf31cfb906f91 (diff) | |
download | gitlab-ce-13d2bcc3b4d6141643fe31dc4d7212ebca0612a5.tar.gz |
Created a basic Git Tag Push service
This is the first version, and only has the most basic information about
the tag that is created.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/git_tag_push_service.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/services/git_tag_push_service.rb b/app/services/git_tag_push_service.rb new file mode 100644 index 00000000000..21db5fcfa58 --- /dev/null +++ b/app/services/git_tag_push_service.rb @@ -0,0 +1,25 @@ +class GitTagPushService + attr_accessor :project, :user, :push_data + def execute(project, user, ref) + @project, @user = project, user + @push_data = create_push_data(ref) + project.execute_hooks(@push_data.dup, :tag_push_hooks) + end + + private + + def create_push_data(ref) + data = { + ref: ref, + user_id: user.id, + user_name: user.name, + project_id: project.id, + repository: { + name: project.name, + url: project.url_to_repo, + description: project.description, + homepage: project.web_url + } + } + end +end |