Removed autoupdate, addded deploy and build notifications #7
4 changed files with 31 additions and 36 deletions
20
.travis.yml
20
.travis.yml
|
@ -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
|
||||
jdk:
|
||||
- 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
11
deploy.sh
Normal 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
|
||||
|
|
@ -111,7 +111,6 @@ public class ButtonWebsiteModule extends JavaPlugin {
|
|||
@Override
|
||||
public void onEnable() {
|
||||
addPage(new IndexPage());
|
||||
addPage(new AutoUpdatePage());
|
||||
addPage(new LoginPage());
|
||||
addPage(new ProfilePage());
|
||||
TBMCCoreAPI.RegisterUserClass(WebUser.class);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue