summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/post-receive24
-rwxr-xr-xhooks/pre-receive34
-rwxr-xr-xhooks/update20
3 files changed, 9 insertions, 69 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index 2b6538f..73740da 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -1,22 +1,4 @@
-#!/usr/bin/env ruby
+#!/bin/sh
+echo "The gitlab-shell hooks have been migrated to Gitaly, see https://gitlab.com/gitlab-org/gitaly/issues/1226"
+exit 1
-# This file was placed here by GitLab. It makes sure that your pushed commits
-# will be processed properly.
-
-refs = $stdin.read
-key_id = ENV.delete('GL_ID')
-gl_repository = ENV['GL_REPOSITORY']
-repo_path = Dir.pwd
-
-require_relative '../lib/gitlab_custom_hook'
-require_relative '../lib/hooks_utils'
-require_relative '../lib/gitlab_post_receive'
-
-push_options = HooksUtils.get_push_options
-
-if GitlabPostReceive.new(gl_repository, repo_path, key_id, refs, push_options).exec &&
- GitlabCustomHook.new(repo_path, key_id).post_receive(refs)
- exit 0
-else
- exit 1
-end
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 6ce5879..73740da 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -1,32 +1,4 @@
-#!/usr/bin/env ruby
+#!/bin/sh
+echo "The gitlab-shell hooks have been migrated to Gitaly, see https://gitlab.com/gitlab-org/gitaly/issues/1226"
+exit 1
-# This file was placed here by GitLab. It makes sure that your pushed commits
-# will be processed properly.
-
-refs = $stdin.read
-key_id = ENV.delete('GL_ID')
-protocol = ENV.delete('GL_PROTOCOL')
-repo_path = Dir.pwd
-gl_repository = ENV['GL_REPOSITORY']
-
-def increase_reference_counter(gl_repository, repo_path)
- result = GitlabNet.new.pre_receive(gl_repository)
-
- result && result['reference_counter_increased']
-end
-
-require_relative '../lib/gitlab_custom_hook'
-require_relative '../lib/gitlab_access'
-require_relative '../lib/gitlab_net'
-
-# It's important that on pre-receive `increase_reference_counter` gets executed
-# last so that it only runs if everything else succeeded. On post-receive on the
-# other hand, we run GitlabPostReceive first because the push is already done
-# and we don't want to skip it if the custom hook fails.
-if GitlabAccess.new(gl_repository, repo_path, key_id, refs, protocol).exec &&
- GitlabCustomHook.new(repo_path, key_id).pre_receive(refs) &&
- increase_reference_counter(gl_repository, repo_path)
- exit 0
-else
- exit 1
-end
diff --git a/hooks/update b/hooks/update
index 4c2fc08..73740da 100755
--- a/hooks/update
+++ b/hooks/update
@@ -1,18 +1,4 @@
-#!/usr/bin/env ruby
+#!/bin/sh
+echo "The gitlab-shell hooks have been migrated to Gitaly, see https://gitlab.com/gitlab-org/gitaly/issues/1226"
+exit 1
-# This file was placed here by GitLab. It makes sure that your pushed commits
-# will be processed properly.
-
-ref_name = ARGV[0]
-old_value = ARGV[1]
-new_value = ARGV[2]
-repo_path = Dir.pwd
-key_id = ENV.delete('GL_ID')
-
-require_relative '../lib/gitlab_custom_hook'
-
-if GitlabCustomHook.new(repo_path, key_id).update(ref_name, old_value, new_value)
- exit 0
-else
- exit 1
-end