amazon web services - Recipe to run on deployment and standalone -


I have a recipe ( migrate.rb ) that ran as part of our deployment Goes and works perfectly.

However one thing that I can not work out, how to set it up so that it can be run as a standalone recipe in the execute_recipe command.

As it stands, if we execute this recipe as a stand alone then nothing happens after the node [: deployment]. There is nothing near the loop on (deployment keys do not exist).

This only part based on the deployment node is the line cwd "# {deploy_to}} / current" because I need to know where the code was deployed is.

  node [: deployed] .each do | Application, Posted in | Execute 'DB Migrate if Seed' CWD # # [Deployment [: Deployment]] / Current "Command" PHP Worker Migration; While Reading-R Line || [-n "$ line"]; Do php Artisan DB: Seed - class = "$ line"; didn & lt; "ap / database / run.lit" 'end end    

I will move that part to a definition (or a provider) so basically divide your recipe into two halves:

Recipes / drink Regenerated. RB:

  node [: deployment] .EEEE | ​​application, posted | php_artisan_setup do dir "# {deploy [: deploy_to]} / current" end end   

Definitions / php_artisan_setup.rb:

  define: php_artisan_setup exec exec 'db migrates, then the seed' cwd paramat [: dior] command 'php karashion migrate; while reading -R line || [-n "$ line"]; Do php artisan db: seed - class = "$ line"; did & lt; "ap / database / runllist" 'end and end'   

In this way, you have your own standalone You can also call php_artisan_setup from the recipe ". You still need two dishes, but you do not have to duplicate the related part.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -