Commit f661f0d7 authored by Stan Hu's avatar Stan Hu 🔴

Move fetch SHA to support/self-update-git-worktree

parent 61164e3e
......@@ -125,8 +125,6 @@ test:update:
- cd /home/gdk
- gdk init
- cd gitlab-development-kit
- git remote add source $CI_PROJECT_DIR
- git fetch source $CI_COMMIT_SHA
- netstat -lpt
- IGNORE_INSTALL_WARNINGS=true gdk install
- support/set-gitlab-upstream
......
#!/usr/bin/env ruby
def run(cmd)
puts cmd.join(' ')
system(*cmd)
end
ci_project_dir = ENV['CI_PROJECT_DIR']
ci_sha = ENV.fetch('CI_COMMIT_SHA', '')
# We need to retrieve the commit SHA if the source project is a fork
if ci_project_dir && !ci_sha.empty?
run(%W[git remote add source #{ci_project_dir}])
run(%W[git fetch source #{ci_sha}])
end
cmd = if ci_sha.empty?
%w[git merge --ff-only origin/master]
else
%W[git checkout #{ci_sha}]
end
puts cmd.join(' ')
exec(*cmd)
run(cmd)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment