Skip to content

Commit 0dd8918

Browse files
Merge branch 'ju'
2 parents 9f7e050 + 513f2ad commit 0dd8918

File tree

7 files changed

+57
-89
lines changed

7 files changed

+57
-89
lines changed

β€Ž.devcontainer/README.mdβ€Ž

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Development Container Usage
2+
3+
Full development setup available as [Development Container](https://containers.dev/).
4+
Please use it for being able to tell "It works on my machine".
5+
6+
**Docker is required to be installed on your machine!**
7+
8+
## IntelliJ IDEA
9+
10+
- Open IntelliJ (Welcome screen)
11+
- Navigate to `Remote Development` - `Dev Containers`
12+
- Press `New Dev Container`
13+
- Select `From VCS Project`
14+
- Select and connect with `Docker`
15+
- Select `IntelliJ IDEA`
16+
- Enter `Git Repository`: `https://github.com/o7studios/cheetah-plugin`
17+
- Select `Detection for devcontainer.json file` `Automatic`
18+
- Press `Build Container and Continue`
19+
20+
## Development Container Issues
21+
22+
If you encounter an issue with setting up a development container, please
23+
try to rebuild it first before opening a GitHub Issue. It's not uncommon
24+
that some issues may fix themselves after a fresh container rebuild.
25+
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Cheetah plugin",
2+
"name": "o7studios/cheetah-plugin",
33
"image": "ubuntu:latest",
44
"customizations" : {
55
"jetbrains" : {
@@ -15,17 +15,9 @@
1515
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
1616
"ghcr.io/rio/features/k3d:1": {},
1717
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
18-
"ghcr.io/devcontainers/features/java:1": {
19-
"version": "23",
20-
"installGradle": true
21-
}
22-
},
23-
"runArgs": [
24-
"--add-host=host.docker.internal:host-gateway",
25-
"--env-file=${localEnv:HOME}/dev.env"
26-
],
27-
"containerEnv": {
28-
"TEST_CLUSTER_NAME": "o7-test-cluster"
18+
"ghcr.io/devcontainers/features/java:1": {"version": "23", "installGradle": true}
2919
},
20+
"runArgs": ["--add-host=host.docker.internal:host-gateway", "--env-file=${localEnv:HOME}/dev.env"],
21+
"containerEnv": {"TEST_CLUSTER_NAME": "o7-test-cluster"},
3022
"remoteUser": "ubuntu"
3123
}

β€ŽDockerfileβ€Ž

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
FROM --platform=$BUILDPLATFORM debian AS paper
2-
3-
RUN apt-get update
4-
RUN apt-get install jq curl wget -y
1+
FROM --platform=$BUILDPLATFORM ghcr.io/o7studios/scripts:latest AS paper
52

63
WORKDIR /paper
74

8-
COPY test/paper/install.sh ./install.sh
9-
10-
RUN chmod +x ./install.sh && ./install.sh
11-
RUN rm ./install.sh -rf
12-
5+
RUN paper 1.21.8
6+
RUN floodgate latest ./plugins/floodgate.jar
7+
RUN viaversion latest ./plugins/viaversion.jar
8+
RUN octopus latest ./plugins/octopus.jar
139

1410
FROM --platform=$BUILDPLATFORM ghcr.io/graalvm/jdk-community:25 AS prerun
1511

1612
WORKDIR /paper
1713

1814
COPY --from=paper /paper/ .
1915

20-
COPY test/paper/bukkit.yml .
21-
COPY test/paper/spigot.yml .
22-
COPY test/paper/server.properties .
16+
COPY test/paper/* ./
2317

2418
RUN java -jar paperclip.jar --nogui
2519

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,4 @@ depend:
2525
2626
## Development
2727
28-
Full development setup available as [Development Container](https://containers.dev/).
29-
Please use it for being able to tell "It works on my machine".
30-
31-
**Docker is required to be installed on your machine!**
32-
33-
### IntelliJ IDEA
34-
35-
- Open IntelliJ (Welcome screen)
36-
- Navigate to `Remote Development` - `Dev Containers`
37-
- Press `New Dev Container`
38-
- Select `From VCS Project`
39-
- Select and connect with `Docker`
40-
- Select `IntelliJ IDEA`
41-
- Enter `Git Repository`: `https://github.com/o7studios/cheetah-plugin`
42-
- Select `Detection for devcontainer.json file` `Automatic`
43-
- Press `Build Container and Continue`
44-
45-
### Development Container Issues
46-
47-
If you encounter an issue with setting up a development container, please
48-
try to rebuild it first before opening a GitHub Issue. It's not uncommon
49-
that some issues may fix themselves after a fresh container rebuild.
28+
Please check out [Development Container](.devcontainer/README.md) for project setup.

β€Ždelete.shβ€Ž

Lines changed: 0 additions & 6 deletions
This file was deleted.

β€Žrebuild.shβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ set -e
44
API_PORT=6550
55
API_HOST=host.docker.internal
66

7+
while [[ "$#" -gt 0 ]]; do
8+
case $1 in
9+
--delete)
10+
echo "πŸ—‘ Deleting cluster $TEST_CLUSTER_NAME..."
11+
k3d cluster delete "$TEST_CLUSTER_NAME" || true
12+
exit 0
13+
;;
14+
--recreate)
15+
echo "πŸ”„ Recreating cluster $TEST_CLUSTER_NAME..."
16+
k3d cluster delete "$TEST_CLUSTER_NAME" || true
17+
;;
18+
*)
19+
echo "❓ Unknown parameter: $1"
20+
exit 1
21+
;;
22+
esac
23+
shift
24+
done
25+
726
if ! k3d cluster list | grep -qw "$TEST_CLUSTER_NAME"; then
827
echo "πŸ”§ K3d cluster $TEST_CLUSTER_NAME not found. Creating it..."
928
k3d cluster create "$TEST_CLUSTER_NAME" --api-port "$API_PORT" -p "25565:25565@loadbalancer" -p "19132:19132/udp@loadbalancer"
@@ -28,6 +47,8 @@ kubectl config set-cluster k3d-"$TEST_CLUSTER_NAME" \
2847

2948
kubectl config use-context k3d-"$TEST_CLUSTER_NAME"
3049

50+
pids=()
51+
3152
if ! kubectl get secret github-token >/dev/null 2>&1; then
3253
echo "πŸ” Creating secret for github-token on K3d cluster $TEST_CLUSTER_NAME..."
3354
kubectl create secret generic github-token --from-literal="GITHUB_TOKEN=$GITHUB_TOKEN"

β€Žtest/paper/install.shβ€Ž

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
Β (0)