Sha256: 6458df70cb21104cde2bf06002a71cb8b0ba46264294444f3da5d7725c963734

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

task :environment do
end

task run_commands: :environment do
  commands.run(:remote) unless commands.queue.empty?
end

task debug_configuration_variables: :environment do
  if fetch(:debug_configuration_variables)
    puts
    puts '------- Printing current config variables -------'
    configuration.variables.each do |key, value|
      puts "#{key.inspect} => #{value.inspect}"
    end
  end
end

desc 'Runs a command in the server.'
task :run, [:command] => [:environment] do |_, args|
  ensure!(:deploy_to)
  command = args[:command]

  unless command
    puts "You need to provide a command. Try: mina 'run[ls -la]'"
    exit 1
  end

  in_path fetch(:deploy_to) do
    command command
  end
end

desc 'Open an ssh session to the server and cd to deploy_to folder'
task ssh: :environment do
  exec ssh_command + " 'cd #{deploy_to} && exec \$SHELL'"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina-1.0.0.beta1 tasks/mina/default.rb