Commit f096bd61bda605f2e3631bcd4663ab68c7396989
1 parent
13d2bcc3
Exists in
spb-stable
and in
3 other branches
Post-receive hook can also fire TagPushService
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
app/workers/post_receive.rb
| ... | ... | @@ -29,10 +29,20 @@ class PostReceive |
| 29 | 29 | return false |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | - GitPushService.new.execute(project, user, oldrev, newrev, ref) | |
| 32 | + if tag?(ref) | |
| 33 | + GitTagPushService.new.execute(project, user, ref) | |
| 34 | + else | |
| 35 | + GitPushService.new.execute(project, user, oldrev, newrev, ref) | |
| 36 | + end | |
| 33 | 37 | end |
| 34 | 38 | |
| 35 | 39 | def log(message) |
| 36 | 40 | Gitlab::GitLogger.error("POST-RECEIVE: #{message}") |
| 37 | 41 | end |
| 42 | + | |
| 43 | + private | |
| 44 | + | |
| 45 | + def tag?(ref) | |
| 46 | + !!(/refs\/tags\/(.*)/.match(ref)) | |
| 47 | + end | |
| 38 | 48 | end | ... | ... |