How to release / use plugins
#1
Exclamation 
Guide: How to release plugins and use them the right way

I want to show you a tutorial how you could add your plugins to your server easily (and how to update them), and how you should release your plugins, so they can be used easily.

First, image the situation if you have compiled. You have a Server/Plugins dir where many Plugins are in there, eg Core. as user, the easiest way to set up a new plugin is, if it is on github or similar (any system that uses git), to cd into the Plugins dir and do "git submodule add <git url here>". git will now download it and place it into the Plugins dir. The big advantage of this method is, that every time you run "git submodule update" git checks for new versions of plugins and installs them. Thats great, but now the better part. Every time you compile the server (with compile.sh) to update the server, the script also runs "git submodule update" and updates all Plugins, both shipped with Cuberite and those who you added later on.

So, this part for plugin devs.... Please place your plugins in a git repository (anywhere, just git, probably github) and let them contain only the directory to place in Plugins/. If you have more than one folder, eg the webadmin part, then place it in a seperate repository, so users can do a "git submodule" in Plugins/ and one in webadmin/files/.
Why? because git lets you only add submodules (and clone those) into an empty directory. So if you need both, a webadmin part and one in Plugins/, place it into two repositories, it's still free, and name it eg <my-cool-plugin>-webadmin and <my-cool-plugin>. Also please provide a short message that and why you did it, please refer to this post.

For those who did not understand what i mean, a short review of what you have to do.

Users:

first, cd in the Server/Plugins directory
Code:
[qraut@alkaid cuberite]$ cd Server/Plugins/

then modify the .gitignore and remove the last '*/' line

and now add your submodule

Example 1: PaintBall
Code:
[qraut@alkaid Plugins]$ git submodule add https://github.com/NiLSPACE/PaintBall.git
Cloning into 'Server/Plugins/PaintBall'...
remote: Counting objects: 113, done.
remote: Total 113 (delta 0), reused 0 (delta 0), pack-reused 113
Receiving objects: 100% (113/113), 26.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (70/70), done.
Checking connectivity... done.

Example 2: WorldEdit
Code:
[qraut@alkaid Plugins]$ git submodule add https://github.com/mc-server/WorldEdit.git
Cloning into 'Server/Plugins/WorldEdit'...
remote: Counting objects: 1581, done.
remote: Total 1581 (delta 0), reused 0 (delta 0), pack-reused 1581
Receiving objects: 100% (1581/1581), 476.91 KiB | 857.00 KiB/s, done.
Resolving deltas: 100% (1016/1016), done.
Checking connectivity... done.


and thats it. activate the plugin and you are fine!


Devs:

lets say, you have code, but not at eg github. first, make a git repo
Code:
[qraut@alkaid PaintBall]$ git init
Initialized empty Git repository in /home/qraut/PaintBall/.git/

then, add your files and commit
Code:
[qraut@alkaid PaintBall]$ git add -A
[qraut@alkaid PaintBall]$ git commit -m "initial commit, added git repo"
[master (root-commit) b704a6b] initial commit, added git repo
9 files changed, 1531 insertions(+)
create mode 100644 ArenaState.lua
create mode 100644 CMDHandlers.lua
create mode 100644 Config.lua
create mode 100644 Hooks.lua
create mode 100644 Info.lua
create mode 100644 Init.lua
create mode 100644 PlayerState.lua
create mode 100644 Storage.lua
create mode 100644 functions.lua

now add your github repo and push the code (like explained on the github page, if the repository is empty
Code:
[qraut@alkaid PaintBall]$ git remote add origin git@github.com:Schwertspize/PaintBall.git
[qraut@alkaid PaintBall]$ git push -u origin master
Counting objects: 11, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 9.98 KiB | 0 bytes/s, done.
Total 11 (delta 0), reused 0 (delta 0)
To git@github.com:Schwertspize/PaintBall.git
* [new branch]      master -> master
Branch master set up to track remote branch master from origin.

Done! users can now clone your code (or use it as submodule, as i explained). Now you should add a LICENCE and a README, after that add them and commit
Code:
[qraut@alkaid PaintBall]$ nano README.md
[qraut@alkaid PaintBall]$ nano LICENCE.md
[qraut@alkaid PaintBall]$ git add README.md LICENCE.md
[qraut@alkaid PaintBall]$ git commit -m "added licence and readme"
[master 4a3b88d] added licence and readme
2 files changed, 14 insertions(+)
create mode 100644 LICENCE.md
create mode 100644 README.md
[qraut@alkaid PaintBall]$ git push
Counting objects: 4, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 669 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
To git@github.com:Schwertspize/PaintBall.git
   b704a6b..4a3b88d  master -> master
remember, nano is a simple text editor.

Reply
Thanks given by: HeCorr


Messages In This Thread
How to release / use plugins - by Schwertspize - 10-27-2015, 09:40 PM
RE: How to release / use plugins - by xoft - 10-28-2015, 07:52 AM



Users browsing this thread: 1 Guest(s)