Class: Tomo::Plugin::Git::Tasks
- Inherits:
-
TaskLibrary
- Object
- TaskLibrary
- Tomo::Plugin::Git::Tasks
- Defined in:
- lib/tomo/plugin/git/tasks.rb
Instance Method Summary collapse
- #clone ⇒ Object
- #config ⇒ Object
-
#create_release ⇒ Object
rubocop:disable Metrics/AbcSize.
Methods inherited from TaskLibrary
Constructor Details
This class inherits a constructor from Tomo::TaskLibrary
Instance Method Details
#clone ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tomo/plugin/git/tasks.rb', line 16 def clone require_setting :git_url if remote.directory?(paths.git_repo) && !dry_run? set_origin_url else remote.mkdir_p(paths.git_repo.dirname) remote.git("clone", "--mirror", settings[:git_url], paths.git_repo) end end |
#config ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/tomo/plugin/git/tasks.rb', line 8 def config user_name = settings[:git_user_name] || remote.host.user user_email = settings[:git_user_email] || "#{remote.host.user}@example.com" remote.git("config", "--global", "user.name", user_name) remote.git("config", "--global", "user.email", user_email) end |
#create_release ⇒ Object
rubocop:disable Metrics/AbcSize
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/tomo/plugin/git/tasks.rb', line 27 def create_release # rubocop:disable Metrics/AbcSize remote.chdir(paths.git_repo) do remote.git("remote update --prune") end store_release_info configure_git_attributes remote.mkdir_p(paths.release) remote.chdir(paths.git_repo) do remote.git("archive #{ref.shellescape} | tar -x -f - -C #{paths.release.shellescape}") end end |