add gitlab-ci
This commit is contained in:
38
.gitlab-ci.yml
Normal file
38
.gitlab-ci.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
variables:
|
||||
CI_PROJECT_NAME: "pubcraft"
|
||||
CI_PROJECT_DIR: "."
|
||||
CI_REGISTRY_IMAGE: hub.ducoterra.net/ducoterra/pubcraft
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
|
||||
build:
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG
|
||||
stage: build
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- echo $DEPLOY
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
||||
|
||||
deploy_to_prod:
|
||||
variables:
|
||||
DEPLOY: prod
|
||||
stage: deploy
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG
|
||||
image:
|
||||
name: debian:10
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- apt -qq update >> /dev/null && apt -qq install -y curl >> /dev/null
|
||||
- curl -L -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
|
||||
- chmod +x /usr/local/bin/kubectl
|
||||
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
||||
- helm template $CI_PROJECT_NAME --set tag=1.1.1 ./helm | kubectl apply -f -
|
||||
23
helm/.helmignore
Normal file
23
helm/.helmignore
Normal file
@@ -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/
|
||||
23
helm/Chart.yaml
Normal file
23
helm/Chart.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: v2
|
||||
name: charts
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 1.16.0
|
||||
@@ -1,19 +1,19 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pubcraft
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pubcraft
|
||||
app: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pubcraft
|
||||
app: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: pubcraft
|
||||
image: hub.ducoterra.net/ducoterra/pubcraft:1.15.2_3
|
||||
- name: {{ .Release.Name }}
|
||||
image: {{ .Values.image }}
|
||||
ports:
|
||||
- containerPort: 25565
|
||||
volumeMounts:
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
stdin: true
|
||||
env:
|
||||
- name: MAX_RAM
|
||||
value: "8"
|
||||
value: "4"
|
||||
- name: MIN_RAM
|
||||
value: "1"
|
||||
- name: THREADS
|
||||
@@ -33,9 +33,9 @@ spec:
|
||||
memory: "2Gi"
|
||||
cpu: 250m
|
||||
limits:
|
||||
memory: "8Gi"
|
||||
memory: "4Gi"
|
||||
cpu: "4"
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: pubcraft
|
||||
claimName: {{ .Release.Name }}
|
||||
@@ -1,11 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pubcraft
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
storageClassName: nfs-encrypted
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 16Gi
|
||||
storage: 32Gi
|
||||
12
helm/templates/service.yaml
Normal file
12
helm/templates/service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Release.Name }}
|
||||
ports:
|
||||
- port: {{ .Values.port }}
|
||||
targetPort: 25565
|
||||
name: {{ .Release.Name }}
|
||||
type: LoadBalancer
|
||||
2
helm/values.yaml
Normal file
2
helm/values.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
image: hub.ducoterra.net/ducoterra/minecraft:1.15.2_1
|
||||
port: 20100
|
||||
@@ -1,12 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pubcraft
|
||||
spec:
|
||||
selector:
|
||||
app: pubcraft
|
||||
ports:
|
||||
- port: 20100
|
||||
targetPort: 25565
|
||||
name: pubcraft
|
||||
type: LoadBalancer
|
||||
@@ -25,7 +25,7 @@ server-ip=
|
||||
spawn-npcs=true
|
||||
allow-flight=true
|
||||
level-name=world
|
||||
view-distance=32
|
||||
view-distance=20
|
||||
resource-pack=
|
||||
spawn-animals=true
|
||||
white-list=true
|
||||
|
||||
Reference in New Issue
Block a user