Sha256: 57820d4797b1984c922c4b52ddb6cde9c878b5b624bbebb5fc8ae1fed2e88d2b

Contents?: true

Size: 817 Bytes

Versions: 2

Compression:

Stored size: 817 Bytes

Contents

module Blazing
  class Target
    module Bootstrap

      def clone_command
        "if [ -e #{@path} ]; then \
        echo 'directory exists already'; else \
        git clone #{@repository} #{"--branch #{@branch}" if @branch} #{@path} && cd #{@path} && git config receive.denyCurrentBranch ignore; fi"
      end

      def clone_repository
        @runner.run "ssh #{@user}@#{@host} '#{clone_command}'"
      end

      def add_target_as_remote
        @runner.run "git remote add #{@name} #{@user}@#{@host}:#{@path}"
      end

      def setup_post_receive_hook
        @hook.new([use_rvm?]).generate
        @runner.run "scp /tmp/post-receive #{@user}@#{@host}:#{@path}/.git/hooks/post-receive"
        @runner.run "ssh #{@user}@#{@host} 'chmod +x #{@path}/.git/hooks/post-receive'"
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blazing-0.0.16 lib/blazing/bootstrap.rb
blazing-0.0.15 lib/blazing/bootstrap.rb