Compare commits

...

4 Commits

Author SHA1 Message Date
4605a1c5f9 Updated CI to use new serverside tooling
All checks were successful
islandsurvivalcraft/pipeline/head This commit looks good
2024-11-14 23:19:18 +00:00
00d11f837e Added Java extension pack for devcontainer.
All checks were successful
ydeng/islandsurvivalcraft/pipeline/head This commit looks good
2024-08-05 18:28:04 +00:00
1a7a80d74c Added unit test report.
All checks were successful
ydeng/islandsurvivalcraft/pipeline/head This commit looks good
2024-07-22 05:07:01 +00:00
6a37c9c90b Added devcontainer and updated pipeline.
All checks were successful
ydeng/islandsurvivalcraft/pipeline/head This commit looks good
2024-07-22 04:54:33 +00:00
9 changed files with 35 additions and 82 deletions

View File

@@ -1,11 +0,0 @@
FROM mcr.microsoft.com/devcontainers/anaconda:1-3
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

View File

@@ -1,31 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the // For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/anaconda // README at: https://github.com/devcontainers/templates/tree/main/src/java
{ {
"name": "Anaconda (Python 3)", "name": "Java",
"build": { // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"context": "..", "image": "mcr.microsoft.com/devcontainers/java:1-11-bullseye",
"dockerfile": "Dockerfile"
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"installGradle": "true"
},
"ghcr.io/devcontainers/features/powershell:1": {}
}, },
"customizations": { "customizations": {
"vscode": { "vscode": {
"extensions": [ "extensions": [
"vscjava.vscode-java-test", "vscjava.vscode-java-pack"
"vscjava.vscode-java-dependency",
"vscjava.vscode-maven",
"redhat.java",
"vscjava.vscode-java-debug"
] ]
} }
} }
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally. // Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [], // "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created. // Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "python --version", // "postCreateCommand": "java -version",
// Configure tool-specific properties. // Configure tool-specific properties.
// "customizations": {}, // "customizations": {},

View File

@@ -1,3 +0,0 @@
This file copied into the container along with environment.yml* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no environment.yml is found.

8
.vscode/launch.json vendored
View File

@@ -4,6 +4,12 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{
"type": "java",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickJavaProcess}"
},
{ {
"type": "java", "type": "java",
"name": "Debug (Launch) - Current File", "name": "Debug (Launch) - Current File",
@@ -19,8 +25,6 @@
"sourcePaths": [ "sourcePaths": [
"src/main/java" "src/main/java"
], ],
"preLaunchTask": "start test server",
"postDebugTask": "stop test server"
} }
] ]
} }

19
Jenkinsfile vendored
View File

@@ -1,22 +1,27 @@
pipeline { pipeline {
agent any agent {
kubernetes {
cloud 'rsys-devel'
defaultContainer 'maven'
inheritFrom 'maven'
}
}
stages { stages {
stage ("Install") { stage ("validate") {
steps { steps {
sh 'mamba env update --file environment.yml'
sh 'echo "mamba activate islandsurvivalcraft" >> ~/.bashrc'
sh "mvn validate" sh "mvn validate"
} }
} }
stage ("Build") { stage ("compile") {
steps { steps {
sh "mvn compile" sh "mvn compile"
} }
} }
stage ("Test") { stage ("test") {
steps { steps {
sh "mvn -Dmaven.test.skip=false test" sh "mvn -Dmaven.test.skip=false test"
junit 'target/surefire-reports/TEST-*.xml' xunit checksName: '', tools: [JUnit(excludesPattern: '', pattern: 'target/surefire-reports/TEST-*.xml', stopProcessingIfError: true)]
recordCoverage(tools: [[parser: 'JUNIT', pattern: 'target/surefire-reports/TEST-*.xml']])
} }
} }
stage ("Package") { stage ("Package") {

View File

@@ -2,5 +2,5 @@ name: islandsurvivalcraft
channels: channels:
- conda-forge - conda-forge
dependencies: dependencies:
- openjdk=11.0.* - openjdk=21
- maven=3.8.* - maven

View File

@@ -1,21 +0,0 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"java.configuration.updateBuildConfiguration": "automatic",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"cSpell.words": [
"Bukkit",
"crafter",
"itemstack"
]
}
}

View File

@@ -1,21 +0,0 @@
package ca.recrown.islandsurvivalcraft;
import org.bukkit.plugin.java.JavaPlugin;
/**
* Hello world!
*
*/
public class IslandSurvivalCraftPlugin extends JavaPlugin {
@Override
public void onEnable() {
// TODO Auto-generated method stub
super.onEnable();
}
@Override
public void onDisable() {
// TODO Auto-generated method stub
super.onDisable();
}
}

View File

@@ -1 +1 @@
Start-Process java -ArgumentList "-Xms512M", "-Xmx1G", "-jar", "craftbukkit.jar", "nogui" Start-Process java -ArgumentList "-Xms512M", "-Xmx1G", "-jar", "paper.jar", "nogui"