Class: Delete
- Inherits:
-
Thor
- Object
- Thor
- Delete
- Includes:
- DockerMgr::Util, Thor::Actions
- Defined in:
- lib/commands/delete.rb
Instance Method Summary collapse
Methods included from DockerMgr::Util
#add_line_to_routine, #add_packages, #add_trust, #admin_dir, #apps_dir, #attic_dir, #backup_dir, #base_images_dir, #cert_dir, #config, #data_services, #exec_hook, #extract_date, #extract_email, #extract_git_variable, #extract_name, #generate_ca_installer, #install_dir, #package_tar, #proxy_dir, #remove_line_from_routine, #root_dir, #root_dir_condition, #routine_dir, #runner_dir, #service_hooks_for, #services, #vhost_dir, #volumes
Instance Method Details
#app(app_name) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/commands/delete.rb', line 9 def app(app_name) @app_name = app_name abort "#{@app_name} is not a valid app" unless Dir.exist? "#{apps_dir}/#{@app_name}" choice = ask "do you want to remove #{@app_name}? (y,N)" abort "aborting" unless choice == 'y' FileUtils.cd "#{apps_dir}/#{@app_name}" do puts `docker-compose -f rm` end puts `tar -zcf #{attic_dir}/#{@app_name}.tar -C #{apps_dir} #{@app_name}` FileUtils.rm_rf "#{apps_dir}/#{@app_name}" FileUtils.rm_rf "#{backup_dir}/#{@app_name}" remove_line_from_routine("backup_routine","docker_mgr backup_app #{@app_name}") end |