Giter VIP home page Giter VIP logo

laravel's Introduction

Capistrano::Laravel

Deploy Laravel applications with Capistrano v3.*

Installation

If managing your Capistrano deploy as a ruby project, add this line to your application's Gemfile:

gem 'capistrano', '~> 3.0.0'
gem 'capistrano-laravel'

And then execute:

bundle

Or install it yourself as:

gem install capistrano-laravel

Setting up Capistrano

After installing Capistrano, you can use it to initialize a skeleton configuration. To setup Capistrano, please follow the documentation provided on their website:

http://capistranorb.com/documentation/getting-started/preparing-your-application/

This will generate the following files:

.
├── Capfile                # Used to manage Capistrano and its dependencies
├── config
│   ├── deploy
│   │   ├── production.rb  # Configuration for production environment
│   │   └── staging.rb     # Configuration for staging environment
│   └── deploy.rb          # Common configuration for all environments
└── lib
    └── capistrano
        └── tasks          # Customized Capistrano tasks for your project

Usage

Require the module in your Capfile:

require 'capistrano/laravel'

Configuration

The gem makes the following configuration variables available (shown with defaults).

# Which roles to consider as laravel roles
set :laravel_roles, :all

# The artisan flags to include on artisan commands by default
set :laravel_artisan_flags, "--env=#{fetch(:stage)}"

# Which roles to use for running migrations
set :laravel_migration_roles, :all

# The artisan flags to include on artisan commands by default when running migrations
set :laravel_migration_artisan_flags, "--force --env=#{fetch(:stage)}"

# The version of laravel being deployed
set :laravel_version, 5.3

# Whether to upload the dotenv file on deploy
set :laravel_upload_dotenv_file_on_deploy, true

# Which dotenv file to transfer to the server
set :laravel_dotenv_file, './.env'

# The user that the server is running under (used for ACLs)
set :laravel_server_user, 'www-data'

# Ensure the dirs in :linked_dirs exist?
set :laravel_ensure_linked_dirs_exist, true

# Link the directores in laravel_linked_dirs?
set :laravel_set_linked_dirs, true

# Linked directories for a standard Laravel 4 application
set :laravel_4_linked_dirs, [
  'app/storage'
]

# Linked directories for a standard Laravel 5 application
set :laravel_5_linked_dirs, [
  'storage'
]

# Ensure the paths in :file_permissions_paths exist?
set :laravel_ensure_acl_paths_exist, true

# Set ACLs for the paths in laravel_acl_paths?
set :laravel_set_acl_paths, true

# Paths that should have ACLs set for a standard Laravel 4 application
set :laravel_4_acl_paths, [
  'app/storage',
  'app/storage/public',
  'app/storage/cache',
  'app/storage/logs',
  'app/storage/meta',
  'app/storage/sessions',
  'app/storage/views'
]

# Paths that should have ACLs set for a standard Laravel 5 application
set :laravel_5_acl_paths, [
  'bootstrap/cache',
  'storage',
  'storage/app',
  'storage/app/public',
  'storage/framework',
  'storage/framework/cache',
  'storage/framework/sessions',
  'storage/framework/views',
  'storage/logs'
]

Tasks

The following tasks are added to your deploy automagically when adding capistrano/laravel to your deploy.

before 'deploy:starting', 'laravel:resolve_linked_dirs'
before 'deploy:starting', 'laravel:resolve_acl_paths'
after  'deploy:starting', 'laravel:ensure_linked_dirs_exist'
before 'deploy:updating', 'laravel:ensure_acl_paths_exist'
before 'deploy:updated',  'deploy:set_permissions:acl'
before 'deploy:updated',  'laravel:upload_dotenv_file'
after  'composer:run',    'laravel:storage_link'
after  'composer:run',    'laravel:optimize'

Task Descriptions

# Determine which folders, if any, to use for linked directories.
invoke 'laravel:resolve_linked_dirs'

# Determine which paths, if any, to have ACL permissions set.
invoke 'laravel:resolve_acl_paths'

# Ensure that linked dirs exist.
invoke 'laravel:ensure_linked_dirs_exist'

# Ensure that ACL paths exist.
invoke 'laravel:ensure_acl_paths_exist'

# Upload dotenv file for release.
invoke 'laravel:upload_dotenv_file'

# Execute a provided artisan command.
# Replace :command_name with the command to execute
invoke 'laravel:artisan[:command_name]'

# Create a cache file for faster configuration loading
invoke 'laravel:config_cache'

# Create a route cache file for faster route registration
invoke 'laravel:route_cache'

# Optimize the framework for better performance.
invoke 'laravel:optimize'

# Create a symbolic link from "public/storage" to "storage/app/public"
invoke 'laravel:storage_link'

# Run the database migrations.
invoke 'laravel:migrate'

# Rollback the last database migration.
invoke 'laravel:migrate_rollback'

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/capistrano/laravel.

License

The gem is available as open source under the terms of the MIT License.

laravel's People

Contributors

allaire avatar andrew-miller-rakuten avatar ikari7789 avatar pernicat avatar peterjmit avatar sparkhom avatar yiichou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel's Issues

changes if your site isn't actually in the root of the git repo

The git structure at my company makes the laravel website under directory a subfolder under git like so:

+site
  app/
  artisan
  bootstrap/
  etc
+docs
+ide_lint_setup

but alot things will then fail like 'composer install --no-dev' needs to run from the site/ directory. same for things like 'php artisan migrate', or setting up of the sym-links to the shared files/directories.
Is there something currently can do to alleviate this?

For another capistrano-like deploy system (Deployer.org), I setup a custom task to temporarily change the release_path variable before the laravel specific tasks (to something like releases/#/site/ ) and then changed it back at the end to the original main path so the sym-link to the main releases/# could be setup. For example in Deployer.org, i did this:
after('deploy:update_code', 'change_to_custom_site_dir'); //changed the release_path temporary
before('deploy:symlink', 'change_to_original_release_dir');//changed back to orig release_path
The other solution was ugly. For each task I could cd into that custom dir. But that would mean i copy 9 or so default/defined task's code into my code just to add a cd command to the top of it. Lots of code just to change a directory for each task (and i would override and therefore not get any updates to those default tasks).

Not sure if a temporary solution like above can be setup (and if so, before/after which tasks?).
Or a more permanent solution where you can specify a custom variable for release_site_path where certain command/tasks cd into before doing their things.

[Feature Request] Rollback intelligence for migrations

Rolling back is a complicated process and it'd be sweeeeet if this package handled when to run database rollbacks. It'd require looking at the current/target releases to figure out how many/which migrations needed to be rolled back. This might be able to be accomplished by looking at the output of a diff between the releases? If it required a database connection, a Laravel package might be in order.

500 Error

image
As it is necessary to solve the problem?

/usr/bin/env: 'setfacl': No such file or directory

  1. cap production deploy

laravel version 5.5

then i get this error

INFO [a4194d81] Running /usr/bin/env setfacl -Rn -m u:root:rwX -m u:root:rwX /home/rubyCapistrano/appserve1/releases/20180602051920/sto
rage as [email protected]

DEBUG [a4194d81] Command: /usr/bin/env setfacl -Rn -m u:root:rwX -m u:root:rwX /home/rubyCapistrano/appserve1/releases/20180602051920/st
orage

DEBUG [a4194d81] /usr/bin/env: 'setfacl': No such file or directory

Trying to set permissions of app/storage in laravel 5

Tracing this down from a deploy task, the taskdeploy:set_permissions:check fails with the following message:

Cannot change permissions: .../releases/20170107092707/app/storage is not a file or directory

it's a laravel 5.3 project, so there is no app/storage directory. set :laravel_version, 5.3 is set, so i can't figure out why it's trying to use app/storage (which is a laravel 4 path) at all.

This is a fresh project, and a project-wide search of app/storage comes up with nothing - so i don't think it's accidentally overriding something.

any help would be appreciated! let me know what more information i can provide

acl paths and env file upload no longer working since upgrade

Hi,

I recently updated capistrano-laravel from 3.8.2 to 3.10.1

SSH and Git are working, but the env file uploading and acl paths are no longer working.
Found out about the env file issue because the app wont run because the env file is missing.
For the acl path I found out about it because the local storage path of the my app's latest release is not pointing to shared/storage/app but rather points to releases//storage/app

below is the content of my deployment settings to the staging (and production server), copied from this github page:
set :laravel_version, 5.4
set :laravel_roles, :all
set :laravel_migration_roles, :all
set :laravel_upload_dotenv_file_on_deploy, true
set :laravel_dotenv_file, '../envfiles/.env.production'
set :laravel_server_user, 'centos'

set :laravel_ensure_linked_dirs_exist, true
set :laravel_set_linked_dirs, true
set :laravel_5_linked_dirs, [
'storage'
]

set :laravel_set_acl_paths, true
set :laravel_ensure_acl_paths_exist, true
set :laravel_5_acl_paths, [
'bootstrap/cache',
'storage',
'storage/fonts',
'storage/app',
'storage/app/public',
'storage/framework',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/views',
'storage/logs'
]

Why is migrations commented out?

The migration task is commented out and not up to date. I currently have:

namespace :deploy do
  task :migrate do
    invoke 'laravel:artisan', 'migrate'
  end
end

should it be updated with the code above?

Folders not being created...

Hello, for some reason I'm seeing this error now when I deploy:

public_html/stage/domain.com/releases/20161216201859/bootstrap/cache/services.php)): failed to open stream: No such file or directory

capistrano/laravel isn't checking to see if those directories exist. Here's my deploy.rb

# Laravel Stuff
set :laravel_roles, :all
set :laravel_version, 5.2
set :laravel_5_acl_paths, [
  'bootstrap/cache',
  'storage',
  'storage/app',
  'storage/app/public',
  'storage/framework',
  'storage/framework/cache',
  'storage/framework/sessions',
  'storage/framework/views',
  'storage/logs'
]
set :laravel_ensure_acl_paths_exist, true

I didnt have set :laravel_5_acl_paths or set :laravel_ensure_acl_paths_exist in there before because it was default, but I added it just to be sure and still failing.

Thank you for writing this!

How to use

Hi,
First, thanks for this Laravel Capistrano plugin.

I'm sure everyone has previous and extend knowledge on Capistrano so that they don't need any additional explanation on how to use this, but as I'm not really savy in Ruby I would appreciate a little bit more on guiding how to use it.
If anyone respond here I can make a pull request with the detailed information for the README file.

Here a few things I think would be great for those on Laravel that are new to Capistrano/Ruby:

  • Where do we put the configuration variables?
  • How do we tell Capistrano to actually run the Capistrano Laravel command? Like, what actually triggers all the Laravel setup.
  • Should we previously have to create the database in the server?

Maybe, it would be great and easy to have an /example directory where you put a basic setup so we can look at it and understand.

Thanks for the great job.

Need tests

This project desperately is in need of tests. As I'm not a Ruby developer by trade, I'm unfamiliar with the proper way to write tests for a Capistrano plugin. At the same time, I feel that Capistrano v3 has a serious lack of documentation in regards to plugin development. If anyone has some information about how to write tests for a Capistrano plugin, please feel free to weigh in on this issue.

Why is .env uploaded instead of linked from shared?

Usually in Capistrano database config and similar are stored in shared and then symlinked using the linked_files directive.
Why in capistrano-laravel .env is uploaded? In this way every developer that access deploys must have a copy of the production .env file.

Composer install takes a long time

Hi

I'm having an issue with the following command:

composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader

00:08 composer:run
01 composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader
01 Generating optimized class loader
✔ 01 **@server.com 132.247s

The command takes up to 2 minutes, when I run the command directly on the server it only takes a few seconds. Is this a problem within the package or do you suspect something else to be in the way here?

Possibility of `laravel_dotenv_file` override

.env file is not meant to be stored in VCS and in my case is declared as capistrano linked file. So skipping of upload_dotenv_file is needed for laravel_dotenv_file empty value.

README wrong title

The title of this project is about file permissions, perhaps this is a mistake and it should talk about deployment?

Permission errors due to directories not existing

I'm deploying a laravel app and using this gem, everything seems fine until it tries to set permissions on the various storage directories. These don't exist in our repo so it throws errors.

I've tried doing set :file_permissions_paths, [] which fixes the problem during deployment, but then there is an issue where laravel just throws a white screen back at me when trying to load a page.

This has to do with the storage directories not having the correct permissions. I am guessing laravel generates these directories if it cannot find them, but does so with the wrong permissions.

Is there anything I can do to fix this, aside from putting these directories in my repo with an empty .gitignore file?

Capistrano::FileNotFound: Cannot change permissions on app/storage

I've run into this problem but I don't know if it's me or a bug. Everything is fine until the point Capistrano tries to change the permissions on app/storage in the releases directory and I think it's because that file hasn't been created by the time it tries changing the permissions.

Here's the end of the log since the message is raised:

ERROR Cannot change permissions: /var/www/Eximius-in-Laravel/releases/20151210144348/app/storage is not a file or directory
cap aborted!
Capistrano::FileNotFound: Cannot change permissions: /var/www/Eximius-in-Laravel/releases/20151210144348/app/storage is not a file or directory
/Users/alexander/.rvm/gems/ruby-2.2.2/gems/capistrano-file-permissions-0.1.1/lib/capistrano/tasks/file-permissions.rake:25:in `block (5 levels) in <top (required)>'
/Users/alexander/.rvm/gems/ruby-2.2.2/gems/capistrano-file-permissions-0.1.1/lib/capistrano/tasks/file-permissions.rake:21:in `each'
/Users/alexander/.rvm/gems/ruby-2.2.2/gems/capistrano-file-permissions-0.1.1/lib/capistrano/tasks/file-permissions.rake:21:in `block (4 levels) in <top (required)>'
/Users/alexander/.rvm/gems/ruby-2.2.2/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `instance_exec'
/Users/alexander/.rvm/gems/ruby-2.2.2/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `run'
/Users/alexander/.rvm/gems/ruby-2.2.2/gems/sshkit-1.8.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => deploy:set_permissions:acl => deploy:set_permissions:check
The deploy has failed with an error: Cannot change permissions: /var/www/Eximius-in-Laravel/releases/20151210144348/app/storage is not a file or directory
** Invoke deploy:failed (first_time)
** Execute deploy:failed

Any idea as to what I can do to stop this or why this is happening?

Can't find task after :updating

Below is the contents of lib/capistrano/tasks/load_seeds.rake.
If I change the 'after :updating' line to 'before :updating', the task is executed at the proper time. If run as shown, it generates "Task: load_seeds not found". See the dump below task listing.

Sure would like to know what the problem is. Thanks!
Capistrano Version: 3.11.2 (Rake Version: 12.3.3)

namespace :deploy do
  namespace :check do
    desc "Execute rake db:seed"
    after :updating, :load_seeds do
      on roles(:app), in: :sequence do
        puts "\n=== Seeding Database ===\n"
#     execute :rake, 'db:seed'
      end
    end
  end
end
cap aborted!
ArgumentError: Task :load_seeds not found
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/lib/capistrano/dsl/task_enhancements.rb:15:in `block in after'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/airbrussh-1.4.0/lib/airbrussh/rake/context.rb:61:in `execute'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/lib/capistrano/dsl.rb:26:in `invoke'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/lib/capistrano/tasks/framework.rake:64:in `block (2 levels) in <top (required)>'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/lib/capistrano/tasks/framework.rake:63:in `each'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/lib/capistrano/tasks/framework.rake:63:in `block in <top (required)>'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/airbrussh-1.4.0/lib/airbrussh/rake/context.rb:61:in `execute'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/lib/capistrano/application.rb:14:in `run'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/capistrano-3.11.2/bin/cap:3:in `<top (required)>'
/Users/sjf/.rbenv/versions/2.6.2/bin/cap:23:in `load'
/Users/sjf/.rbenv/versions/2.6.2/bin/cap:23:in `<top (required)>'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:463:in `exec'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:18:in `start'
/Users/sjf/.rbenv/versions/2.6.2/bin/bundle:30:in `block in <main>'
/Users/sjf/.rbenv/versions/2.6.2/lib/ruby/site_ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/Users/sjf/.rbenv/versions/2.6.2/bin/bundle:22:in `<main>'
Tasks: TOP => deploy:updating
The deploy has failed with an error: Task :load_seeds not found
** Invoke deploy:failed (first_time)
** Execute deploy:failed


Task not found?

I'm sure this is a stupid question... but any idea why this is throwing a The deploy has failed with an error: Task "laravel:artisan[:artisan_task]" not found?

set :artisan_task, 'view:clear'
after 'composer:run', 'laravel:artisan[:artisan_task]'

removing a task

hi -

anyone know how to disable the laravel:upload_dotenv_file step? I've tried a few things inside the deploy.rb file with no luck.

it would be nice to be able to disable this so the .env file can persist between deploys to different environments.

Deploy issue with Capistrano 3.8

I have the following Gems installed

Using rake 12.0.0
Using net-ssh 4.1.0
Using i18n 0.8.1
Using bundler 1.13.6
Using net-scp 1.2.1
Using sshkit 1.13.0
Using airbrussh 1.1.2
Using capistrano 3.8.0
Using capistrano-composer 0.0.6
Using capistrano-file-permissions 1.0.0
Using capistrano-laravel 1.2.1

I have the following in my Capfile

require "capistrano/setup"
require "capistrano/deploy"
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
require "capistrano/laravel"
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

when I run

cap staging deploy --trace

I get

cap aborted!
ThreadError: current thread not owner
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/monitor.rb:246:in `mon_check_owner'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/monitor.rb:195:in `mon_exit'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:143:in `ensure in require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:143:in `require'
/Users/patricklock/Sites/ClickNaomi/Capfile:37:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/Library/Ruby/Gems/2.0.0/gems/capistrano-3.8.0/lib/capistrano/application.rb:14:in `run'
/Library/Ruby/Gems/2.0.0/gems/capistrano-3.8.0/bin/cap:3:in `<top (required)>'
/usr/local/bin/cap:23:in `load'
/usr/local/bin/cap:23:in `<main>'

Capfile:37:in<top (required)> refers to the line require "capistrano/laravel"

If I remove

require "capistrano/laravel"

from my Capfile I don't have this problem

Unable to run deploys with the latest version

Not great at reading ruby but it seems something is amiss with version 0.0.3.

After running bundle install and fetching the 0.0.3 version of this, my cap builds have stopped with the error:

(Backtrace restricted to imported tasks)
cap aborted!
SystemStackError: stack level too deep

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

Upon adding --trace, the process freezes up and must be killed.

I have traced the issue back to this package, and even with a default cap file, the tasks will not load. In fact upon trying to run a bundle exec cap install in a completely empty folder, it fails until I remove or downgrade this package to 0.0.2

Laravel 6 LTS support

Please update package to Laravel current LTS version support which is 6 at the moment. For example delete artisan optimize command as it was deleted

seed_db task is missing

The README lists a laravel:seed_db task, but it doesn't actually exist.

Easy to work around with the laravel:artisan command, but worth noting all the same.

Add support for Lumen deploys

The current task list has some artisan commands that don't apply to Lumen and will cause the deploy to fail. If we add a new flag that marks a project as Laravel or Lumen, we can add checks to skip tasks specific to Laravel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.