From 2c0bcefdc6af442f67f74c6124fc1a9cbacd2831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 1 Dec 2016 16:24:35 +0100 Subject: Don't allow to specify a repo or version when installing Workhorse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The task will use the canonical repo and the required version. Signed-off-by: Rémy Coutable --- doc/install/installation.md | 12 ------------ doc/update/patch_versions.md | 7 +++---- lib/tasks/gitlab/workhorse.rake | 4 ++-- spec/tasks/gitlab/workhorse_rake_spec.rb | 26 -------------------------- 4 files changed, 5 insertions(+), 44 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 77adb4c9f7b..4b0c585e51e 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -404,18 +404,6 @@ which is the recommended location. sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production -You can specify a different Git repository by providing `GITLAB_WORKHORSE_REPO`: - - cd /home/git/gitlab - - sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" GITLAB_WORKHORSE_REPO=https://example.com/gitlab-workhorse.git RAILS_ENV=production - -You can specify a different version to use by providing `GITLAB_WORKHORSE_VERSION`: - - cd /home/git/gitlab - - sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" GITLAB_WORKHORSE_VERSION=0.8.1 RAILS_ENV=production - ### Initialize Database and Activate Advanced Features # Go to GitLab installation folder diff --git a/doc/update/patch_versions.md b/doc/update/patch_versions.md index 60729316cde..e98c40ca4c0 100644 --- a/doc/update/patch_versions.md +++ b/doc/update/patch_versions.md @@ -45,10 +45,9 @@ sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION` -b v`ca ### 4. Update gitlab-workhorse to the corresponding version ```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch -sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` -b v`cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` -sudo -u git -H make +cd /home/git/gitlab + +sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production ``` ### 5. Install libs, migrations, etc. diff --git a/lib/tasks/gitlab/workhorse.rake b/lib/tasks/gitlab/workhorse.rake index 46bd0bf2e7b..baea94bf8ca 100644 --- a/lib/tasks/gitlab/workhorse.rake +++ b/lib/tasks/gitlab/workhorse.rake @@ -7,8 +7,8 @@ namespace :gitlab do abort %(Please specify the directory where you want to install gitlab-workhorse:\n rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]") end - tag = "v#{ENV['GITLAB_WORKHORSE_VERSION'] || Gitlab::Workhorse.version}" - repo = ENV['GITLAB_WORKHORSE_REPO'] || 'https://gitlab.com/gitlab-org/gitlab-workhorse.git' + tag = "v#{Gitlab::Workhorse.version}" + repo = 'https://gitlab.com/gitlab-org/gitlab-workhorse.git' checkout_or_clone_tag(tag: tag, repo: repo, target_dir: args.dir) diff --git a/spec/tasks/gitlab/workhorse_rake_spec.rb b/spec/tasks/gitlab/workhorse_rake_spec.rb index b695abce091..6de66c3cf07 100644 --- a/spec/tasks/gitlab/workhorse_rake_spec.rb +++ b/spec/tasks/gitlab/workhorse_rake_spec.rb @@ -41,32 +41,6 @@ describe 'gitlab:workhorse namespace rake task' do run_rake_task('gitlab:workhorse:install', clone_path) end - - context 'given a specific repo' do - before do - expect(ENV).to receive(:[]).with('GITLAB_WORKHORSE_REPO').and_return('https://gitlab.com/user1/gitlab-workhorse.git') - end - - it 'calls checkout_or_clone_tag with the given repo' do - expect_any_instance_of(Object). - to receive(:checkout_or_clone_tag).with(tag: tag, repo: 'https://gitlab.com/user1/gitlab-workhorse.git', target_dir: clone_path) - - run_rake_task('gitlab:workhorse:install', clone_path) - end - end - - context 'given a specific version' do - before do - allow(ENV).to receive(:[]).with('GITLAB_WORKHORSE_VERSION').and_return('42.42.0') - end - - it 'calls checkout_or_clone_tag with the given repo' do - expect_any_instance_of(Object). - to receive(:checkout_or_clone_tag).with(tag: 'v42.42.0', repo: repo, target_dir: clone_path) - - run_rake_task('gitlab:workhorse:install', clone_path) - end - end end describe 'gmake/make' do -- cgit v1.2.1