From fe8301b9cc1f11becc5e5833ff1ec86d15a11d94 Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Fri, 20 Sep 2019 14:28:59 +0200 Subject: [PATCH] Updated 062 Add your own JCB packages to the JCB Communty Directory (markdown) --- ...-packages-to-the-JCB-Communty-Directory.md | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/062-Add-your-own-JCB-packages-to-the-JCB-Communty-Directory.md b/062-Add-your-own-JCB-packages-to-the-JCB-Communty-Directory.md index 75c798a..59c1748 100644 --- a/062-Add-your-own-JCB-packages-to-the-JCB-Communty-Directory.md +++ b/062-Add-your-own-JCB-packages-to-the-JCB-Communty-Directory.md @@ -48,9 +48,37 @@ I'm not exactly sure how all this is going to workout. I am very open to all of [00:10:03](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m03s) -Let us go to the component. Those of you who want to maybe give away the component, but you want to have people first visit a video that you've made, the way you could do this is, at this Buy Link, you'll make that link [00:10:23](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m23s) direct to your video. When they click on the Buy Link, they will go to the video where you are going to give them the key for free. They can watch the video, get the key come back and open the package. We're not currently implementing Package Link. The Package Link should be where the package is. Which most of the time will be the repository. [00:10:45](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m45s) Which is why we not fully implementing this because we don't need it. We left it for future purposes. At the moment we don't need it the way we've set up things. You can use the repo URL. It is only the Buy link that's really important. If it's not a free package or if it's a free package, but you're giving the key away. +Let us go to the component. Those of you who want to maybe give away the component, but you want to have people first visit a video that you've made, the way you could do this is, at this Buy Link, you'll make that link [00:10:23](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m23s) direct to your video. When they click on the Buy Link, they will go to the video where you are going to give them the key for free. They can watch the video, get the key come back and open the package. We're not currently implementing Package Link. The Package Link should be where the package is. Which most of the time will be the repository. [00:10:45](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m45s) Which is why we not fully implementing this because we don't need it. We left it for future purposes. At the moment we don't need it the way we've set up things. You can use the repo URL. It is only the Buy link that's really important. If it's not a free package or if it's a free package, but you're giving the key away. The other idea is not to add a key at all. If you don't add a key, then it will be a free package. [00:11:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m21s) This is how you make something a free package, it's leaving the key out. That's simple as that. Where as if you leave the key in, people will have to get the key from you. If you've a contributor to the community, you'll need to share the key with the admin of the repository. [00:11:43](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m43s) They can validate the component and check that it's safe for distribution. We'll still put some things in place, maybe a forum procedure on how to do this inside of JCB, or maybe just in the read more of the repository. We'll give you a heads up when that happens. +The explanation is simple, if you want to have people have the key from you, wherever they need to get it, whether it's free or paid, it needs to be this link. [00:12:15](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m15s) The Export key is what we used to build the key. You can put in anything here. Once you have all that in place, you will Export the JCB Package. +### Once Component Exported - The Package Is Available - In Temporal Directory -????? +[00:12:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m35s) -The other idea is not add a key at all. So If you don't add a key here Then it will be a free package. [00:11:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m21s) This is how you make something a free package. it's just Leaving the key out. That's simple as that. And Then it will be a free package Where as if you leave the key in then people will have to get the key from you And if you've got a contributor to the community Then you'll need to share the key with the admin of the repository [00:11:43](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m43s) So they can validate the component and check that it's safe for distribution We'll stop with some things in place maybe a forum Procedure on how to do this Inside of JCB or maybe just In the read more of the repository We'll give you a heads up when that happens For now the explanation is simple if you want to have people get the key from you Where ever they need to get it weather it's free or paid Needs to be this link here And [00:12:15](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m15s) The key This here is what we used to build the key it's not the actual key It's just used to build a key so you can put in anything here really Ok Now once you got all that in place You will compile your component Or export the JCB package really that's the right name once you got the component Exported Then the package is available [00:12:41](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m41s) in a specific Directory called "temporal directory" in your Developing environment And this is the package That you wanna add to the repository This is the key that you now need to give to everybody That wants to use the package So this key can nowhere to be found unless on this page [00:13:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m02s) where you compiled it store this key in a safe place Or use it in your video and give it to the people in the right playtime Whatever you like to to do this The Next Step would be to now move this package into The Repository which we cloned down to your local developing environment Here I got the folder open where the package is so you see there Is following that path which we found [00:13:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m35s) When we look at this it's same path So basically we gonna just drag And drop The file into the other folder which is where that Clone repository is at the moment In my home folder So here we have The package been added And We basically done [00:13:56](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m56s) And we can close this one out And go back to the terminal Once in a terminal if you say get Status You see that it tells you that is one file That isn't been tracked Now before you add the file You first need to run The hash.sha [00:14:20](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m20s) ... program Which is a bash little script So you need bash to run it and a few other two other programs actually I'm pretty sure you that It's this JQ and sha1sum These two programs is also required And that the script will actually shout at you that if it doesn't exist will say hey , you need to get these [00:14:48](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m48s) So if you You can just Google JQ Bash Install and it will Give you information And adding these two programs to your Developing environment And then run that script What that script will do [00:15:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m02s) is very simple it'll go through the files in the repository that are zip files that's what it does here it will create a sum And then will place the sum In a file with the same name except Added the sha to the file name So there it adds it Then it will get a shop file name and then unzip The file to get the info. [00:15:28](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m28s) VDM file from the zip package Then change that to the shop filename Which should be the same as your package name just with info as the prerogative Which is what we need to show the people what your package name is and who owns it and these things So that's where that info come from Then it takes that information and It adds it to an array Which Then later gets written to the checksum.json That's all this does [00:15:55](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m55s) Nothing Not not no not smart really it's just straight forward Some Little Bash Do to get the information from the file For you without your having any issues And that it Just follow convention So I'm gonna go run the file now and you can see what it does So basically you add the the Dot here make sure in the repository then the Dot And then [00:16:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m21s) The hash.sh And enter and it should just do that simple as that Shouldn't take long and if it did Then something is wrong This is all it should do Now if you again do the git status You'll see that now there are actually 3 files That of not be tracked and tricks some file Has been modified And why because there is now a new line been added [00:16:49](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m49s) To check some so if we do Git diff You'll see that your component the one that you are adding This one Is being added And so that line was changed because it got a comma But this is the new line that it is added So basically just added your component To the check some [00:17:15](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m15s) And that is all that should change You shouldn't change any other files In the repository Only the ones that you are contributing Are the ones that you must change Ok so There we go The next thing is to git Add Those files [00:17:34](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m34s) So if you do git Status They are now green now the comment The comment I think We there's like Convention out there I'm not so keyed up all that So the moment I think we can do Git [00:17:53](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m53s) Then Add it Questions and answers package I think that's simple enough And then Press enter Oops I left out something and it's to commit word So she say git commit Then a m The m is for the message in the a is for pushing it all into the branch So there we go and then you have if you have a pass phrase [00:18:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m21s) and you Which I should actually have Then there you have your commit signed If you don't know how to sign commits in git then please Google that and get your keys in place We would expect that all commits to this repo Be signed Specially since we need to be sure That it is you That am you know making the commit Now when you've done all that you do git [00:18:49](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m49s) And your push it up To your repository on GitHub At this point you are still not affecting the community repository It is just affecting The the repository that you forked And That is This is a very secure way of dealing with this So if we now go back to Git Hub [00:19:11](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m11s) And you know were fetch the page You see that I'll say this branch is one commit ahead of VDM And then there is this make a pull request So you make a pull request there And it will basically take you To the main repository And all explain to you which one is being pulled where and it will tell you that it is able to be merged And Did this is the information that's being added For the info [00:19:40](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m40s) For the sha And obviously for the package which it doesn't show because it's too big So you see Binary file not shown there it is And so there is also the changes to the checksum Now at this point You need to Create a pull request to click on create pull request And This [00:20:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m02s) Comment that you made in your repository when you you know Contributed the package would usually be added as the title You wanna give a little explanation of things that we as the admin team need to have dissipate Because we got obviously have to test this now We can't add packages to the community packets branch without being able to test it So if you have a key for the package Then Yes I think we will create a form Eventually [00:20:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m35s) Where you will be able to submit that And we'll put that in the information because at the moment this area doesn't even have a pull request template So we will add a pull request template So that when you create a pull request that tells you where to send the key Set the moment if there's a pull request maybe just keep the packages coming that are free at the moment as soon as the templates in place then then you can use it And then make a pull request And Then I'm at the moment the only one that [00:21:07](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m07s) Manage this but I hope that others would get involved There are some other developers already Quite involved on the JCB Repository But I would like to also encourage them to get involved here And be able to sort of help me Test these packages Make sure that only valid in Stable packages gets Added [00:21:30](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m30s) And so That's really it here you now click create pull request now I'm gonna do this Because it's all premature I I want to I don't wanna pull this into this The repository at the stage I'm gonna do so later But the point is This is the procedure that you need to follow To actually get a package into the community packages [00:21:58](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m58s) Because once it's get merged into the master branch It will also become available on this page Automatically So automatically it'll show up in this dropdown In fact That is a simple as it is Well thanks for watching and if you have any questions please open a issue At the correct place So if you wanna talk about the packages for the community Open issue here [00:22:27](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m27s) Please don't make a open issues at JCBs repository regarding this issue So that we'll have you know clear Separation Between these two concepts. Ok thanks for watching. +Once you have the component exported, the package is available in a specific directory called "temporal directory" in your developing environment. The package that you want to add to the repository, this 'JCB_QuestionsAnswers.zip' is the key that you now need to give to everybody that wants to use the package. The key can nowhere to be found unless on this page [00:13:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m02s) where you compiled it. Store the key in a safe place, or use it in your video and give it to the people in the right playtime, whatever you like to to do. + +### Next Step - Move Package Into Repository Which We Cloned Down + +[00:13:16](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m16s) + +The next step would be to move the package into the repository we cloned down to your local developing environment. I have the folder open where the package is. You will see there is the following path which we found when we look at its same path. We are going to drag and drop the file into the other folder which is where that clone repository is at the moment, in my home folder. The package has been added and we are done. [00:13:56](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m56s) We can close this one out. Go back to the terminal. + +### In Terminal - git status - Run hash.sh Program Which Is A Bash Script + +[00:14:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m02s) + +Once in a terminal, you can say 'git status', it will tell you that one file isn't been tracked. Before you add the file, you will first need to run the hash.sh program which is a Bash little script. You will need Bash to run two other programs. It's this 'jq' and 'sha1sum'. These two programs are required and the script will shout at you if it doesn't exist. [00:14:48](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m48s) You can Google JQ Bash Install and it will give you information adding these two programs to your developing environment, and run that script. + +### What Does The Bash Script Do? + +[00:15:01](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m01s) + +What that script will do is very simple. It'll go through the files in the repository that are zip files, it will create a sum, and will place the sum in a file with the same name, except the sh added to the file name. There it adds it. It will get a shopFileName and then unzip the file to get the [00:15:28](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m28s) info.vdm file from the zip package. Then change that to the shopFileName which should be the same as your package name, with info as the prerogative. Which is what we need to show the people what your package name is, and who owns it and these things. That's where that info come from. It takes the information and it adds it to an array. Which then later gets written to the checksum.json. It's all it does. [00:15:55](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m55s) Nothing smart, it's straight forward. Some little Bash gets the information from the file for you without your having any issues, it follows convention. +I'm going to go run the file and you can see what it does. You add the dot, make sure you are in the repository, [00:16:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m21s) ./hash.sh and enter. It should do that, as simple as that. It shouldn't take long and if it did, then something is wrong. This is all it should do. + +### Again - git status - checksum.json - git diff + +[00:16:33](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m33s) + +???? +If you again do the 'git status', you'll see that there are 3 files that are not been tracked, and the checksum.json file has been modified. Why? because there is a new line been added to checksum.json. If we type in 'git diff', you'll see that your component, the one that you are adding, is being added. That line was changed because it have a comma. But this is the new line that has been added. So basically just added your component To the check some [00:17:15](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m15s) And that is all that should change You shouldn't change any other files In the repository Only the ones that you are contributing Are the ones that you must change Ok so There we go The next thing is to git Add Those files [00:17:34](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m34s) So if you do git Status They are now green now the comment The comment I think We there's like Convention out there I'm not so keyed up all that So the moment I think we can do Git [00:17:53](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m53s) Then Add it Questions and answers package I think that's simple enough And then Press enter Oops I left out something and it's to commit word So she say git commit Then a m The m is for the message in the a is for pushing it all into the branch So there we go and then you have if you have a pass phrase [00:18:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m21s) and you Which I should actually have Then there you have your commit signed If you don't know how to sign commits in git then please Google that and get your keys in place We would expect that all commits to this repo Be signed Specially since we need to be sure That it is you That am you know making the commit Now when you've done all that you do git [00:18:49](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m49s) And your push it up To your repository on GitHub At this point you are still not affecting the community repository It is just affecting The the repository that you forked And That is This is a very secure way of dealing with this So if we now go back to Git Hub [00:19:11](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m11s) And you know were fetch the page You see that I'll say this branch is one commit ahead of VDM And then there is this make a pull request So you make a pull request there And it will basically take you To the main repository And all explain to you which one is being pulled where and it will tell you that it is able to be merged And Did this is the information that's being added For the info [00:19:40](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m40s) For the sha And obviously for the package which it doesn't show because it's too big So you see Binary file not shown there it is And so there is also the changes to the checksum Now at this point You need to Create a pull request to click on create pull request And This [00:20:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m02s) Comment that you made in your repository when you you know Contributed the package would usually be added as the title You wanna give a little explanation of things that we as the admin team need to have dissipate Because we got obviously have to test this now We can't add packages to the community packets branch without being able to test it So if you have a key for the package Then Yes I think we will create a form Eventually [00:20:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m35s) Where you will be able to submit that And we'll put that in the information because at the moment this area doesn't even have a pull request template So we will add a pull request template So that when you create a pull request that tells you where to send the key Set the moment if there's a pull request maybe just keep the packages coming that are free at the moment as soon as the templates in place then then you can use it And then make a pull request And Then I'm at the moment the only one that [00:21:07](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m07s) Manage this but I hope that others would get involved There are some other developers already Quite involved on the JCB Repository But I would like to also encourage them to get involved here And be able to sort of help me Test these packages Make sure that only valid in Stable packages gets Added [00:21:30](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m30s) And so That's really it here you now click create pull request now I'm gonna do this Because it's all premature I I want to I don't wanna pull this into this The repository at the stage I'm gonna do so later But the point is This is the procedure that you need to follow To actually get a package into the community packages [00:21:58](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m58s) Because once it's get merged into the master branch It will also become available on this page Automatically So automatically it'll show up in this dropdown In fact That is a simple as it is Well thanks for watching and if you have any questions please open a issue At the correct place So if you wanna talk about the packages for the community Open issue here [00:22:27](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m27s) Please don't make a open issues at JCBs repository regarding this issue So that we'll have you know clear Separation Between these two concepts. Ok thanks for watching.