summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-11-20 08:13:25 -0800
committerStan Hu <stanhu@gmail.com>2015-11-20 08:13:25 -0800
commitad1f451f249692f9ed27d3f27ee712178cb30742 (patch)
tree8f70c666e97054d581f2ddb13ca39a2d7353fd8b
parentb3cd7243e9668fc0e823b6f6cf9868171f3af456 (diff)
downloadgitlab-ce-ad1f451f249692f9ed27d3f27ee712178cb30742.tar.gz
Fix Drone web hook URL not being updated
-rw-r--r--app/models/project_services/drone_ci_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/project_services/drone_ci_service.rb b/app/models/project_services/drone_ci_service.rb
index c240213200d..127684bd274 100644
--- a/app/models/project_services/drone_ci_service.rb
+++ b/app/models/project_services/drone_ci_service.rb
@@ -32,6 +32,8 @@ class DroneCiService < CiService
def compose_service_hook
hook = service_hook || build_service_hook
+ # If using a service template, project may not be available
+ hook.url = [drone_url, "/api/hook", "?owner=#{project.namespace.path}", "&name=#{project.path}", "&access_token=#{token}"].join if project
hook.enable_ssl_verification = enable_ssl_verification
hook.save
end