itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.26k stars 1.53k forks source link

Add Sponge.. #78

Closed jmiahman closed 6 years ago

jmiahman commented 8 years ago

You can add sponge as well, and maybe build it from git as bleeding right now is 1.9. If you need help on how to build it, let me know.

itzg commented 8 years ago

I'm not that familiar with Sponge. Do you prefer the SpongeForge or SpongeVanilla variant?

jmiahman commented 8 years ago

Spongevanilla would be the easiest

On Thu, May 12, 2016, 5:59 PM Geoff Bourne notifications@github.com wrote:

I'm not that familiar with Sponge. Do you prefer the SpongeForge or SpongeVanilla variant?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/itzg/dockerfiles/issues/78#issuecomment-218926511

jmiahman commented 8 years ago

Just to let you know, Sponge.. though slow going.. Is a new API for minecraft plugins. A lot of developers from Bukkit, when the big blowup happened left, merged with a few other projects and created Sponge. It's a fairly nice community to work with and though it's still in it's BETA phase, has many useful plugins already offered. When Bukkit was still a thing I first tried Spigot and didn't care for their community, so when Bukkit died and Spigot took over in a sense.. Sponge was there and was a compelling alternative.

itzg commented 8 years ago

That's cool. Thanks for the background.

I didn't get a chance to work on this over the weekend. Speaking of which, you're welcome to contribute the changes to add support.

itzg commented 8 years ago

...ok, the build is gradle based, so the remaining trickiness is mapping versions, picking the latest, etc. For the prebuilt 1.8.9 and below, we'll need to see if their site exposes a REST API to resolve versions to download URLs.

jmiahman commented 8 years ago

Here's the script I run to download the latest "bleeding" versions that's TypeId=2 (1.9) in the URL and the stable 1.8.9 is TypeId=1, I guess really you don;t have to build it. I was for a bit when they weren't doing bleeding builds for 1.9. Now we can just grab the jar.

#!/usr/bin/env bash
wget https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/?buildTypeId=2 -O sponge_page

latest_sponge=$(grep -m1 "btn btn-default" ./sponge_page |cut -d'"' -f4)
wget "$latest_sponge" -O latest_sponge.jar
itzg commented 8 years ago

I finally got around to this...and then found their sites aren't cooperating right now

image

jmiahman commented 8 years ago

Sorry about that

https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/?buildTypeId=2

Should work now.

On Sat, May 28, 2016, 6:29 PM Geoff Bourne notifications@github.com wrote:

I finally got around to this...and then found their sites aren't cooperating right now

[image: image] https://cloud.githubusercontent.com/assets/988985/15630880/e797faf2-2512-11e6-87ed-8bb853976794.png

— You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub https://github.com/itzg/dockerfiles/issues/78#issuecomment-222337579, or mute the thread https://github.com/notifications/unsubscribe/AAbY8hixUWN5N7BAufCBOV6903Jjl3pMks5qGOwQgaJpZM4IdhfN .

itzg commented 8 years ago

Yep, now their servers are good :)

itzg commented 8 years ago

Some notes:

https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/?buildTypeId=:buildType&startAt=:startAt

Each artifact version string is text of

body > div.container > div > div > ol.builds > li:nth-child(*) > span

Each artifact at

body > div.container > div > div > ol.builds > li:nth-child(*) > ul.build-artifacts > li.build-artifact.build-artifact-primary > a

Versioning, example

1.9.4-5.0.0-BETA-30
jmiahman commented 8 years ago

Nice, Great Job!

itzg commented 8 years ago

I'm getting closer. I have created a little tool in Go that scrapes and converts page segments to JSON:

https://github.com/itzg/restify

Now to slice and dice it with jq...

itzg commented 8 years ago

It's certainly uglier than the grep approach, but here's a "restify | jq" solution:

restify --class builds https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/?buildTypeId=2 | \      
  jq -r '.[].elements[0].elements[]|select(.class=="build-artifacts")|.elements[]|select(.class|contains("primary"))|.elements[0].href'
itzg commented 8 years ago

More restify | jq notes:

Get just the newest build's version

jq -r '.[0].elements[0].elements[] | select(.class == "build-version").text'

Produces

1.9.4-5.0.0-BETA-62

Get the URL of that build

jq -r '.[0].elements[0].elements[] | select(.class == "build-artifacts").elements[0].elements[0].href'

produces

https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/1.9.4-5.0.0-BETA-62/spongevanilla-1.9.4-5.0.0-BETA-62.jar
jaecam commented 7 years ago

This may be useful, not so sure. I'm currently building this project, https://github.com/NynjaCypher/sf-version-mapper, however it's not fully operational yet so I'll keep you all posted. It will scrape files.minecraftforge.net and the SpongeForge repository and map them together, cache the results in Redis, so that a Forge version can be easily retrieved from a SpongeForge one.

itzg commented 7 years ago

Thanks @NynjaCypher and thanks for reminding me of this thread.

aitor-binaryshock commented 7 years ago

Is it planned to continue development of Sponge integration?

itzg commented 7 years ago

I'd still like to support Sponge but obviously it is taking way too long for me to get to it. I'll have to look around again, perhaps some of the version lookup logic is easier now.

aitor-binaryshock commented 7 years ago

If you agree, I can try to do it.

itzg commented 7 years ago

That would be great!

aitor-binaryshock commented 7 years ago

Working on it. Thanks!!

aitor-binaryshock commented 6 years ago

I can't push new branches!!

aitor-binaryshock commented 6 years ago

@itzg ??

jaecam commented 6 years ago

Fork and submit a PR...

itzg commented 6 years ago

@s0rcerer88 sorry for the delay. Yes, as @NynjaCypher mentioned, you'll fork and then submit a PR via your fork. Here is Github's docs on working with forks

https://help.github.com/articles/working-with-forks/

but since you have likely cloned itzg/dockerfiles and made changes in your local clone you'll roughly follow these steps:

  1. Fork via Github
  2. Add your forked repo as a remote within your local cloned directory
  3. Checkout the master branch of your repo as a new local branch
  4. Commit changes to that local branch
  5. Push to your repo
  6. In Github submit a PR. It should auto suggest my repo as the destination of the PR
aitor-binaryshock commented 6 years ago

Ohh. Thanks for the info. My very first time using GitHub.

aitor-binaryshock commented 6 years ago

PR sent.

aitor-binaryshock commented 6 years ago

SpongeVanilla integration completed. Changes merged. SpongeForge integration in progress.

jaecam commented 6 years ago

Great news, thanks for this! 👍

RoSulek1 commented 6 years ago

Is any chance for SpongeForge integraftion?

itzg commented 6 years ago

@RoSulek1 oops, looks like this issue got completed successfully. I know that because I can see the code in place should make it fairly easy to add SpongeForge. Can you create a new issue for that specifically?

RoSulek1 commented 6 years ago

Done [https://github.com/itzg/dockerfiles/issues/245] thx :)