Jenkins in Tamil 35 How to use resource files shared library | Jenkins for Beginners with Eng Sub
Aug 16, 2023
Jenkins in Tamil 35 How to use resource files shared library | Jenkins for Beginners with Eng Sub
#jenkins_in_tamil #jenkins #jenkins_pipeline #jenkins_resource_library #devops #tamiltutera Jenkins in Tamil 35 How to use resource files shared library from jenkins | Jenkins for Beginners with English Subtitle • Jenkins in Tamil 35 How to use resour… Source code link: https://github.com/tamiltutera/jenkin … Join this channel to get access to perks: / @tamiltutera Site: https://tamiltutera.com linkedIn: https://www.linkedin.com/in/tamiltutera/ Telegram Link: https://t.me/tamiltutera Youtube Channel: / tamiltutera Blog: https://tamiltutera.blogspot.com/ Like Facebook Page : https://www.facebook.com/tamiltutera Follow us on Twitter: https://twitter.com/tamiltutera Blog : https://tamiltutera.blogspot.com Jenkins in Tamil 34 How to create own custom share libraries | Jenkins for Beginners Tamil | DevOps • Jenkins in Tamil 34 How to create own… Jenkins in Tamil 33 How to execute Jenkins steps in parallel | Jenkins for Beginners Tamil | DevOps • Jenkins in Tamil 33 How to execute Je… Jenkins in Tamil 32 how to schedule the job in jenkins | Jenkins for Beginners Tamil | DevOps • Jenkins in Tamil 32 how to schedule t… Jenkins in Tamil 31 How to manually trigger job using REST API | Jenkins for Beginners Tamil • Jenkins in Tamil 31 How to manually t… Jenkins in Tamil 30 What is difference between freestyle and pipeline | Jenkins for Beginners Tamil • Jenkins in Tamil 30 What is differenc… Jenkins in Tamil 29 How to skip default checkout in pipeline script | Jenkins for Beginners Tamil • Jenkins in Tamil 29 How to skip defau… Jenkins-in-Tamil-28-How-to-pass-variables-between-stages-in-pipeline • Jenkins in Tamil 28 How to pass varia… Jenkins in Tamil 26 How to send slack notifications with jenkins | Jenkins for Beginners Tamil • Jenkins in Tamil 26 How to send slack… Jenkins in Tamil 25 How to use docker compose with jenkins in Tamil | Jenkins for Beginners Tamil • Jenkins in Tamil 25 How to use docker… Jenkins in Tamil 24 How to integrate ansible with jenkins | Jenkins for Beginners Tamil • Jenkins in Tamil 24 How to integrate … Jenkins in Tamil 23 How to deploy docker images using jenkins in Tamil | Jenkins for Beginners Tamil • Jenkins in Tamil 23 How to deploy doc… Jenkins in Tamil 22 How to trigger powershell with params using pipeline • Jenkins in Tamil 22 How to trigger po… Jenkins in Tamil 21 How to Trigger ansible playbook using jenkins | CI_CD | Iaac | DevOps in Tamil • Jenkins in Tamil 21 How to Trigger an…
Content
0.667 -> Hi guys welcome to Tamil Tutera
2 -> Today we are going to see how to use resource files from a Jenkins
7.25 -> shared library
8 -> In previous videos, we have seen how to create a shared library
12 -> I mean, if you use a vars folder in a shared library
18 -> You can create a custom step in your pipeline script
22 -> In that video, we are going to see how to use resource folder
26.931 -> in a shared library, when to use it, how to add it in a custom
32.621 -> step
33 -> So, without any further delay, let's get into the demo
44 -> This is my dashboard
46 -> I am going to create a new pipeline
50 -> I am going to create a new pipeline script
54 -> I am going to name it as test-resource-shared-library
62 -> I am going to create a new pipeline script
66 -> I am going to save the file as a hello world
71 -> So, I have created the pipeline script
74 -> Now, we are going to create a new repository
78 -> I am going to create a new repository
82 -> I am going to create a new repository
84 -> Jenkins-resource-library
86 -> This is my repository for Jenkins-resource-library
93 -> I have created it
95 -> I am going to create a new folder
100 -> Jenkins-resource-library
104 -> I am going to add a git file
111 -> I am going to add a git file
113 -> You know what I am creating
117 -> I am going to copy and paste the file
125 -> Next, I am going to add the git file
132 -> Add git file
134 -> Next, git commit
136 -> Next, git branch
144 -> Next, git remote add
149 -> You are linking the git remote to the git branch
158 -> Next, git push
162 -> You are giving your username and password
173 -> This is my password
178 -> Git code has been committed
182 -> Now, we are going to create a new folder
192 -> Make directory-vars
196 -> Make directory-resources
199 -> Make directory-src
202 -> Create the directory-vars
212 -> Hello world.groovy
240 -> Sorry, I am using the wrong directory
247 -> Hello world.external.groovy
254 -> I am going to this folder
258 -> Def call, I am using map
270 -> I am going to configure the mapping
300 -> I am going to configure the mapping
328 -> I am going to configure the mapping
338 -> I am going to configure the mapping
365 -> I am going to configure the mapping
385 -> I am going to configure the mapping
395 -> I am going to configure the mapping
405 -> I am going to configure the mapping
415 -> I am going to configure the mapping
425 -> I am going to configure the mapping
447 -> I am going to configure the mapping
457 -> I am going to configure the mapping
467 -> I am going to configure the mapping
477 -> I am going to configure the mapping
487 -> I am going to configure the mapping
507 -> I am going to configure the mapping
527 -> I am going to configure the mapping
547 -> I am going to configure the mapping
567 -> I am going to configure the mapping
587 -> I am going to configure the mapping
600 -> you have to execute that file
602 -> so this is how to include the library resource step
607 -> so you need two input for library resource
611 -> one is resource and the other is relative path
613 -> so you have to give the relative path in the resource folder
617 -> encoding is optional
618 -> so you can give base64 or utf-8 encoding
622 -> so for now it is optional
624 -> so you need the relative path
628 -> so I am going to give the relative path
631 -> so how to give it
633 -> so this is how you can give it
636 -> com.tamil2tara.scripts.linux
639 -> and then the config.name
641 -> so this config.name is
643 -> for this custom step I am going to pass the parameter as.name
650 -> so this is how we are going to access it
652 -> so config.name
653 -> so what we are going to do is
654 -> I am going to give the write file
655 -> so I am going to write the script in the remote machine
662 -> to execute it there
664 -> I am going to create it
666 -> so this is config.name
668 -> so com.text is script content
674 -> so I am going to pass the script content to that file
678 -> so we need to give permission to this file
681 -> because this is executable
682 -> so we need to give permission to this
684 -> so a plus x
686 -> so I am going to execute the command in that file
692 -> so I am going to change it to executable file
694 -> so you would have understood
696 -> what you are going to create the file
698 -> you need to include the resource file in another step
702 -> so you need to use the library resource
704 -> you need to give the relative path
706 -> and then what you are going to do with the script content
708 -> you are going to read it and write it in an external file
711 -> so you need to give permission to the external file
716 -> so you are giving permission to the user
718 -> so it will automatically come
720 -> so the user group will use that file
725 -> so what we are going to see next is
728 -> we are going to see the gengain side
731 -> so what we are going to do in gengain side is
733 -> so we need to configure that file
736 -> so go to manage gengains
738 -> configure system
745 -> so drop down all the files
749 -> so all the files are in the file you have saved
751 -> so leave all the files
753 -> so we have already created the file
769 -> so we are going to create a new one
771 -> so I am going to create a custom shared library
776 -> so you are going to use the library name
779 -> so the main version is going to come
784 -> so copy and paste the github path
794 -> so we have copied and pasted the gengain resource library
802 -> so the latest version commit code is there
814 -> so now the github and gengains are connected
816 -> so the custom shared library
821 -> sorry not custom shared library
823 -> so custom resource library
825 -> so you can import the custom resource library in your pipeline
832 -> so now we have created the library
834 -> so now we are going to push all the code inside the library
846 -> so before pushing the code
848 -> there are some changes in the allow hold external
851 -> so we are going to see that
853 -> so next we are going to do is
855 -> vi hello hold external
861 -> so now I am going to load the linux script
869 -> so I am going to show you how to load it
872 -> so you can call the step directly
881 -> so I am going to give the script name
885 -> so the name is hello world dot sh
892 -> so the command sh dot hello is executed
898 -> so I am going to remove the old one
902 -> so sh hello world dot sh
912 -> so you can give the config name
916 -> config dot month of the year
934 -> so now we have created this
947 -> I have to close the set base
954 -> so now we have created the google script
957 -> so now what we are going to do next is
959 -> we have configured it
964 -> so now we are going to use it
966 -> so before that you have to give the git add
968 -> so git commit
971 -> so add necessary files
979 -> so now we are giving git push
984 -> so now you are pushing the code in master repository
993 -> so now we have pushed the code
1009 -> so now we have refreshed the repository
1015 -> so now we have all the code
1018 -> so now we don't need the source
1021 -> so now we are going to create the source
1026 -> so now we are going to create the source
1034 -> so now we are going to create the source
1059 -> so now we have created the source
1064 -> so now you have to give the git commit
1070 -> so now I am giving the source file
1088 -> so now we have configured the git
1097 -> so now we are going to show you how to import the code in pipeline
1104.5 -> script
1105 -> so before that you have to give the git config
1112 -> so now we are going to import the code
1122 -> so now we are going to import the code in resource library
1142 -> so now we are going to import the code in resource library
1154 -> so now we are going to import the code in resource library
1170 -> so now we are going to import the code in resource library
1185 -> so now we are going to import the code in resource library
1200 -> so, ok custom resource library
1205 -> we are going to create a command, you have to give the same name
1209 -> so, ok, so, custom star library
1228 -> ok, so we are going to use that star library
1266 -> We have two files in the warehouse
1272 -> Hello world script and load inline script
1274 -> You can keep the file you are generating
1278 -> It depends on your requirements
1280 -> Next is the hello world external script
1285 -> I am going to load the custom script and execute a command
1289 -> In the resources, there is a hello world.sh file
1297 -> The first part is the hello world.sh
1301 -> The second part is the month of the year
1308 -> I have set both of them
1311 -> Now we are going to configure
1342 -> I am a failure
1344 -> I am going to check the script
1347 -> It will keep on asking for approval
1351 -> You can give it
1363 -> Go to manage and gains
1365 -> Go to global security global
1368 -> Manage and gains
1398 -> Go to script approval
1423 -> Next time it will not ask for approval
1428 -> Go to inscript process and give approval
1432 -> It will automatically import the script
1436 -> I am going to run it again
1438 -> It is loading
1452 -> It is loading
1456 -> It is loading
1464 -> Let's see what it is
1478 -> It is loading
1485 -> Let's try a single execution
1488 -> I have not closed it
1491 -> Let's execute it again
1494 -> Build now
1499 -> It is successfully executed
1510 -> Let's see the output
1512 -> It is loading
1526 -> If you like this video, please like, comment and subscribe
1529 -> Don't forget to click the bell button
[Powered By Dubverse]
Source: https://www.youtube.com/watch?v=WbOfzveyrso