How to upload to FTP from Travis CI












2















I need to upload all the files in the Travis root directory to an FTP server after my build steps are completed. Travis CI's documentation for custom deployment suggests using curl to send the files. Unfortunately curl FTP upload doesn't support globing, which makes a large amount of files practically impossible.



How can I make sure my whole directory, including all files and subdirs, are uploaded to FTP?



Is there an elegant way to do this or is it better to rely on tools like grunt for uploading to FTP?










share|improve this question





























    2















    I need to upload all the files in the Travis root directory to an FTP server after my build steps are completed. Travis CI's documentation for custom deployment suggests using curl to send the files. Unfortunately curl FTP upload doesn't support globing, which makes a large amount of files practically impossible.



    How can I make sure my whole directory, including all files and subdirs, are uploaded to FTP?



    Is there an elegant way to do this or is it better to rely on tools like grunt for uploading to FTP?










    share|improve this question



























      2












      2








      2


      2






      I need to upload all the files in the Travis root directory to an FTP server after my build steps are completed. Travis CI's documentation for custom deployment suggests using curl to send the files. Unfortunately curl FTP upload doesn't support globing, which makes a large amount of files practically impossible.



      How can I make sure my whole directory, including all files and subdirs, are uploaded to FTP?



      Is there an elegant way to do this or is it better to rely on tools like grunt for uploading to FTP?










      share|improve this question
















      I need to upload all the files in the Travis root directory to an FTP server after my build steps are completed. Travis CI's documentation for custom deployment suggests using curl to send the files. Unfortunately curl FTP upload doesn't support globing, which makes a large amount of files practically impossible.



      How can I make sure my whole directory, including all files and subdirs, are uploaded to FTP?



      Is there an elegant way to do this or is it better to rely on tools like grunt for uploading to FTP?







      curl ftp gruntjs travis-ci






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 19 '17 at 7:52









      Steven M. Vascellaro

      5,48794090




      5,48794090










      asked Oct 27 '14 at 14:11









      stephanlindauerstephanlindauer

      522517




      522517
























          3 Answers
          3






          active

          oldest

          votes


















          2














          The Travis doc says only that you should do this kind of stuffs in the after_success: section. The specified command is just an example.



          So, do what you want from your computer, then put the sequence of commands that you used in the after_success: section.



          In your case, creating an archive (with tar) and then uploading it (with curl or directly with ftp) should work, if I correctly understood your needs.






          share|improve this answer
























          • @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

            – Guillaume Pascal
            Nov 4 '14 at 17:23











          • thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

            – stephanlindauer
            Nov 7 '14 at 11:33



















          0














          Sometimes the below link will help. Its about FTP deployment in node_js app.



          Travis build with nodejs en custom ftp






          share|improve this answer

































            0















            1. Use the find command to add everything except for specific folders.

            2. Add the environment variables SFTP_USER and SFTP_PASSWORD in the Settings menu.


            This is my yml:



            language: node_js
            after_success:
            - find . -type d ( -path "./.*" -o -path "./node_modules" ) -prune -o -name "*" -print -exec curl --ftp-create-dirs -T {} ftp://your.server.com/dir/ --user ${SFTP_USER}:${SFTP_PASSWORD} ;





            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',
              autoActivateHeartbeat: false,
              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%2f26589441%2fhow-to-upload-to-ftp-from-travis-ci%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









              2














              The Travis doc says only that you should do this kind of stuffs in the after_success: section. The specified command is just an example.



              So, do what you want from your computer, then put the sequence of commands that you used in the after_success: section.



              In your case, creating an archive (with tar) and then uploading it (with curl or directly with ftp) should work, if I correctly understood your needs.






              share|improve this answer
























              • @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

                – Guillaume Pascal
                Nov 4 '14 at 17:23











              • thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

                – stephanlindauer
                Nov 7 '14 at 11:33
















              2














              The Travis doc says only that you should do this kind of stuffs in the after_success: section. The specified command is just an example.



              So, do what you want from your computer, then put the sequence of commands that you used in the after_success: section.



              In your case, creating an archive (with tar) and then uploading it (with curl or directly with ftp) should work, if I correctly understood your needs.






              share|improve this answer
























              • @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

                – Guillaume Pascal
                Nov 4 '14 at 17:23











              • thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

                – stephanlindauer
                Nov 7 '14 at 11:33














              2












              2








              2







              The Travis doc says only that you should do this kind of stuffs in the after_success: section. The specified command is just an example.



              So, do what you want from your computer, then put the sequence of commands that you used in the after_success: section.



              In your case, creating an archive (with tar) and then uploading it (with curl or directly with ftp) should work, if I correctly understood your needs.






              share|improve this answer













              The Travis doc says only that you should do this kind of stuffs in the after_success: section. The specified command is just an example.



              So, do what you want from your computer, then put the sequence of commands that you used in the after_success: section.



              In your case, creating an archive (with tar) and then uploading it (with curl or directly with ftp) should work, if I correctly understood your needs.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Oct 30 '14 at 17:01









              Guillaume PascalGuillaume Pascal

              7321817




              7321817













              • @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

                – Guillaume Pascal
                Nov 4 '14 at 17:23











              • thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

                – stephanlindauer
                Nov 7 '14 at 11:33



















              • @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

                – Guillaume Pascal
                Nov 4 '14 at 17:23











              • thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

                – stephanlindauer
                Nov 7 '14 at 11:33

















              @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

              – Guillaume Pascal
              Nov 4 '14 at 17:23





              @stephanlindauer : Please, let me know if my answer helped you, or if you need more help.

              – Guillaume Pascal
              Nov 4 '14 at 17:23













              thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

              – stephanlindauer
              Nov 7 '14 at 11:33





              thanks for your answer. what i actually need is a way of uploading multiple files. if i just upload a tar then have the problem of not being able to trigger uncompressing that tar from my build job. the way i do things now is to just use grunt to upload all files to my ftp server.

              – stephanlindauer
              Nov 7 '14 at 11:33













              0














              Sometimes the below link will help. Its about FTP deployment in node_js app.



              Travis build with nodejs en custom ftp






              share|improve this answer






























                0














                Sometimes the below link will help. Its about FTP deployment in node_js app.



                Travis build with nodejs en custom ftp






                share|improve this answer




























                  0












                  0








                  0







                  Sometimes the below link will help. Its about FTP deployment in node_js app.



                  Travis build with nodejs en custom ftp






                  share|improve this answer















                  Sometimes the below link will help. Its about FTP deployment in node_js app.



                  Travis build with nodejs en custom ftp







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 23 '17 at 12:18









                  Community

                  11




                  11










                  answered Nov 10 '15 at 16:57









                  Joy George KunjikkuruJoy George Kunjikkuru

                  1,2201224




                  1,2201224























                      0















                      1. Use the find command to add everything except for specific folders.

                      2. Add the environment variables SFTP_USER and SFTP_PASSWORD in the Settings menu.


                      This is my yml:



                      language: node_js
                      after_success:
                      - find . -type d ( -path "./.*" -o -path "./node_modules" ) -prune -o -name "*" -print -exec curl --ftp-create-dirs -T {} ftp://your.server.com/dir/ --user ${SFTP_USER}:${SFTP_PASSWORD} ;





                      share|improve this answer




























                        0















                        1. Use the find command to add everything except for specific folders.

                        2. Add the environment variables SFTP_USER and SFTP_PASSWORD in the Settings menu.


                        This is my yml:



                        language: node_js
                        after_success:
                        - find . -type d ( -path "./.*" -o -path "./node_modules" ) -prune -o -name "*" -print -exec curl --ftp-create-dirs -T {} ftp://your.server.com/dir/ --user ${SFTP_USER}:${SFTP_PASSWORD} ;





                        share|improve this answer


























                          0












                          0








                          0








                          1. Use the find command to add everything except for specific folders.

                          2. Add the environment variables SFTP_USER and SFTP_PASSWORD in the Settings menu.


                          This is my yml:



                          language: node_js
                          after_success:
                          - find . -type d ( -path "./.*" -o -path "./node_modules" ) -prune -o -name "*" -print -exec curl --ftp-create-dirs -T {} ftp://your.server.com/dir/ --user ${SFTP_USER}:${SFTP_PASSWORD} ;





                          share|improve this answer














                          1. Use the find command to add everything except for specific folders.

                          2. Add the environment variables SFTP_USER and SFTP_PASSWORD in the Settings menu.


                          This is my yml:



                          language: node_js
                          after_success:
                          - find . -type d ( -path "./.*" -o -path "./node_modules" ) -prune -o -name "*" -print -exec curl --ftp-create-dirs -T {} ftp://your.server.com/dir/ --user ${SFTP_USER}:${SFTP_PASSWORD} ;






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 22 '18 at 3:14









                          Kemal AhmedKemal Ahmed

                          527




                          527






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f26589441%2fhow-to-upload-to-ftp-from-travis-ci%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

                              android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                              SQL update select statement

                              'app-layout' is not a known element: how to share Component with different Modules