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 (2)
#!/usr/bin/env ruby
#!/bin/bash
# GitLab update hook -- do not modify!
# To add your own update hook, create an update.local executable
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
# You can add your own hooks to this file, but be careful when updating gitlab-shell!
hooks_dir="$(cd `dirname $0` && pwd)"
update_gitlab="$hooks_dir/update.gitlab"
update_local="$hooks_dir/update.local"
refname = ARGV[0]
key_id = ENV['GL_ID']
repo_path = `pwd`
$update_gitlab "$@" || exit 1
require_relative '../lib/gitlab_update'
GitlabUpdate.new(repo_path, key_id, refname).exec
if [ -x $update_local ]; then
$update_local "$@" || exit 1
fi
#!/usr/bin/env ruby
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly. See the `update` script for instructions on how
# to add your own update hooks.
refname = ARGV[0]
key_id = ENV['GL_ID']
repo_path = `pwd`
require_relative '../lib/gitlab_update'
GitlabUpdate.new(repo_path, key_id, refname).exec
Loading
Loading
@@ -182,6 +182,9 @@ class GitlabProjects
private
def create_hooks_to(dest_path)
"ln -s #{File.join(ROOT_PATH, 'hooks', 'update')} #{dest_path}/hooks/update"
symlink_cmds = Dir[File.join(ROOT_PATH, 'hooks', '*')].sort.map do |hook|
"ln -s #{hook} #{dest_path}/hooks/"
end
symlink_cmds.join(' && ')
end
end
Loading
Loading
@@ -101,7 +101,8 @@ describe GitlabProjects do
it "should receive valid cmd" do
valid_cmd = "cd #{tmp_repo_path} && git init --bare"
valid_cmd << " && ln -s #{ROOT_PATH}/hooks/update #{tmp_repo_path}/hooks/update"
valid_cmd << " && ln -s #{ROOT_PATH}/hooks/update #{tmp_repo_path}/hooks/"
valid_cmd << " && ln -s #{ROOT_PATH}/hooks/update.gitlab #{tmp_repo_path}/hooks/"
gl_projects.should_receive(:system).with(valid_cmd)
gl_projects.exec
end
Loading
Loading
Loading
Loading
@@ -6,8 +6,10 @@
home_dir="/home/git"
src=${1:-"$home_dir/repositories"}
function create_link_in {
ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update"
function create_links_in {
for gitlab_shell_hooks in ${home_dir}/gitlab-shell/hooks/* ; do
ln -s -f "$gitlab_shell_hooks" "$1/hooks/"
done
}
for dir in `ls "$src/"`
Loading
Loading
@@ -15,12 +17,12 @@ do
if [ -d "$src/$dir" ]; then
if [[ "$dir" =~ ^.*\.git$ ]]
then
create_link_in "$src/$dir"
create_links_in "$src/$dir"
else
for subdir in `ls "$src/$dir/"`
do
if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*\.git$ ]]; then
create_link_in "$src/$dir/$subdir"
create_links_in "$src/$dir/$subdir"
fi
done
fi
Loading
Loading