Giter VIP home page Giter VIP logo

Comments (4)

tedslittlerobot avatar tedslittlerobot commented on July 18, 2024

You can set arbitrary commands to run at certain points in the deployment process.

In your config/deploy.rb file:

namespace :deploy do

  after :updated, :migrate do
    on roles(:all) do
      within release_path do
        execute :php, :artisan, :migrate, fetch(:laravel_artisan_flags), '--force'
      end
    end
  end

end

from laravel.

louisl avatar louisl commented on July 18, 2024

Thanks for the info.

from laravel.

tedslittlerobot avatar tedslittlerobot commented on July 18, 2024

was in a rush the other day, but to give a bit more information around what this solution does:

in the following snippet:

after :updated, :migrate do
  • you can call after or before
  • :updated is the name of the event you want to run this task relative to
  • :migrate is the new name of this event that you are defining

So you could then have:

before :migrate, :sometask do
  # something to run before migrations ...
end

Pretty much the only two events i've ever used are:

  • after :updated - once the code is on the server, and the basic tasks have been done, but before the new release is live
  • after :published - once the new release has been symlinked to be the current release

The default capistrano hooks are here - https://capistranorb.com/documentation/getting-started/flow/ if you want more. This capistrano/laravel package has its own event hooks too (the ones starting with laravel: in https://github.com/capistrano/laravel#tasks)

from laravel.

louisl avatar louisl commented on July 18, 2024

Thank you for the additional info, that's given me a better understanding of it.

from laravel.

Related Issues (20)

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.