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:
authorJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2014-03-06 00:23:49 +0400
committerJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2014-03-06 00:23:49 +0400
commit13d2bcc3b4d6141643fe31dc4d7212ebca0612a5 (patch)
tree5972611479cde53e840ad1a38e95b65d66785008 /app/services/git_tag_push_service.rb
parent9a676ccc0a8dd26eb1ebd5042acbf31cfb906f91 (diff)
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/git_tag_push_service.rb')
-rw-r--r--app/services/git_tag_push_service.rb25
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