forked from CloudburstMC/Nukkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/bleeding' into v1.4/feature/iron…
…-golem
- Loading branch information
Showing
117 changed files
with
2,016 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: powernukkit # Replace with a single Patreon username | ||
open_collective: powernukkit # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Sentry release | ||
|
||
on: | ||
push: | ||
branches: | ||
- bleeding | ||
- bleeding-* | ||
- master | ||
|
||
jobs: | ||
sentry-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
submodules: true | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Get version | ||
run: | | ||
SHA=$(echo $GITHUB_SHA | cut -c1-7) | ||
PN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-git-$SHA | ||
echo "Version: $PN_VERSION" | ||
echo "PN_VERSION=$PN_VERSION-git" >> $GITHUB_ENV | ||
- name: Create Sentry release | ||
uses: getsentry/action-release@v1 | ||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | ||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | ||
with: | ||
environment: production | ||
version: ${{ env.PN_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM arm64v8/openjdk:8-jdk-slim AS build | ||
WORKDIR /usr/local/src/nukkit | ||
COPY src /usr/local/src/nukkit/src | ||
COPY mvn* pom.xml /usr/local/src/nukkit/ | ||
COPY .git /usr/local/src/nukkit/.git | ||
COPY .mvn /usr/local/src/nukkit/.mvn | ||
COPY .gitmodules /usr/local/src/nukkit/.gitmodules | ||
RUN apt-get -y update && \ | ||
apt-get install -y build-essential git maven && \ | ||
git submodule update --init && \ | ||
mvn clean package | ||
|
||
FROM arm64v8/openjdk:8-jre-slim AS run | ||
LABEL maintainer="Chris Fordham <chris@fordham.id.au>" | ||
COPY --from=build /usr/local/src/nukkit/target/nukkit-1.0-SNAPSHOT.jar /opt/nukkit/nukkit.jar | ||
COPY nukkit.yml.default /etc/opt/nukkit/nukkit.yml | ||
RUN useradd --user-group \ | ||
--no-create-home \ | ||
--home-dir /var/opt/nukkit \ | ||
--shell /usr/sbin/nologin \ | ||
minecraft && \ | ||
mkdir -p /var/opt/nukkit && \ | ||
chown -R minecraft /opt/nukkit /var/opt/nukkit /etc/opt/nukkit/nukkit.yml && \ | ||
ln -sfv /etc/opt/nukkit/nukkit.yml /var/opt/nukkit/nukkit.yml && \ | ||
apt-get -y update && \ | ||
apt-get -y install lsof && \ | ||
rm -rf /var/lib/apt/lists/* | ||
USER minecraft | ||
VOLUME /etc/opt/nukkit /var/opt/nukkit /opt/nukkit | ||
EXPOSE 19132 | ||
WORKDIR /var/opt/nukkit | ||
ENTRYPOINT ["java"] | ||
CMD [ "-jar", "/opt/nukkit/nukkit.jar" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
DOCKER_REGISTRY = index.docker.io | ||
IMAGE_NAME = nukkit | ||
IMAGE_VERSION = latest | ||
IMAGE_ORG = flaccid | ||
IMAGE_TAG = $(DOCKER_REGISTRY)/$(IMAGE_ORG)/$(IMAGE_NAME):$(IMAGE_VERSION) | ||
export DOCKER_BUILDKIT = 1 | ||
|
||
WORKING_DIR := $(shell pwd) | ||
|
||
.DEFAULT_GOAL := docker-build | ||
|
||
.PHONY: build run | ||
|
||
# TODO: finish | ||
#build:: ## builds nukkit | ||
|
||
# TODO: finish | ||
#run:: ## runs the binary | ||
|
||
docker-release:: docker-build docker-push ## builds and pushes the docker image to the registry | ||
docker-release-arm64:: docker-build-arm64 docker-push-arm64 ## builds and pushes the arm64 docker image to the registry | ||
|
||
docker-push:: ## pushes the docker image to the registry | ||
@docker push $(IMAGE_TAG) | ||
|
||
docker-push-arm64:: ## pushes the arm64 docker image to the registry | ||
@docker push $(DOCKER_REGISTRY)/$(IMAGE_ORG)/$(IMAGE_NAME):arm64 | ||
|
||
docker-build:: ## builds the docker image locally | ||
@echo http_proxy=$(HTTP_PROXY) http_proxy=$(HTTPS_PROXY) | ||
@echo building $(IMAGE_TAG) | ||
@docker build --pull \ | ||
--build-arg=http_proxy=$(HTTP_PROXY) \ | ||
--build-arg=https_proxy=$(HTTPS_PROXY) \ | ||
-t $(IMAGE_TAG) $(WORKING_DIR) | ||
|
||
docker-build-arm64:: ## builds the arm64 docker image locally | ||
@echo http_proxy=$(HTTP_PROXY) http_proxy=$(HTTPS_PROXY) | ||
@echo building $(IMAGE_TAG) | ||
@docker build --pull \ | ||
--build-arg=http_proxy=$(HTTP_PROXY) \ | ||
--build-arg=https_proxy=$(HTTPS_PROXY) \ | ||
-f Dockerfile.arm64 \ | ||
-t $(DOCKER_REGISTRY)/$(IMAGE_ORG)/$(IMAGE_NAME):arm64 $(WORKING_DIR) | ||
|
||
docker-run:: ## runs the docker image locally | ||
@docker run \ | ||
-it \ | ||
-p 19132:19132 \ | ||
$(DOCKER_REGISTRY)/$(IMAGE_ORG)/$(IMAGE_NAME):$(IMAGE_VERSION) | ||
|
||
helm-install:: ## installs using helm from chart in repo | ||
@helm install --name nukkit ./charts/nukkit | ||
|
||
helm-upgrade:: ## upgrades deployed helm release | ||
@helm upgrade nukkit ./charts/nukkit | ||
|
||
helm-purge:: ## deletes and purges deployed helm release | ||
@helm delete --purge nukkit | ||
|
||
helm-render:: ## prints out the rendered chart | ||
@helm install --dry-run --debug charts/nukkit | ||
|
||
helm-validate:: ## runs a lint on the helm chart | ||
@helm lint charts/nukkit | ||
|
||
install-ghr:: ## installs ghr | ||
@cd /tmp | ||
@wget https://github.com/tcnksm/ghr/releases/download/v0.12.2/ghr_v0.12.2_linux_amd64.tar.gz | ||
@tar zxvf ghr_v0.12.2_linux_amd64.tar.gz | ||
@sudo mv ghr_v0.12.2_linux_amd64/ghr /usr/local/bin/ | ||
|
||
# a help target including self-documenting targets (see the awk statement) | ||
define HELP_TEXT | ||
Usage: make [TARGET]... [MAKEVAR1=SOMETHING]... | ||
|
||
Available targets: | ||
endef | ||
export HELP_TEXT | ||
help: ## this help target | ||
@cat .banner | ||
@echo | ||
@echo "$$HELP_TEXT" | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / \ | ||
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: nukkit | ||
description: A Helm chart for Nukkit | ||
type: application | ||
version: 0.1.0 | ||
appVersion: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nukkit.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "nukkit.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nukkit.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nukkit.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "nukkit.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "nukkit.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "nukkit.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "nukkit.labels" -}} | ||
helm.sh/chart: {{ include "nukkit.chart" . }} | ||
{{ include "nukkit.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "nukkit.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "nukkit.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "nukkit.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "nukkit.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "nukkit.name" . }}-conf | ||
labels: | ||
app: {{ template "nukkit.name" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
data: | ||
nukkit.yml: |- | ||
{{- if .Values.config }} | ||
{{ .Values.config | indent 4 }} | ||
{{- end -}} |
Oops, something went wrong.