Commit f7625147 authored by Stan Hu's avatar Stan Hu

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

parent 61164e3e
Pipeline #64559297 canceled with stages
in 1 minute and 56 seconds
......@@ -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
ci_project_dir = ENV['CI_PROJECT_DIR']
ci_commit_sha = ENV['CI_COMMIT_SHA']
def exec_cmd(cmd)
puts cmd.join(' ')
exec(*cmd)
end
# We need to retrieve the commit SHA if the source project is a fork
if ci_project_dir && ci_commit_sha
exec_cmd(%W[git remote add source #{ci_project_dir}])
exec_cmd(%W[git fetch source #{ci_commit_sha}])
end
ci_sha = ENV.fetch('CI_COMMIT_SHA', '')
cmd = if ci_sha.empty?
......@@ -8,5 +22,4 @@ else
%W[git checkout #{ci_sha}]
end
puts cmd.join(' ')
exec(*cmd)
exec_cmd(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