Sha256: db3d0fd54bbc00327b8f03296a8d2085302fb91eb5ed908c2eaee4fe79671733
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
require 'cap_ext_webistrano/project' require 'cap_ext_webistrano/stage' require 'cap_ext_webistrano/deployment' module CapExtWebistrano class Task attr_accessor :task, :log def initialize(task, config) @task = task @config = config @log = "" end def set_access_data [Project, Stage, Deployment].each do |klazz| klazz.configure(@config) end end def loop_latest_deployment still_running = true while still_running sleep 5 @deployment = Deployment.find(@deployment.id, :params => {:project_id => @project.id, :stage_id => @stage.id}) print_diff(@deployment) still_running = false unless @deployment.completed_at.nil? end end def print_diff(deployment) if deployment.log diff = deployment.log.sub(log, "") print diff log << diff end end def run set_access_data @project = Project.find_by_name(@config[:application]) @stage = @project.find_stage(@config[:stage]) @deployment = Deployment.create(:task => task, :stage_id => @stage.id, :project_id => @project.id) loop_latest_deployment end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mattmatt-cap-ext-webistrano-0.1.0 | lib/cap_ext_webistrano/task.rb |