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

Duplicate executions #12

Closed
kingcrunch opened this issue Apr 17, 2014 · 3 comments
Closed

Duplicate executions #12

kingcrunch opened this issue Apr 17, 2014 · 3 comments
Assignees

Comments

@kingcrunch
Copy link

Some tasks do stuff, that is already (usually) covered by composer scripthandlers and shouldn't run by default.

See also: https://github.com/symfony/symfony-standard/blob/master/composer.json

  • cache warm up

    {
        "scripts": {
            "post-install-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache"
            ],
            "post-update-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache"
            ]
        },
        "extra": {
            "symfony-cache-warmup": "true"
        }
    }
    

    in composer.json

  • built-bootstrap

    {
        "scripts": {
            "post-install-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
            ],
            "post-update-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
            ]
        }
    }
    
  • install assets

    {
        "scripts": {
            "post-install-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
            ],
            "post-update-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
            ]
        }
    }
    

I am not entirely sure, if it's useful to drop them at completely (they are not too complicated to write in ones Capfile, or deploy.rb themself), but at least it should be possible to avoid them.

Update: After I played around with different scenarios, I must admit, that it looks more useful to remove the corresponding script handlers from the dependency resolver (composer), but let the deployment tool (capistrano) do the job

@peterjmit
Copy link
Contributor

This is related to #1

I feel like it makes it easier to manage if the deployment tool handle the steps that the app needs to be ready, rather than the dependency resolver (this is why we have a build_bootstrap task, and composer is run with --no-scripts)

@kingcrunch
Copy link
Author

@peterjmit I partly agree. I see, that it is better to let the deployment tool handle the mentioned stuff. However, you cannot assure, that not other tasks are handled via composers script handlers, so --no-scripts is actually not a good idea (and btw: composer doesn't use the --no-scripts-flag anymore).

So I for myself removed most script handlers except the ParameterHandlers-handler and I am fine with it (except, that it doesn't generate the assets, see #10 😉 ). So at the end it is somehow up to you if you give users the possibility. Or of course you can await a PR about that 😄

@peterjmit peterjmit self-assigned this Apr 20, 2014
@blaugueux
Copy link
Contributor

@kingcrunch now #17 have been merged you can close this issue :)

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