2018-07-18 19:46:20 +02:00
|
|
|
From 0e2432374ec4026626da426fcbb25775cc210f2b Mon Sep 17 00:00:00 2001
|
2016-05-28 18:34:39 +02:00
|
|
|
From: Tux <write@imaginarycode.com>
|
|
|
|
Date: Thu, 19 May 2016 11:34:52 -0700
|
|
|
|
Subject: [PATCH] Fetch modules from the Waterfall CI
|
|
|
|
|
|
|
|
Don't fetch from the BungeeCord CI, as that only has their modules
|
|
|
|
|
|
|
|
diff --git a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java
|
2017-04-08 16:26:20 +02:00
|
|
|
index 2536435c..e1cf0010 100644
|
2016-05-28 18:34:39 +02:00
|
|
|
--- a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java
|
|
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java
|
2017-04-08 16:26:20 +02:00
|
|
|
@@ -1,10 +1,10 @@
|
2016-05-28 18:34:39 +02:00
|
|
|
package net.md_5.bungee.module;
|
|
|
|
|
|
|
|
-import com.google.common.io.ByteStreams;
|
|
|
|
-import com.google.common.io.Files;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.net.URLConnection;
|
|
|
|
+import java.nio.file.Files;
|
|
|
|
+import java.nio.file.StandardCopyOption;
|
2017-04-08 16:26:20 +02:00
|
|
|
import lombok.Data;
|
|
|
|
import net.md_5.bungee.Util;
|
2016-05-28 18:34:39 +02:00
|
|
|
|
2017-04-08 16:26:20 +02:00
|
|
|
@@ -18,13 +18,14 @@ public class JenkinsModuleSource implements ModuleSource
|
2016-05-28 18:34:39 +02:00
|
|
|
System.out.println( "Attempting to Jenkins download module " + module.getName() + " v" + version.getBuild() );
|
|
|
|
try
|
|
|
|
{
|
2017-03-07 22:28:08 +01:00
|
|
|
- URL website = new URL( "https://ci.md-5.net/job/BungeeCord/" + version.getBuild() + "/artifact/module/" + module.getName().replace( '_', '-' ) + "/target/" + module.getName() + ".jar" );
|
2016-12-03 22:41:35 +01:00
|
|
|
+ URL website = new URL( "https://ci.destroystokyo.com/job/Waterfall/" + version.getBuild() + "/artifact/Waterfall-Proxy/module/" + module.getName().replace( '_', '-' ) + "/target/" + module.getName() + ".jar" );
|
2016-05-28 18:34:39 +02:00
|
|
|
URLConnection con = website.openConnection();
|
|
|
|
// 15 second timeout at various stages
|
|
|
|
con.setConnectTimeout( 15000 );
|
|
|
|
con.setReadTimeout( 15000 );
|
2016-07-03 22:28:40 +02:00
|
|
|
+ con.setRequestProperty( "User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36" );
|
2016-05-28 18:34:39 +02:00
|
|
|
|
|
|
|
- Files.write( ByteStreams.toByteArray( con.getInputStream() ), module.getFile() );
|
2016-07-03 22:28:40 +02:00
|
|
|
+ Files.copy( con.getInputStream(), module.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING );
|
2016-05-28 18:34:39 +02:00
|
|
|
System.out.println( "Download complete" );
|
|
|
|
} catch ( IOException ex )
|
|
|
|
{
|
|
|
|
--
|
2018-07-18 19:46:20 +02:00
|
|
|
2.18.0
|
2016-05-28 18:34:39 +02:00
|
|
|
|