pls work
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 38s

This commit is contained in:
Lee 2024-04-29 06:45:30 +01:00
parent a9f3f74880
commit 123b01d1d0
3 changed files with 11 additions and 4 deletions

@ -25,9 +25,5 @@ WORKDIR /home/container
# Copy the built jar file from the builder stage # Copy the built jar file from the builder stage
COPY --from=builder /home/container/target/PIA-Servers.jar . COPY --from=builder /home/container/target/PIA-Servers.jar .
# Make port 80 available to the world outside this container
EXPOSE 80
ENV PORT=80
# Run the jar file # Run the jar file
CMD java -jar PIA-Servers.jar -Djava.awt.headless=true CMD java -jar PIA-Servers.jar -Djava.awt.headless=true

@ -22,6 +22,15 @@ public class GitUtils {
runCommand("git", "push", "https://pia-servers-ci:%s@git.fascinated.cc/Fascinated/PIA-Servers".formatted(System.getenv("AUTH_TOKEN"))); runCommand("git", "push", "https://pia-servers-ci:%s@git.fascinated.cc/Fascinated/PIA-Servers".formatted(System.getenv("AUTH_TOKEN")));
} }
/**
* Clone the repository
*/
public static void cloneRepo() {
if (System.getenv("ENVIRONMENT").equals("production")) {
runCommand("git", "clone", "https://git.fascinated.cc/Fascinated/PIA-Servers.git");
}
}
/** /**
* Run a system command * Run a system command
* *

@ -41,6 +41,8 @@ public class PiaManager {
SERVERS = new ArrayList<>(); SERVERS = new ArrayList<>();
} }
GitUtils.cloneRepo(); // Clone the repository
new Timer().scheduleAtFixedRate(new TimerTask() { new Timer().scheduleAtFixedRate(new TimerTask() {
@Override @Override
public void run() { public void run() {