Updated 062 Add your own JCB packages to the JCB Communty Directory (markdown)

Amigo 2019-09-27 09:35:35 +02:00
parent c07b6aef16
commit 632068ee30

@ -57,47 +57,47 @@ The explanation is simple, if you want to have people have the key from you, whe
[00:12:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m35s)
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 be found but on this page where you compiled it.[00:13:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m02s) Store the key in a safe place, or use it in your video and give it to the people at the right time, however you like.
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 be found but on this page where you compiled it. [00:13:02](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m02s) Store the key in a safe place, or use it in your video and give it to the people at the right time, however you like.
### 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 which we have cloned down to your local developing environment. I have the folder open where the package is. There is the following path which we looked at previously. We are going to drag and drop the file into the other folder where that cloned 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 and return to the terminal. <<<<<<<<<
The next step would be to move the package into the repository which we have cloned down to your local developing environment. I have the folder open where the package is. There is the following path which we looked at previously. We are going to drag and drop the file into the other folder where that cloned 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 and return 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.
Once in a terminal, you can say '`git status`', it will tell you that one file has not 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 does not 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 to add 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 comes 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.
What that script will do is very simple. It will 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. It adds it there. 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 is where that info comes from. It takes the information and it adds it to an array which then later gets written to the `checksum.json`. It is all it does. [00:15:55](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m55s) Some little Bash gets the information from the file for you without your having any issues, it follows convention.
I am going to go run the file. 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 should not take long and if it did, then something is wrong.
### 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 has a comma. But this is the new line that has been added. Add your component to the checksum.json. [00:17:15](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m15s) 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.
If you again do the '`git status`', you will 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 will see that your component, the one that you are adding, is being added. That line was changed because it has a comma. But this is the new line that has been added. Add your component to the `checksum.json`. [00:17:15](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m15s) That is all that should change. You should not change any other files in the repository. Only the ones that you are contributing are the ones that you must change.
### git Add The Files - Comment - git commit am"Added Questions And Answers Packages
[00:17:30](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m30s)
The next thing is to git add those files. Do git status, the words are now green. The comment, there's a lot of convention out there, I'm not keyed up with all of that. We can do [00:17:53](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m53s) 'git commit am"Added questions and answers package'. That's simple enough and then press enter. The m is for the message in the a is for pushing it all into the branch. If you have a passphrase [00:18:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m21s) which you should have, then 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. Especially since we need to be sure that it is you that is making the commit.
The next thing is to `git add` those files. Do `git status`, the words are now green. The comment, there is a lot of convention out there, I'm not keyed up with all of that. We can do [00:17:53](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m53s) '`git commit am"Added questions and answers package`'. That's simple enough and then press enter. The `m` is for the message in the `a` is for pushing it all into the branch. If you have a passphrase [00:18:21](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m21s) which you should have, then you have your commit signed. If you do not 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. Especially since we need to be sure that it is you that is making the commit.
### When All Is Done - git push To Your Repository On Github
[00:18:46](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m46s)
Now when you've done all that you do 'git' and you will push it up to your repository on GitHub. At this point, you are still not affecting the community repository. It is just affecting the repository that you forked. This is a very secure way of dealing with this. If we now go back to GitHub [00:19:11](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m11s) were we fetch the page, you will see that it'll say this branch is one commit ahead of VDM. There is make a Pull Request. You will make a Pull Request and it will take you to the main repository and will explain to you which one is being pulled where and it will tell you that it is able to be merged. The information is being added for the info [00:19:40](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m40s) for the sha. and for the package which doesn't show because it's too big. You will see the Binary file not shown. There are also changes to the checksum.json.
Now when you have done all that you do 'git' and you will push it up to your repository on GitHub. At this point, you are still not affecting the community repository. It is just affecting the repository that you forked. This is a very secure way of dealing with this. If we now go back to GitHub [00:19:11](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m11s) were we fetch the page, you will see that it will say this branch is one commit ahead of VDM. There is make a Pull Request. You will make a Pull Request and it will take you to the main repository and will explain to you which one is being pulled where and it will tell you that it is able to be merged. The information is being added for the info [00:19:40](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m40s) for the sha. and for the package which does not show because it is too big. You will see the Binary file not shown. There are also changes to the 'checksum.json'.
### Create A Pull Request
[00:19:54](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m54s)
Now at this point, you will need to create a pull request. Click on Create Pull Request. The comment that you made in your repository when you contributed the package, would be added as the title. If you want to give a little explanation of things that the admin team needs to consider because we have to test this. We can't add packages to the community packets branch without being able to test it. If you have a key for the package, we will create a form [00:20:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m35s) where you will be able to submit that. We'll put that in the information because at the moment this area doesn't even have a pull request template. We will add a pull request template when you create a pull request, it will tell you where to send the key. At the moment if there's no pull request, keep the packages that are coming that are free at the moment. As soon as the templates are in place then you can use it and then make a pull request. At the moment I'm the only one that [00:21:07](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m07s) manage this. I hope that others would get involved. There are some other developers involved in the JCB Repository, but I would like to also encourage them to get involved and be able to help me test these packages, make sure that only valid and stable packages get added. [00:21:30](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m30s) Click Create pull request. I don't want to pull this into the repository at the stage. I'm going to do it later. This is the procedure that you need to follow to 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 been merged into the master branch, it will also become available on this page automatically. Automatically it'll show up in the dropdown. That is as simple as it is. If you have any questions please open an issue at the correct place. If you want to talk about the packages for the community, open the 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 a clear separation between these two concepts.
Now at this point, you will need to create a pull request. Click on Create Pull Request. The comment that you made in your repository when you contributed the package, would be added as the title. If you want to give a little explanation of things that the admin team needs to consider because we have to test this. We can't add packages to the community packets branch without being able to test it. If you have a key for the package, we will create a form [00:20:35](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m35s) where you will be able to submit that. We will put that in the information because at the moment this area does not even have a pull request template. We will add a pull request template when you create a pull request, it will tell you where to send the key. At the moment if there is no pull request, keep the packages that are coming that are free at the moment. As soon as the templates are in place then you can use it and then make a pull request. At the moment I am the only one that [00:21:07](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m07s) manage this. I hope that others would get involved. There are some other developers involved in the JCB Repository, but I would like to also encourage them to get involved and be able to help me test these packages, make sure that only valid and stable packages get added. [00:21:30](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m30s) Click Create pull request. I do not want to pull this into the repository at the stage. I am going to do it later. This is the procedure that you need to follow to get a package into the community packages because once it has been merged into the master branch, it will also become available on this page automatically. It will automatically show up in the dropdown. That is as simple as it is. If you have any questions please open an issue at the correct place. If you want to talk about the packages for the community, open the issue here. [00:22:27](https://www.youtube.com/watch?v=8FplwKKa708&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m27s) Please do not make open issues at JCBs repository regarding this issue, so that we will have a clear separation between these two concepts.