Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto updater #141

Open
TIBTHINK opened this issue Dec 13, 2021 · 2 comments
Open

Auto updater #141

TIBTHINK opened this issue Dec 13, 2021 · 2 comments

Comments

@TIBTHINK
Copy link

for an auto-updater to work you have two options on how to approach this

  1. have the plugin pull the source code from git and compile it on server startup.
  2. (easier option in the long run)
    compile the plugin and then release it on Github or Jenkins
    for GitHub, I suggest making a JSON file with the latest release and then having it download the latest version.
    for Jenkins, I believe it will compile your latest push and then auto release the jar
@TIBTHINK
Copy link
Author

i was able to make a python script that does just that, using GitHub's API to find and update new releases

pwd = os.getcwd()
class plugins():
    def github_downloader(url, name, sub=1):
        dynmap_response = requests.get(url)
        data = dynmap_response.json()
        spigot_number = len(data[1]['assets'])
        download_link = print(data[1]['assets'][spigot_number - sub]['browser_download_url'])
        open(pwd + "/plugins/" + name, 'wb').write(requests.get(download_link).content)
    



plugins.github_downloader("https://api.github.com/repos/webbukkit/dynmap/releases", "Dynmap.jar")
plugins.github_downloader("https://api.github.com/repos/PryPurity/WorldBorder/releases", "WorldBorder.jar")
plugins.github_downloader("https://api.github.com/repos/EssentialsX/Essentials/releases", "EssentialsX.jar", 8 )

@mfnalex
Copy link
Owner

mfnalex commented Dec 18, 2021

But doesn't that require to also have maven, JDK etc installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants