Class: TaskLoop::Deploy

Inherits:
Command
  • Object
show all
Includes:
DSL
Defined in:
lib/taskloop/command/deploy.rb

Constant Summary

Constants inherited from Command

Command::DOLPHIN, Command::LOGO

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL

#after, #at, #before, #between, #date, #env, #from, #interval, #loop, #time, #to

Methods inherited from Command

#create_dir_if_needed, #create_file_if_needed, #create_taskloop_file_structure_if_needed, #initialize, #taskloop_cron_log_path, #taskloop_cron_tab_path, #taskloop_data_dir, #taskloop_data_proj_dirs, #taskloop_dir, #taskloop_environments_path, #taskloop_proj_list_dirs, #taskloop_proj_list_path, #taskloop_taskfile_paths, #tasklooprc_path

Constructor Details

This class inherits a constructor from TaskLoop::Command

Instance Attribute Details

#tasklistObject



37
38
39
# File 'lib/taskloop/command/deploy.rb', line 37

def tasklist
  @tasklist ||= []
end

Instance Method Details

#runObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/taskloop/command/deploy.rb', line 41

def run
  super
  # check if Taskfile exist
  unless  File.file?(:Taskfile.to_s)
    puts "Error:".ansi.red
    puts "    Taskfile is not exist. Please goto the project's root directory and execute again, or run `taskloop init` command first if current directory is the root directory of a project.".ansi.red
    exit 1
  end

  register_taskfile_dir_if_needed
  unless deploy_lint?
    puts "Taskfile deploy failed. Please check Taskfile again.".ansi.red
    exit 1
  end

  generate_taskfile_deploy

  clean_loopfile_if_needed
end