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

Fix assets installation in Symfony 3 #642

Merged
merged 2 commits into from
May 2, 2016
Merged

Conversation

peschee
Copy link

@peschee peschee commented May 1, 2016

Q A
Bug fix? Yes
New feature? No
BC breaks? No
Deprecations? No
Fixed tickets N/A

The assetic:dump command does not exist in Symfony 3. The assetic namespace has been replaced by assets. The new command to install assets is assets:install.

This PR overrides the deploy:assetic:dump command so it works in Symfony 3. Ideally, the deploy:assetic:dump command would be renamed to something like deploy:assets:install in the main deploy task. However, this would mean overriding the entire list of tasks.

Peter added 2 commits May 1, 2016 20:19
The `assetic:dump` command does not exist in Symfony 3. The `assetic` namespace has been replaced by `assets`. The new command to install assets is `assets:install`. 

This PR overrides the `deploy:assetic:dump` command so it works in Symfony 3. Ideally, the `deploy:assetic:dump` command would be renamed to something like `deploy:assets:install` in the main deploy task. However, this would mean overriding the entire list of tasks.
@antonmedv
Copy link
Member

Cool!

@antonmedv antonmedv merged commit fa0cc6a into deployphp:master May 2, 2016
@cmodijk
Copy link

cmodijk commented Jul 15, 2016

It does work >if< you install the assetic bundle. It's not default for symfony 2.8/3 any more but it's still something you can install and theassetic:dump works. The assetic is not replaced by assets and the assets:install you replaced it with is also available in symfony 2 but this is already run by default using post-install and post-update from the composer install command.

What we should do is set the set('dump_assets', false); inside the symfony3.php to disable assetic by default.

Taken from the documentation:

Starting from Symfony 2.8, Assetic is no longer included by default in the Symfony Standard Edition. Refer to this article to learn how to install and enable Assetic in your Symfony application.

@cmodijk
Copy link

cmodijk commented Jul 15, 2016

But i have an other problem with the override, If i try the following the deploy:dump-real task is never run. When i remove the override it works. I'm not sure why this happens with tasks which are replaced.

task('deploy:dump-real', function () {
    run('{{bin/php}} {{release_path}}/' . trim(get('bin_dir'), '/') . '/console assetic:dump --env={{env}} --no-debug');
});
after('deploy:assetic:dump', 'deploy:dump-real');

@oanhnn
Copy link
Contributor

oanhnn commented Jul 18, 2016

@cmodijk Thank you for the report, i created an issue, #720
About your problem, i think you should check running flow of tasks

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

Successfully merging this pull request may close these issues.

5 participants