Need to push jenkins log files to Amazon S3 bucket












0















I would like to move jenkins logs to s3 bucket.
Can some one suggest how to move the log files.
Need to move console logs from aws instance.
Should I need to write script or the plugin is enough to push log files.
For every last 5 jobs it should move the files to s3.
Based on date, time, build number.










share|improve this question





























    0















    I would like to move jenkins logs to s3 bucket.
    Can some one suggest how to move the log files.
    Need to move console logs from aws instance.
    Should I need to write script or the plugin is enough to push log files.
    For every last 5 jobs it should move the files to s3.
    Based on date, time, build number.










    share|improve this question



























      0












      0








      0








      I would like to move jenkins logs to s3 bucket.
      Can some one suggest how to move the log files.
      Need to move console logs from aws instance.
      Should I need to write script or the plugin is enough to push log files.
      For every last 5 jobs it should move the files to s3.
      Based on date, time, build number.










      share|improve this question
















      I would like to move jenkins logs to s3 bucket.
      Can some one suggest how to move the log files.
      Need to move console logs from aws instance.
      Should I need to write script or the plugin is enough to push log files.
      For every last 5 jobs it should move the files to s3.
      Based on date, time, build number.







      linux shell jenkins amazon-s3 amazon-ec2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 21:50









      K.Dᴀᴠɪs

      7,250112439




      7,250112439










      asked Nov 21 '18 at 15:44









      Sandeep muthyapuSandeep muthyapu

      63




      63
























          3 Answers
          3






          active

          oldest

          votes


















          0














          I suggest to you Script instead of mounting If mounting is not working due to any reason you jobs will start failing Using python script you can directly upload the logs to s3. It will be easier & reliable






          share|improve this answer
























          • can you please share the script @anmol Nagpal

            – Sandeep muthyapu
            Nov 22 '18 at 2:16











          • I'm sorry I don't have a script. But let me try if I can get something for you

            – AnmolNagpal
            Nov 22 '18 at 10:43











          • Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

            – AnmolNagpal
            Nov 22 '18 at 10:44



















          0














          You can create S3 bucket and mount it to EC2 instance. Detailed information about how to do that you can find HERE.
          Once you mounted S3 bucket to your instance you need to say Jenkins that you want to store logs in that mount






          share|improve this answer

































            0














            You first need to determine if your Jenkins server has access to S3 Bucket (as it's unclear in your question)



            I am assuming that Jenkins server can access your S3 Bucket (the setup would generally involve the following steps):




            • Your Jenkins instance is running on EC2 server and can access S3 either by


              • Using a pre-configured role attached to EC2 instance

              • Accessing S3 Programmatically



            • S3 bucket is correctly configured (Permissions, Policies)


            Once the setup is in place, you can use aws-cli to upload files into S3



            S3 CLI Reference



            Feel free to use Bash/Python/or any other language to wrote the script.






            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%2f53415693%2fneed-to-push-jenkins-log-files-to-amazon-s3-bucket%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









              0














              I suggest to you Script instead of mounting If mounting is not working due to any reason you jobs will start failing Using python script you can directly upload the logs to s3. It will be easier & reliable






              share|improve this answer
























              • can you please share the script @anmol Nagpal

                – Sandeep muthyapu
                Nov 22 '18 at 2:16











              • I'm sorry I don't have a script. But let me try if I can get something for you

                – AnmolNagpal
                Nov 22 '18 at 10:43











              • Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

                – AnmolNagpal
                Nov 22 '18 at 10:44
















              0














              I suggest to you Script instead of mounting If mounting is not working due to any reason you jobs will start failing Using python script you can directly upload the logs to s3. It will be easier & reliable






              share|improve this answer
























              • can you please share the script @anmol Nagpal

                – Sandeep muthyapu
                Nov 22 '18 at 2:16











              • I'm sorry I don't have a script. But let me try if I can get something for you

                – AnmolNagpal
                Nov 22 '18 at 10:43











              • Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

                – AnmolNagpal
                Nov 22 '18 at 10:44














              0












              0








              0







              I suggest to you Script instead of mounting If mounting is not working due to any reason you jobs will start failing Using python script you can directly upload the logs to s3. It will be easier & reliable






              share|improve this answer













              I suggest to you Script instead of mounting If mounting is not working due to any reason you jobs will start failing Using python script you can directly upload the logs to s3. It will be easier & reliable







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 21 '18 at 22:43









              AnmolNagpalAnmolNagpal

              1337




              1337













              • can you please share the script @anmol Nagpal

                – Sandeep muthyapu
                Nov 22 '18 at 2:16











              • I'm sorry I don't have a script. But let me try if I can get something for you

                – AnmolNagpal
                Nov 22 '18 at 10:43











              • Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

                – AnmolNagpal
                Nov 22 '18 at 10:44



















              • can you please share the script @anmol Nagpal

                – Sandeep muthyapu
                Nov 22 '18 at 2:16











              • I'm sorry I don't have a script. But let me try if I can get something for you

                – AnmolNagpal
                Nov 22 '18 at 10:43











              • Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

                – AnmolNagpal
                Nov 22 '18 at 10:44

















              can you please share the script @anmol Nagpal

              – Sandeep muthyapu
              Nov 22 '18 at 2:16





              can you please share the script @anmol Nagpal

              – Sandeep muthyapu
              Nov 22 '18 at 2:16













              I'm sorry I don't have a script. But let me try if I can get something for you

              – AnmolNagpal
              Nov 22 '18 at 10:43





              I'm sorry I don't have a script. But let me try if I can get something for you

              – AnmolNagpal
              Nov 22 '18 at 10:43













              Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

              – AnmolNagpal
              Nov 22 '18 at 10:44





              Check this one might help github.com/vangheem/sync-ftp-to-s3/blob/master/…

              – AnmolNagpal
              Nov 22 '18 at 10:44













              0














              You can create S3 bucket and mount it to EC2 instance. Detailed information about how to do that you can find HERE.
              Once you mounted S3 bucket to your instance you need to say Jenkins that you want to store logs in that mount






              share|improve this answer






























                0














                You can create S3 bucket and mount it to EC2 instance. Detailed information about how to do that you can find HERE.
                Once you mounted S3 bucket to your instance you need to say Jenkins that you want to store logs in that mount






                share|improve this answer




























                  0












                  0








                  0







                  You can create S3 bucket and mount it to EC2 instance. Detailed information about how to do that you can find HERE.
                  Once you mounted S3 bucket to your instance you need to say Jenkins that you want to store logs in that mount






                  share|improve this answer















                  You can create S3 bucket and mount it to EC2 instance. Detailed information about how to do that you can find HERE.
                  Once you mounted S3 bucket to your instance you need to say Jenkins that you want to store logs in that mount







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 22 '18 at 10:09

























                  answered Nov 21 '18 at 15:54









                  Roman BanakhRoman Banakh

                  345




                  345























                      0














                      You first need to determine if your Jenkins server has access to S3 Bucket (as it's unclear in your question)



                      I am assuming that Jenkins server can access your S3 Bucket (the setup would generally involve the following steps):




                      • Your Jenkins instance is running on EC2 server and can access S3 either by


                        • Using a pre-configured role attached to EC2 instance

                        • Accessing S3 Programmatically



                      • S3 bucket is correctly configured (Permissions, Policies)


                      Once the setup is in place, you can use aws-cli to upload files into S3



                      S3 CLI Reference



                      Feel free to use Bash/Python/or any other language to wrote the script.






                      share|improve this answer




























                        0














                        You first need to determine if your Jenkins server has access to S3 Bucket (as it's unclear in your question)



                        I am assuming that Jenkins server can access your S3 Bucket (the setup would generally involve the following steps):




                        • Your Jenkins instance is running on EC2 server and can access S3 either by


                          • Using a pre-configured role attached to EC2 instance

                          • Accessing S3 Programmatically



                        • S3 bucket is correctly configured (Permissions, Policies)


                        Once the setup is in place, you can use aws-cli to upload files into S3



                        S3 CLI Reference



                        Feel free to use Bash/Python/or any other language to wrote the script.






                        share|improve this answer


























                          0












                          0








                          0







                          You first need to determine if your Jenkins server has access to S3 Bucket (as it's unclear in your question)



                          I am assuming that Jenkins server can access your S3 Bucket (the setup would generally involve the following steps):




                          • Your Jenkins instance is running on EC2 server and can access S3 either by


                            • Using a pre-configured role attached to EC2 instance

                            • Accessing S3 Programmatically



                          • S3 bucket is correctly configured (Permissions, Policies)


                          Once the setup is in place, you can use aws-cli to upload files into S3



                          S3 CLI Reference



                          Feel free to use Bash/Python/or any other language to wrote the script.






                          share|improve this answer













                          You first need to determine if your Jenkins server has access to S3 Bucket (as it's unclear in your question)



                          I am assuming that Jenkins server can access your S3 Bucket (the setup would generally involve the following steps):




                          • Your Jenkins instance is running on EC2 server and can access S3 either by


                            • Using a pre-configured role attached to EC2 instance

                            • Accessing S3 Programmatically



                          • S3 bucket is correctly configured (Permissions, Policies)


                          Once the setup is in place, you can use aws-cli to upload files into S3



                          S3 CLI Reference



                          Feel free to use Bash/Python/or any other language to wrote the script.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 22 '18 at 10:44









                          ArpitArpit

                          5,57553164




                          5,57553164






























                              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%2f53415693%2fneed-to-push-jenkins-log-files-to-amazon-s3-bucket%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

                              WPF add header to Image with URL pettitions [duplicate]