Create event and clear cache on new trag push
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
b0a86cb3ba
commit
5be424565e
1 changed files with 13 additions and 0 deletions
|
@ -1,8 +1,12 @@
|
|||
class GitTagPushService
|
||||
attr_accessor :project, :user, :push_data
|
||||
|
||||
def execute(project, user, oldrev, newrev, ref)
|
||||
@project, @user = project, user
|
||||
@push_data = create_push_data(oldrev, newrev, ref)
|
||||
|
||||
create_push_event
|
||||
project.repository.expire_cache
|
||||
project.execute_hooks(@push_data.dup, :tag_push_hooks)
|
||||
end
|
||||
|
||||
|
@ -24,4 +28,13 @@ class GitTagPushService
|
|||
}
|
||||
}
|
||||
end
|
||||
|
||||
def create_push_event
|
||||
Event.create!(
|
||||
project: project,
|
||||
action: Event::PUSHED,
|
||||
data: push_data,
|
||||
author_id: push_data[:user_id]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue