{"action":"created","issue":{"url":"https://api.github.com/repos/mina-deploy/mina/issues/316","labels_url":"https://api.github.com/repos/mina-deploy/mina/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/mina-deploy/mina/issues/316/comments","events_url":"https://api.github.com/repos/mina-deploy/mina/issues/316/events","html_url":"https://github.com/mina-deploy/mina/issues/316","id":81158577,"number":316,"title":"mina:deploy runs tasks twice for some reason","user":{"login":"snitko","id":21143,"avatar_url":"https://avatars.githubusercontent.com/u/21143?v=3","gravatar_id":"","url":"https://api.github.com/users/snitko","html_url":"https://github.com/snitko","followers_url":"https://api.github.com/users/snitko/followers","following_url":"https://api.github.com/users/snitko/following{/other_user}","gists_url":"https://api.github.com/users/snitko/gists{/gist_id}","starred_url":"https://api.github.com/users/snitko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snitko/subscriptions","organizations_url":"https://api.github.com/users/snitko/orgs","repos_url":"https://api.github.com/users/snitko/repos","events_url":"https://api.github.com/users/snitko/events{/privacy}","received_events_url":"https://api.github.com/users/snitko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mina-deploy/mina/labels/Help%20wanted","name":"Help wanted","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-26T22:08:50Z","updated_at":"2015-07-05T10:52:28Z","closed_at":null,"body":"I have a custom non Rails and it seems that when I run `mina deploy` it executes certain tasks twice (namely `install:*` and `daemons:*`). Here's the script:\r\n\r\n    require 'mina/bundler'\r\n    require 'mina/git'\r\n    require 'mina/rvm'\r\n    require 'yaml'\r\n\r\n    LOCAL_SETTINGS = YAML.load_file(File.dirname(__FILE__) + '/local_settings.yml')\r\n    set :project_local_dir, File.expand_path(File.dirname(__FILE__) + \"/../\" + LOCAL_SETTINGS['project_dir'])\r\n\r\n    set :domain, 'deploy@mega-app'\r\n    set :port, 22\r\n    set :forward_agent, true\r\n    set :term_mode, :pretty\r\n\r\n    set :addons, {\r\n      payment_ui: 'mega-app/payment_ui'\r\n    }\r\n    set :gems, {\r\n      'mega-app-server' => 'server',\r\n      'mega-app'        => 'engine'\r\n    }\r\n\r\n    # For system-wide RVM install.\r\n    set :rvm_path, '/usr/local/rvm/scripts/rvm'\r\n\r\n    task :environment do\r\n\r\n      stage_param = ENV['to']\r\n      if stage_param == 'production'\r\n        set :stage, 'production'\r\n        set :server_port, 9695\r\n        invoke :'rvm:use[ruby-ruby-2.2-head@production]'\r\n      else\r\n        set :stage, 'staging'\r\n        set :server_port, 9696\r\n        invoke :'rvm:use[ruby-ruby-2.2-head@staging]'\r\n      end\r\n\r\n    end\r\n\r\n    desc \"Deploys the current version to the server.\"\r\n    task :deploy => :environment do\r\n\r\n      invoke :'upload:addons'\r\n      invoke :'upload:gems'\r\n      invoke :'install:addons'\r\n      invoke :'install:gems'\r\n      invoke :'daemons:restart'\r\n\r\n      run_local!(:local)\r\n      run!\r\n\r\n    end\r\n\r\n    namespace :upload do\r\n\r\n      task :addons => :environment do\r\n        to :local do\r\n          queue \"echo '-----> Packaging and uploading addons'\"\r\n          addons.each do |addon_name, addon_path|\r\n            queue \"echo '  Packaging and uploading #{addon_name}'\"\r\n            dir = \"#{project_local_dir}/#{addon_path}\"\r\n            queue \"#{project_local_dir}/mega-app/deployment/git-archive-all.sh #{dir}/#{addon_name}-master.tar --tree-ish master\"\r\n            queue \"rsync -avze 'ssh' --delete #{dir}/#{addon_name}-master.tar #{domain}:/home/deploy/.mega-app-#{stage}/addons/\"\r\n            queue \"rm #{dir}/#{addon_name}-master.tar\"\r\n          end\r\n        end\r\n      end\r\n\r\n      task :gems => :environment do\r\n        to :local do\r\n          queue \"echo '-----> Uploading gems'\"\r\n          gems.each do |gem_name, gem_path|\r\n            queue \"echo '  Building and uploading #{gem_name}'\"\r\n            dir = \"#{project_local_dir}/#{gem_path}\"\r\n            queue \"cd #{dir} && rake build\"\r\n            queue \"rsync -avze 'ssh' --delete #{dir}/pkg/*.gem #{domain}:/home/deploy/mega-app-gems/#{stage}/\"\r\n          end\r\n        end\r\n      end\r\n\r\n    end\r\n\r\n\r\n    namespace :install do\r\n\r\n      task :addons => :environment do\r\n        dir = \"/home/deploy/.mega-app-#{stage}/addons\"\r\n        in_directory dir do\r\n          queue \"echo '-----> Installing addons'\"\r\n          addons.each do |addon_name, addon_path|\r\n            queue \"echo '  Installing #{addon_name} into #{dir}'\"\r\n            queue \"mkdir -p #{addon_name}\"\r\n            queue \"tar -C #{addon_name} -xvf #{addon_name}-master.tar\"\r\n            queue \"cd #{addon_name} && bundle\"\r\n          end\r\n        end\r\n      end\r\n\r\n      task :gems => :environment do\r\n        queue \"echo '-----> Installing rubygems'\"\r\n        dir = \"/home/deploy/mega-app-gems/#{stage}/\"\r\n        in_directory dir do\r\n          gems.each do |gem_name, gem_path|\r\n            queue \"echo '  Installing #{gem_name}'\"\r\n            queue \"gem install $(ls #{gem_name}* -Art | tail -n 1) --no-ri --no-rdoc\"\r\n          end\r\n        end\r\n      end\r\n\r\n    end\r\n\r\n    namespace :daemons do\r\n\r\n      task :start => :environment do\r\n        queue \"echo '-----> Starting mega-app-server daemon at port #{server_port}'\"\r\n        queue \"mega-app-server -p #{server_port} --config-dir=~/.mega-app-#{stage} --daemonize --pid ~/.mega-app-#{stage}/mega-app.pid\"\r\n      end\r\n\r\n      task :stop => :environment do\r\n        queue \"echo '-----> Stopping mega-app-server daemon'\"\r\n        queue \"if test -f '~/.mega-app-#{stage}/mega-app.pid'; then kill $(cat ~/.mega-app-#{stage}/mega-app.pid);fi\"\r\n      end\r\n\r\n      task :restart => :environment do\r\n        invoke :'daemons:stop'\r\n        invoke :'daemons:start'\r\n      end\r\n\r\n    end\r\n\r\nCan you shed some light as to why this might be happening?"},"comment":{"url":"https://api.github.com/repos/mina-deploy/mina/issues/comments/118611192","html_url":"https://github.com/mina-deploy/mina/issues/316#issuecomment-118611192","issue_url":"https://api.github.com/repos/mina-deploy/mina/issues/316","id":118611192,"user":{"login":"d4be4st","id":973872,"avatar_url":"https://avatars.githubusercontent.com/u/973872?v=3","gravatar_id":"","url":"https://api.github.com/users/d4be4st","html_url":"https://github.com/d4be4st","followers_url":"https://api.github.com/users/d4be4st/followers","following_url":"https://api.github.com/users/d4be4st/following{/other_user}","gists_url":"https://api.github.com/users/d4be4st/gists{/gist_id}","starred_url":"https://api.github.com/users/d4be4st/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4be4st/subscriptions","organizations_url":"https://api.github.com/users/d4be4st/orgs","repos_url":"https://api.github.com/users/d4be4st/repos","events_url":"https://api.github.com/users/d4be4st/events{/privacy}","received_events_url":"https://api.github.com/users/d4be4st/received_events","type":"User","site_admin":false},"created_at":"2015-07-05T10:52:28Z","updated_at":"2015-07-05T10:52:28Z","body":"can you maybe give as a `mina deploy -v` output to see where exacly is the problem?"}}