Sha256: ba6655cac63a8d1cd32b2979e3f692c7fa191ff7e205dccd06b08987d166e543

Contents?: true

Size: 780 Bytes

Versions: 10

Compression:

Stored size: 780 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do

  namespace :util do

    namespace :tmp do
      desc "[capistrano-extensions]: Displays warning if :tmp_dir has more than 10 files or is greater than 50MB"
      task :check do
        #[ 5 -le "`ls -1 tmp/cap | wc -l`" ] && echo "Display Me"
        cmd = %Q{ [ 10 -le "`ls -1 #{tmp_dir} | wc -l`" ] || [ 50 -le "`du -sh #{tmp_dir} | awk '{print int($1)}'`" ] && printf "\033[1;41m Clean up #{tmp_dir} directory \033[0m\n" && du -sh #{tmp_dir}/*  }
        system(cmd)
      end

      desc "[capistrano-extensions]: Remove the current remote env's backups from :tmp_dir"
      task :clean_remote do
        system("rm -rf #{rails_root}/#{tmp_dir}/#{configuration.fetch(:application)}-*")
      end

    end
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
blavosync-0.5.2 lib/blavosync/recipes/util.rb
blavosync-0.5.1 lib/blavosync/recipes/util.rb
blavosync-0.5.0 lib/blavosync/recipes/util.rb
blavosync-0.4.1 lib/blavosync/recipes/util.rb
blavosync-0.4.0 lib/blavosync/recipes/util.rb
blavosync-0.3.2 lib/blavosync/recipes/util.rb
blavosync-0.3.0 lib/blavosync/recipes/util.rb
blavosync-0.2.3 lib/blavosync/recipes/util.rb
blavosync-0.2.2 lib/blavosync/recipes/util.rb
blavosync-0.2.1 lib/blavosync/recipes/util.rb