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 hooks_dir="$(cd `dirname $0` && pwd)"
# will be processed properly. update_gitlab="$hooks_dir/update.gitlab"
# You can add your own hooks to this file, but be careful when updating gitlab-shell! update_local="$hooks_dir/update.local"
refname = ARGV[0] $update_gitlab "$@" || exit 1
key_id = ENV['GL_ID']
repo_path = `pwd`
require_relative '../lib/gitlab_update' if [ -x $update_local ]; then
$update_local "$@" || exit 1
GitlabUpdate.new(repo_path, key_id, refname).exec 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
@@ -182,6 +182,9 @@ class GitlabProjects
Loading
@@ -182,6 +182,9 @@ class GitlabProjects
private private
def create_hooks_to(dest_path) 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
end end
Loading
@@ -101,7 +101,8 @@ describe GitlabProjects do
Loading
@@ -101,7 +101,8 @@ describe GitlabProjects do
it "should receive valid cmd" do it "should receive valid cmd" do
valid_cmd = "cd #{tmp_repo_path} && git init --bare" 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.should_receive(:system).with(valid_cmd)
gl_projects.exec gl_projects.exec
end end
Loading
Loading
Loading
@@ -6,8 +6,10 @@
Loading
@@ -6,8 +6,10 @@
home_dir="/home/git" home_dir="/home/git"
src=${1:-"$home_dir/repositories"} src=${1:-"$home_dir/repositories"}
function create_link_in { function create_links_in {
ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update" 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/"` for dir in `ls "$src/"`
Loading
@@ -15,12 +17,12 @@ do
Loading
@@ -15,12 +17,12 @@ do
if [ -d "$src/$dir" ]; then if [ -d "$src/$dir" ]; then
if [[ "$dir" =~ ^.*\.git$ ]] if [[ "$dir" =~ ^.*\.git$ ]]
then then
create_link_in "$src/$dir" create_links_in "$src/$dir"
else else
for subdir in `ls "$src/$dir/"` for subdir in `ls "$src/$dir/"`
do do
if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*\.git$ ]]; then if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*\.git$ ]]; then
create_link_in "$src/$dir/$subdir" create_links_in "$src/$dir/$subdir"
fi fi
done done
fi fi
Loading
Loading