Skip to content

Commit

Permalink
Merge pull request thijsvanloef#303 from thijsvanloef/yamllint
Browse files Browse the repository at this point in the history
Enable yamllint on whole repo
  • Loading branch information
thijsvanloef authored Feb 6, 2024
2 parents a626151 + 408d15f commit 5e8d76a
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

---
github: thijsvanloef
ko_fi: thijsvanloef
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

---
version: 2
updates:
- package-ecosystem: "docker" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "docker" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
3 changes: 2 additions & 1 deletion .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Developer image
on:
on: # yamllint disable-line rule:truthy
push:
branches: [main]

Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Linting
on:
on: # yamllint disable-line rule:truthy
pull_request:

run-name: Pull request - ${{ github.event.pull_request.number }}
Expand Down Expand Up @@ -38,6 +39,17 @@ jobs:
config: ".markdownlint.jsonc"
globs: "**/*.md"

yamllint:
name: Lint - Yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint - Yamllint
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml

test-build:
name: Docker - Build
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Release
on:
on: # yamllint disable-line rule:truthy
release:
types: [published]

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Generate Sponsors
on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: 0 0 * * *
Expand All @@ -21,4 +22,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: main
folder: '.'
folder: '.'
38 changes: 38 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---

yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'

rules:
anchors: enable
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
float-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: disable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning

ignore:
- charts/palworld/templates/*.yaml
1 change: 1 addition & 0 deletions charts/cr.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
release-name-template: "chart-{{ .Version }}"
25 changes: 14 additions & 11 deletions charts/palworld/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
apiVersion: v2
name: palworld
version: 0.1.0
description: This chart will provide a Palworld server installation on a kubernetes cluster
type: application
keywords:
- palworld
- server
- kubernetes
- helm
- palworld
- server
- kubernetes
- helm
home: https://github.com/thijsvanloef/palworld-server-docker
sources:
- https://github.com/thijsvanloef/palworld-server-docker
- https://github.com/thijsvanloef/palworld-server-docker
maintainers:
- name: Filipe Souza
email: [email protected]
url: https://github.com/Filipe-Souza
- name: Twinki
url: https://github.com/Twinki14
- name: Filipe Souza
email: [email protected]
url: https://github.com/Filipe-Souza
- name: Twinki
url: https://github.com/Twinki14
icon: https://cdn.akamai.steamstatic.com/steam/apps/1623730/header.jpg
appVersion: "latest"
deprecated: false
Expand All @@ -31,4 +32,6 @@ annotations:
artifacthub.io/images: |
- name: palworld-server-docker
image: thijsvanloef/palworld-server-docker:latest
artifacthub.io/screenshots: https://cdn.akamai.steamstatic.com/steam/apps/1623730/header.jpg
artifacthub.io/screenshots: |
- title: PalWorld
url: https://cdn.akamai.steamstatic.com/steam/apps/1623730/header.jpg
17 changes: 9 additions & 8 deletions charts/palworld/values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
# -- Namespace where the resources will be created
namespace: palworld
# -- (dict) The server configuration
# @notationType -- bigValue
server:
# -- Additional annotations to the resources
annotations: { }
annotations: {}
# -- Additional labels to the resources
labels: { }
labels: {}
# -- (dict) Resources limits for the container.
resources:
limits:
Expand Down Expand Up @@ -66,9 +67,9 @@ server:
# -- (bool) Enables the creation of the service component.
enabled: true
# -- Additional annotations to the resources
annotations: { }
annotations: {}
# -- Additional labels to the resources
labels: { }
labels: {}
# -- (string) The type of service to be created.
# For minikube, set this to NodePort, elsewhere use LoadBalancer
# Use ClusterIP if your setup includes ingress controller
Expand Down Expand Up @@ -109,9 +110,9 @@ server:
# @notationType -- bigValue
config:
# -- Additional annotations to the resources
annotations: { }
annotations: {}
# -- Additional labels to the resources
labels: { }
labels: {}
puid: 1000
pgid: 1000
port: 8211
Expand Down Expand Up @@ -154,8 +155,8 @@ server:
# THIS HAS TO BE ENABLED THE FIRST TIME YOU RUN THE CONTAINER
update_on_boot: true
daily_reboot:
# -- (bool) Enable daily reboot.
# Disabled by default
# -- (bool) Enable daily reboot.
# Disabled by default
enable: false
# -- (string) The time (UTC) the server will perform the reboot.
# By default, this schedules the restart at 9:30am UTC. Please note, this is using cron syntax.
Expand Down
11 changes: 6 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
services:
palworld:
image: thijsvanloef/palworld-server-docker:latest
restart: unless-stopped
container_name: palworld-server
stop_grace_period: 30s # Set to however long you are willing to wait for the container to gracefully stop
stop_grace_period: 30s # Set to however long you are willing to wait for the container to gracefully stop
ports:
- 8211:8211/udp
- 27015:27015/udp # Required if you want your server to show up in the community servers tab
- 27015:27015/udp # Required if you want your server to show up in the community servers tab
environment:
- PUID=1000
- PGID=1000
- PORT=8211 # Optional but recommended
- PLAYERS=16 # Optional but recommended
- SERVER_PASSWORD=worldofpals # Optional but recommended
- PORT=8211 # Optional but recommended
- PLAYERS=16 # Optional but recommended
- SERVER_PASSWORD=worldofpals # Optional but recommended
- MULTITHREADING=true
- RCON_ENABLED=true
- RCON_PORT=25575
Expand Down
7 changes: 4 additions & 3 deletions k8s/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: palworld-cm
data:
PUID: "1000"
PGID: "1000"
PORT: "8211" # Optional but recommended
PLAYERS: "16" # Optional but recommended
SERVER_PASSWORD: "worldofpals" # Optional but recommended
PORT: "8211" # Optional but recommended
PLAYERS: "16" # Optional but recommended
SERVER_PASSWORD: "worldofpals" # Optional but recommended
MULTITHREADING: "true"
RCON_ENABLED: "true"
RCON_PORT: "25575"
Expand Down
7 changes: 4 additions & 3 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -40,6 +41,6 @@ spec:
- mountPath: /palworld
name: datadir
volumes:
- name: datadir
persistentVolumeClaim:
claimName: palworld-server-datadir
- name: datadir
persistentVolumeClaim:
claimName: palworld-server-datadir
4 changes: 2 additions & 2 deletions k8s/examples/cronjob-reboot/cm.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: restart-deployment-configmap
data:
restart-deployment.sh: |
restart-deployment.sh: |
#!/bin/bash
cont=$(kubectl -n palworld get pods -o=jsonpath='{.items[?(@.metadata.labels.app=="palworld-server")].metadata.name}')
Expand All @@ -27,4 +28,3 @@ data:
exec_rcon_cmd "Shutdown 1"
sleep 30
kubectl -n palworld rollout restart deployment/palworld-server
35 changes: 18 additions & 17 deletions k8s/examples/cronjob-reboot/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: restart-deployment
spec:
concurrencyPolicy: Forbid
concurrencyPolicy: Forbid
schedule: '30 9 * * *'
jobTemplate:
spec:
backoffLimit: 1
activeDeadlineSeconds: 600
activeDeadlineSeconds: 600
template:
spec:
serviceAccountName: restart-deploy
restartPolicy: Never
restartPolicy: Never
containers:
- name: kubectl
image: bitnami/kubectl
image: bitnami/kubectl
command:
- /bin/sh
- -c
- /restart-script/restart-deployment.sh
- /bin/sh
- -c
- /restart-script/restart-deployment.sh
volumeMounts:
- name: restart-script
mountPath: "/restart-script"
readOnly: true
- name: restart-script
mountPath: "/restart-script"
readOnly: true
volumes:
- name: restart-script
configMap:
name: restart-deployment-configmap
defaultMode: 0777
items:
- key: "restart-deployment.sh"
path: "restart-deployment.sh"
- name: restart-script
configMap:
name: restart-deployment-configmap
defaultMode: 0777
items:
- key: "restart-deployment.sh"
path: "restart-deployment.sh"
7 changes: 4 additions & 3 deletions k8s/examples/cronjob-reboot/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand All @@ -6,6 +7,6 @@ rules:
- apiGroups: ["apps", "extensions"]
resources: ["deployments", "pods"]
verbs: ["get", "patch", "list", "watch"]
- apiGroups: [""]
resources: ["pods/exec", "pods"]
verbs: ["get", "list", "create"]
- apiGroups: [""]
resources: ["pods/exec", "pods"]
verbs: ["get", "list", "create"]
1 change: 1 addition & 0 deletions k8s/examples/cronjob-reboot/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand Down
1 change: 1 addition & 0 deletions k8s/examples/cronjob-reboot/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
3 changes: 2 additions & 1 deletion k8s/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -6,7 +7,7 @@ metadata:
name: palworld-server-datadir
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 12Gi
3 changes: 2 additions & 1 deletion k8s/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
apiVersion: v1
kind: Secret
metadata:
name: palworld-secrets
type: Opaque
stringData:
rconPassword: yourRconPassword
rconPassword: yourRconPassword
Loading

0 comments on commit 5e8d76a

Please sign in to comment.