Skip to content

Commit

Permalink
enable yamllint
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsvanloef committed Feb 6, 2024
1 parent 364608b commit c8017e3
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 40 deletions.
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: '.'
35 changes: 35 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---

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
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
1 change: 1 addition & 0 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
2 changes: 1 addition & 1 deletion k8s/examples/cronjob-reboot/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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 Down
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
19 changes: 10 additions & 9 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Service
metadata:
Expand All @@ -6,14 +7,14 @@ metadata:
name: palworld-server
spec:
ports:
- name: server
port: 8211
protocol: UDP
targetPort: server
- name: query
port: 27015
protocol: UDP
targetPort: query
- name: server
port: 8211
protocol: UDP
targetPort: server
- name: query
port: 27015
protocol: UDP
targetPort: query
selector:
app: palworld-server
type: LoadBalancer
type: LoadBalancer

0 comments on commit c8017e3

Please sign in to comment.