As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • idrozdov/gitlab-shell
  • mmj/gitlab-shell
2 results
Show changes
Commits on Source (6)
v1.9.8
- Ignore missing repositories in create-hooks
- Symlink the whole hooks directory
v1.9.7
- Increased test coverage
- By default use direct unicorn connection (localhost:8080)
Loading
Loading
1.9.7
1.9.8
Loading
Loading
@@ -8,5 +8,9 @@ require_relative '../lib/gitlab_init'
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
Dir["#{GitlabConfig.new.repos_path}/*/*.git"].each do |repo|
GitlabProjects.create_hooks(repo)
begin
GitlabProjects.create_hooks(repo)
rescue Errno::ENOENT
# The user must have deleted their repository. Ignore.
end
end
Loading
Loading
@@ -5,6 +5,8 @@ require_relative 'gitlab_config'
require_relative 'gitlab_logger'
class GitlabProjects
GLOBAL_HOOKS_DIRECTORY = File.join(ROOT_PATH, 'hooks')
# Project name is a directory name for repository with .git at the end
# It may be namespaced or not. Like repo.git or gitlab/repo.git
attr_reader :project_name
Loading
Loading
@@ -18,9 +20,11 @@ class GitlabProjects
attr_reader :full_path
def self.create_hooks(path)
hook = File.join(path, 'hooks', 'update')
File.delete(hook) if File.exists?(hook)
File.symlink(File.join(ROOT_PATH, 'hooks', 'update'), hook)
local_hooks_directory = File.join(path, 'hooks')
unless File.realpath(local_hooks_directory) == File.realpath(GLOBAL_HOOKS_DIRECTORY)
FileUtils.mv(local_hooks_directory, "#{local_hooks_directory}.old.#{Time.now.to_i}")
FileUtils.ln_s(GLOBAL_HOOKS_DIRECTORY, local_hooks_directory)
end
end
def initialize
Loading
Loading