From 1ca4dd26d11e93248352c9acf902b9553f3d4cc4 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 4 Apr 2019 20:50:22 +0000 Subject: Move gitlab-shell out of ruby/vendor --- _support/makegen.go | 2 +- _support/vendor-gitlab-shell | 41 ----------------------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100755 _support/vendor-gitlab-shell (limited to '_support') diff --git a/_support/makegen.go b/_support/makegen.go index 413a98d31..82e924062 100644 --- a/_support/makegen.go +++ b/_support/makegen.go @@ -77,7 +77,7 @@ func (gm *gitalyMake) GoVendor() string { return "bin/govendor" } func (gm *gitalyMake) StaticCheck() string { return filepath.Join(gm.BuildDir(), "bin/staticcheck") } func (gm *gitalyMake) CoverageDir() string { return filepath.Join(gm.BuildDir(), "cover") } func (gm *gitalyMake) GitalyRubyDir() string { return filepath.Join(gm.SourceDir(), "ruby") } -func (gm *gitalyMake) GitlabShellRelDir() string { return "ruby/vendor/gitlab-shell" } +func (gm *gitalyMake) GitlabShellRelDir() string { return "ruby/gitlab-shell" } func (gm *gitalyMake) GitlabShellDir() string { return filepath.Join(gm.SourceDir(), gm.GitlabShellRelDir()) } diff --git a/_support/vendor-gitlab-shell b/_support/vendor-gitlab-shell deleted file mode 100755 index c5fdbc99f..000000000 --- a/_support/vendor-gitlab-shell +++ /dev/null @@ -1,41 +0,0 @@ -#!/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 -- cgit v1.2.3