Removed autoupdate, addded deploy

This commit is contained in:
Norbi Peti 2017-06-28 18:52:18 +02:00
parent 897372f098
commit 609f309cd1
4 changed files with 31 additions and 36 deletions

View file

@ -1,3 +1,23 @@
cache:
directories:
- $HOME/.m2/repository/org/bukkit/craftbukkit
before_install: | # Wget BuildTools and run if cached folder not found
if [ ! -d "$HOME/.m2/repository/org/bukkit/craftbukkit/1.12-R0.1-SNAPSHOT" ]; then
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar --rev 1.12
fi
language: java language: java
jdk: jdk:
- oraclejdk8 - oraclejdk8
deploy:
# deploy develop to the staging environment
- provider: script
script: deploy.sh staging
on:
branch: dev
# deploy master to production
- provider: script
script: deploy.sh production
on:
branch: master

11
deploy.sh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
FILENAME=$(find target/ ! -name '*original*' -name '*.jar')
echo Found file: $FILENAME
if [ $1 = 'production' ]; then
echo Production mode
echo $UPLOAD_KEY > upload_key
chmod 400 upload_key
yes | scp -B -i upload_key -o StrictHostKeyChecking=no $FILENAME travis@server.figytuna.com:/minecraft/main/plugins
fi

View file

@ -111,7 +111,6 @@ public class ButtonWebsiteModule extends JavaPlugin {
@Override @Override
public void onEnable() { public void onEnable() {
addPage(new IndexPage()); addPage(new IndexPage());
addPage(new AutoUpdatePage());
addPage(new LoginPage()); addPage(new LoginPage());
addPage(new ProfilePage()); addPage(new ProfilePage());
TBMCCoreAPI.RegisterUserClass(WebUser.class); TBMCCoreAPI.RegisterUserClass(WebUser.class);

View file

@ -1,35 +0,0 @@
package buttondevteam.website.page;
import java.io.IOException;
import java.util.stream.Collectors;
import com.sun.net.httpserver.HttpExchange;
import buttondevteam.website.io.IOHelper;
import buttondevteam.website.io.Response;
public class AutoUpdatePage extends Page {
@Override
public String GetName() {
return "autoupdate";
}
@Override
public Response handlePage(HttpExchange exchange) {
if (exchange.getRequestHeaders().containsKey("Expect")
&& exchange.getRequestHeaders().get("Expect").contains("100-continue"))
try {
exchange.sendResponseHeaders(100, -1);
exchange.getResponseBody().close();
} catch (IOException e1) {
e1.printStackTrace();
}
return new Response(200,
"Headers:\n" + exchange.getRequestHeaders().entrySet().stream()
.map(e -> e.getKey() + ": " + e.getValue().stream().collect(Collectors.joining(" ")))
.collect(Collectors.joining("\n")) + "\nPOST: " + IOHelper.GetPOST(exchange),
exchange);
}
}