diff options
author | Hordur Freyr Yngvason <hfyngvason@gitlab.com> | 2019-07-30 16:52:28 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2019-07-30 16:52:28 +0300 |
commit | 012fe3141e11f29b0a25985425dd7de96bf436c9 (patch) | |
tree | 04787a7f6ce5cf4f1d33fd93407350ef4cce6ca7 /lib/gitlab/project_template.rb | |
parent | 11f82c891ab82620982ef157d3a6783ee56a6997 (diff) |
Fix broken update_project_templates rake task
This rake task had been broken for a while. This fixes the breakages,
adds a test to help avoid future breakages, and adds a few ergonomic
improvements to the task itself.
Diffstat (limited to 'lib/gitlab/project_template.rb')
-rw-r--r-- | lib/gitlab/project_template.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/project_template.rb b/lib/gitlab/project_template.rb index 99885be8755..dbf469a44c1 100644 --- a/lib/gitlab/project_template.rb +++ b/lib/gitlab/project_template.rb @@ -13,11 +13,15 @@ module Gitlab end def archive_path - Rails.root.join("vendor/project_templates/#{name}.tar.gz") + self.class.archive_directory.join(archive_filename) + end + + def archive_filename + "#{name}.tar.gz" end def clone_url - "https://gitlab.com/gitlab-org/project-templates/#{name}.git" + "#{preview}.git" end def ==(other) @@ -54,7 +58,7 @@ module Gitlab end def archive_directory - Rails.root.join("vendor_directory/project_templates") + Rails.root.join("vendor/project_templates") end end end |