Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-12-21 19:49:01 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2019-01-08 11:58:39 +0300
commitef39d24fd06a86b1bb5cd3ddf101d938a8e13763 (patch)
treed16cbe16484c11f5076c346993a67f7b32efac1b
parent948b0455341b639e65868d532865ec4b6892bf17 (diff)
Add vendoring script
-rwxr-xr-x_support/vendor-gitlab-shell41
1 files changed, 41 insertions, 0 deletions
diff --git a/_support/vendor-gitlab-shell b/_support/vendor-gitlab-shell
new file mode 100755
index 000000000..c5fdbc99f
--- /dev/null
+++ b/_support/vendor-gitlab-shell
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+
+require 'tempfile'
+
+require_relative 'run'
+
+REMOTE = 'https://gitlab.com/gitlab-org/gitlab-shell.git'
+REMOVE_PATHS = %w[go support spec/action .git spec/gitlab_shell_gitlab_shell_spec.rb].freeze
+
+def main
+ Dir.mktmpdir do |dir|
+ run!(%W[git clone --depth=1 --quiet #{REMOTE} gitlab-shell], dir)
+ tmp_shell_dir = File.join(dir, 'gitlab-shell')
+
+ run!(%w[mv README.md README.orig.md], tmp_shell_dir)
+
+ revision = capture!(%w[git rev-parse HEAD], tmp_shell_dir).chomp
+ remote_project = REMOTE.sub(/\.git$/, '')
+
+ readme = <<-EOS
+# gitlab-shell
+
+Vendored from #{remote_project} at [#{revision}](#{remote_project}/commit/#{revision}).
+
+Original README: [README.orig.md](README.orig.md).
+EOS
+ File.write(File.join(tmp_shell_dir, 'README.md'), readme)
+
+ run!(%w[rm -rf --] + REMOVE_PATHS, tmp_shell_dir)
+
+ gitlab_init = File.join(tmp_shell_dir, 'lib/gitlab_init.rb')
+ gitlab_init_contents = File.read(gitlab_init)
+ File.write(gitlab_init, gitlab_init_contents.sub(/^GITALY_EMBEDDED =.*/, 'GITALY_EMBEDDED = true'))
+
+ shell_vendor_dir = 'ruby/vendor/gitlab-shell'
+ run!(%W[mkdir -p #{shell_vendor_dir}])
+ run!(%W[rsync -av --delete #{tmp_shell_dir}/ #{shell_vendor_dir}/])
+ end
+end
+
+main