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

cap aborted! Don't know how to build task 'deploy:setup' #1788

Closed
JohnMerlino2 opened this issue Oct 13, 2016 · 3 comments
Closed

cap aborted! Don't know how to build task 'deploy:setup' #1788

JohnMerlino2 opened this issue Oct 13, 2016 · 3 comments

Comments

@JohnMerlino2
Copy link

I have a very bare bones deploy. Was just trying to test it with capistrano but I keep on getting errors. I run the following:

bundle exec cap staging deploy:setup

And get the following error:

(Backtrace restricted to imported tasks)
cap aborted!
Don't know how to build task 'deploy:setup'

(See full trace by running task with --trace)

All the right gems are installed:

$ gem list | grep capistrano
capistrano (3.4.0)
capistrano-bundler (1.1.4)
capistrano-rails (1.1.3)
capistrano-rvm (0.1.2)

Not sure what's wrong.

@mattbrictson
Copy link
Member

There is no such thing as a deploy:setup in Capistrano v3. To see a list of all valid Capistrano tasks, run:

bundle exec cap -T

You probably want to run just deploy, since in Capistrano v3 that should build any directories and shared symlinks. There is no special task for deploying for the first time.

If there is something in particular you are trying to accomplish, I'd recommend reading the official documentation or post a question on Stack Overflow.

GitHub issues are for feature requests or bug reports. Since this is more of a how-to question, I am closing this issue. The Capistrano team recommends you use Stack Overflow for general questions. For more details, please see our contribution policy.

@neohunter
Copy link

Matt,

I do not completely understand why the setup was removed. If i do only cap env deploy this error appear:

00:06 deploy:check:linked_files
      linked file /home/ubuntu/deploy/shared/config/database.yml does not exist on test_server
zlib(finalizer): the stream was freed prematurely.
zlib(finalizer): the stream was freed prematurely.
zlib(finalizer): the stream was freed prematurely.

Which of course makes sense, because file does not exist on server.

What I do next is copy/create the linked files there, and run cap env deploy again.

Is this what you do also?

@mattbrictson
Copy link
Member

mattbrictson commented Mar 8, 2017

Yes, exactly. When setting up a new server for the first time, there are many things that must be done manually before Capistrano gets involved, such as:

  • Installing nginx, postgres, etc.
  • Setting up firewall rules
  • Creating a deployer user
  • Compiling Ruby
  • And so on

Also part of those initial steps is also to create a database.yml file, plus any other shared files like .env, puma's config.rb, etc.

Once all that initial server provisioning is done, then I run deploy.

Capistrano's "sweet spot" is automating the deployment step. You are free to add custom tasks, of course, if you want to automate additional things. The focus of v3 has been on deployment as opposed to one-time setup.

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