Class: Statistrano::Deployment::Releaser::Single

Inherits:
Object
  • Object
show all
Defined in:
lib/statistrano/deployment/releaser/single.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSingle

Returns a new instance of Single.



9
10
11
# File 'lib/statistrano/deployment/releaser/single.rb', line 9

def initialize
  @release_name = Time.now.to_i.to_s
end

Instance Attribute Details

#release_nameObject (readonly)

Returns the value of attribute release_name.



7
8
9
# File 'lib/statistrano/deployment/releaser/single.rb', line 7

def release_name
  @release_name
end

Instance Method Details

#create_release(remote, build_data = {}) ⇒ Object



13
14
15
16
# File 'lib/statistrano/deployment/releaser/single.rb', line 13

def create_release remote, build_data={}
  setup remote
  rsync_to_remote remote
end

#rsync_to_remote(remote) ⇒ Object



23
24
25
26
27
28
# File 'lib/statistrano/deployment/releaser/single.rb', line 23

def rsync_to_remote remote
  resp = remote.rsync_to_remote local_path(remote), remote_path(remote)
  unless resp.success?
    abort()
  end
end

#setup(remote) ⇒ Object



18
19
20
21
# File 'lib/statistrano/deployment/releaser/single.rb', line 18

def setup remote
  Log.info   "Setting up the remote"
  remote.run "mkdir -p #{remote_path(remote)}"
end