Right way to make deploy to production











up vote
0
down vote

favorite












Symfony documentation says to keep /public/build folder in .gitignore



So when I'm pushing my files, there no build folder on production, so I need to build assets.



But documentation also says that assets need to build on the dev server.



So, I need your advice about the right way to deploy.



1) Push build folder with git?



2) Install yarn, nodeJs on production and deploy after git pull?



Thank you.










share|improve this question




























    up vote
    0
    down vote

    favorite












    Symfony documentation says to keep /public/build folder in .gitignore



    So when I'm pushing my files, there no build folder on production, so I need to build assets.



    But documentation also says that assets need to build on the dev server.



    So, I need your advice about the right way to deploy.



    1) Push build folder with git?



    2) Install yarn, nodeJs on production and deploy after git pull?



    Thank you.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Symfony documentation says to keep /public/build folder in .gitignore



      So when I'm pushing my files, there no build folder on production, so I need to build assets.



      But documentation also says that assets need to build on the dev server.



      So, I need your advice about the right way to deploy.



      1) Push build folder with git?



      2) Install yarn, nodeJs on production and deploy after git pull?



      Thank you.










      share|improve this question















      Symfony documentation says to keep /public/build folder in .gitignore



      So when I'm pushing my files, there no build folder on production, so I need to build assets.



      But documentation also says that assets need to build on the dev server.



      So, I need your advice about the right way to deploy.



      1) Push build folder with git?



      2) Install yarn, nodeJs on production and deploy after git pull?



      Thank you.







      git symfony deployment






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 at 21:52

























      asked Nov 12 at 21:38









      Adil

      316




      316
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote













          The second. The 1st one always seemed weird to me, I generally never want to push build files to git, the same way I don't push my vendor dir.



          Other than the weirdness, you have dev and prod config for encore too, so you will have to pay attention to olny push prod compilations. (example: source maps)



          Another problem is asset versioning (https://symfony.com/doc/current/frontend/encore/versioning.html). Since the file names are changing, you will generate unnecessary elements to the change log. If you are working with a team, this might also generate git conflicts.






          share|improve this answer






























            up vote
            1
            down vote













            There are 3 ways to do this. (Symfony recommends those.)



            1-) You should have a build server. In addition, you could send builded files with scp or tools are which help to move files. (For big and complex projects.)



            2-) You could build for production on your development machine and you are supposed to move builded files.



            3-) You could install npm or yarn on production machine. But personaly it's unnecessary. This option is the last thing that recommended.



            For now, i prefer second option. You are supposed to watch this video :)



            https://symfonycasts.com/screencast/webpack-encore/production-build






            share|improve this answer




























              up vote
              0
              down vote













              I will build files locally and deploy by Ansible.
              Thank you all.






              share|improve this answer





















                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                 

                draft saved


                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53270472%2fright-way-to-make-deploy-to-production%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                1
                down vote













                The second. The 1st one always seemed weird to me, I generally never want to push build files to git, the same way I don't push my vendor dir.



                Other than the weirdness, you have dev and prod config for encore too, so you will have to pay attention to olny push prod compilations. (example: source maps)



                Another problem is asset versioning (https://symfony.com/doc/current/frontend/encore/versioning.html). Since the file names are changing, you will generate unnecessary elements to the change log. If you are working with a team, this might also generate git conflicts.






                share|improve this answer



























                  up vote
                  1
                  down vote













                  The second. The 1st one always seemed weird to me, I generally never want to push build files to git, the same way I don't push my vendor dir.



                  Other than the weirdness, you have dev and prod config for encore too, so you will have to pay attention to olny push prod compilations. (example: source maps)



                  Another problem is asset versioning (https://symfony.com/doc/current/frontend/encore/versioning.html). Since the file names are changing, you will generate unnecessary elements to the change log. If you are working with a team, this might also generate git conflicts.






                  share|improve this answer

























                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    The second. The 1st one always seemed weird to me, I generally never want to push build files to git, the same way I don't push my vendor dir.



                    Other than the weirdness, you have dev and prod config for encore too, so you will have to pay attention to olny push prod compilations. (example: source maps)



                    Another problem is asset versioning (https://symfony.com/doc/current/frontend/encore/versioning.html). Since the file names are changing, you will generate unnecessary elements to the change log. If you are working with a team, this might also generate git conflicts.






                    share|improve this answer














                    The second. The 1st one always seemed weird to me, I generally never want to push build files to git, the same way I don't push my vendor dir.



                    Other than the weirdness, you have dev and prod config for encore too, so you will have to pay attention to olny push prod compilations. (example: source maps)



                    Another problem is asset versioning (https://symfony.com/doc/current/frontend/encore/versioning.html). Since the file names are changing, you will generate unnecessary elements to the change log. If you are working with a team, this might also generate git conflicts.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 13 at 0:27

























                    answered Nov 13 at 0:22









                    Padam87

                    87957




                    87957
























                        up vote
                        1
                        down vote













                        There are 3 ways to do this. (Symfony recommends those.)



                        1-) You should have a build server. In addition, you could send builded files with scp or tools are which help to move files. (For big and complex projects.)



                        2-) You could build for production on your development machine and you are supposed to move builded files.



                        3-) You could install npm or yarn on production machine. But personaly it's unnecessary. This option is the last thing that recommended.



                        For now, i prefer second option. You are supposed to watch this video :)



                        https://symfonycasts.com/screencast/webpack-encore/production-build






                        share|improve this answer

























                          up vote
                          1
                          down vote













                          There are 3 ways to do this. (Symfony recommends those.)



                          1-) You should have a build server. In addition, you could send builded files with scp or tools are which help to move files. (For big and complex projects.)



                          2-) You could build for production on your development machine and you are supposed to move builded files.



                          3-) You could install npm or yarn on production machine. But personaly it's unnecessary. This option is the last thing that recommended.



                          For now, i prefer second option. You are supposed to watch this video :)



                          https://symfonycasts.com/screencast/webpack-encore/production-build






                          share|improve this answer























                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            There are 3 ways to do this. (Symfony recommends those.)



                            1-) You should have a build server. In addition, you could send builded files with scp or tools are which help to move files. (For big and complex projects.)



                            2-) You could build for production on your development machine and you are supposed to move builded files.



                            3-) You could install npm or yarn on production machine. But personaly it's unnecessary. This option is the last thing that recommended.



                            For now, i prefer second option. You are supposed to watch this video :)



                            https://symfonycasts.com/screencast/webpack-encore/production-build






                            share|improve this answer












                            There are 3 ways to do this. (Symfony recommends those.)



                            1-) You should have a build server. In addition, you could send builded files with scp or tools are which help to move files. (For big and complex projects.)



                            2-) You could build for production on your development machine and you are supposed to move builded files.



                            3-) You could install npm or yarn on production machine. But personaly it's unnecessary. This option is the last thing that recommended.



                            For now, i prefer second option. You are supposed to watch this video :)



                            https://symfonycasts.com/screencast/webpack-encore/production-build







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 13 at 13:09









                            Mert Simsek

                            806311




                            806311






















                                up vote
                                0
                                down vote













                                I will build files locally and deploy by Ansible.
                                Thank you all.






                                share|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  I will build files locally and deploy by Ansible.
                                  Thank you all.






                                  share|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    I will build files locally and deploy by Ansible.
                                    Thank you all.






                                    share|improve this answer












                                    I will build files locally and deploy by Ansible.
                                    Thank you all.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 13 at 14:04









                                    Adil

                                    316




                                    316






























                                         

                                        draft saved


                                        draft discarded



















































                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53270472%2fright-way-to-make-deploy-to-production%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                                        How to change which sound is reproduced for terminal bell?

                                        Can I use Tabulator js library in my java Spring + Thymeleaf project?