Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter the setup task #202

Closed
j6s opened this issue Jun 27, 2014 · 1 comment
Closed

Alter the setup task #202

j6s opened this issue Jun 27, 2014 · 1 comment

Comments

@j6s
Copy link

j6s commented Jun 27, 2014

I currently have the problem, that my setup task fails, because my hoster does enable ssh, however neither chown nor whoami are installed / accessible for the user. That is a major restriction, however i can be shure, that i really am the owner of the folders, thus there is no need for the chown.

Is there a easy way to alter the task and delete that part?

@gabskoro
Copy link
Member

gabskoro commented Oct 4, 2014

You can override the setup task by adding it to your deploy.rb file and removing thinks that you don't need.

task :setup do
  set_default :term_mode, :pretty

  settings.deploy_to!

  user = settings.user? ? "#{settings.user}" : "username"

  queue %{
    echo "-----> Setting up #{deploy_to}" && (
      #{echo_cmd %{mkdir -p "#{deploy_to}"}} &&
      #{echo_cmd %{chown -R `whoami` "#{deploy_to}"}} &&
      #{echo_cmd %{chmod g+rx,u+rwx "#{deploy_to}"}} &&
      #{echo_cmd %{cd "#{deploy_to}"}} &&
      #{echo_cmd %{mkdir -p "#{releases_path}"}} &&
      #{echo_cmd %{chmod g+rx,u+rwx "#{releases_path}"}} &&
      #{echo_cmd %{mkdir -p "#{shared_path}"}} &&
      #{echo_cmd %{chmod g+rx,u+rwx "#{shared_path}"}} &&
      echo "" &&
      #{echo_cmd %{ls -la "#{deploy_to}"}} &&
      echo "" &&
      echo "-----> Done."
    ) || (
      echo "! ERROR: Setup failed."
      echo "! Ensure that the path '#{deploy_to}' is accessible to the SSH user."
      echo "! Try doing:"
      echo "!    sudo mkdir -p \\"#{deploy_to}\\" && sudo chown -R #{user} \\"#{deploy_to}\\""
    )
  }
end

@d4be4st d4be4st closed this as completed Jul 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants