Add a container build
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Nikolai Rodionov 2025-01-30 14:42:01 +01:00
parent 5d8f5af1e3
commit 16449d0c9d
No known key found for this signature in database
GPG Key ID: 0639A45505F3BFA6
2 changed files with 66 additions and 0 deletions

34
.woodpecker.yaml Normal file
View File

@ -0,0 +1,34 @@
---
when:
event:
- push
steps:
- name: Build and push a container image
image: zot.badhouseplants.net/badhouseplants/badhouseplants-builder:latest
environment:
BUILDAH_REG: zot.badhouseplants.net/badhouseplants/open-strike
privileged: true
secrets:
- registry_token
commands:
- build-container
backend_options:
kubernetes:
resources:
requests:
memory: 200Mi
cpu: 200m
limits:
memory: 200Mi
cpu: 200m
securityContext:
privileged: true
- name: Spell-Checker
failure: ignore
image: node
commands:
- npm i markdown-spellcheck -g
- mdspell "src/content/**/*.md" -n -r

32
Containerfile Normal file
View File

@ -0,0 +1,32 @@
FROM ghcr.io/allanger/dumb-downloader as dudo
RUN apt-get update -y && apt-get install unzip -y
ENV RUST_LOG=info
ENV GODOT_VERSION=4.3
WORKDIR /out
RUN dudo -l "https://github.com/godotengine/godot/releases/download/{{ version }}-stable/Godot_v{{ version }}-stable_{{ os }}.{{ arch }}.zip" -d /tmp/godot.zip -p $GODOT_VERSION
RUN cd /tmp && unzip godot.zip && rm -f godot.zip
RUN sh -c 'find /tmp -type f -print0 -name "Godot*" | xargs --null -I{} mv {} godot'
RUN dudo -l "https://github.com/godotengine/godot/releases/download/{{ version }}-stable/Godot_v{{ version }}-stable_export_templates.tpz" -d /tmp/export_templates.zip -p $GODOT_VERSION
RUN cd /tmp && unzip export_templates.zip && rm -f export_templates.zip
RUN ls /tmp
RUN mkdir -p /out/templates
RUN sh -c 'cd /tmp && find . -type f -print0 -name "Godot*" | xargs --null -I{} mv {} /out/{}'
RUN chmod +x /out/godot
FROM ubuntu as builder
RUN apt-get update -y && apt-get install fontconfig -y
WORKDIR /src
COPY --from=dudo /out/godot /usr/bin/godot
RUN mkdir -p /root/.local/share/godot/export_templates/4.3.stable/
COPY --from=dudo /out/templates /root/.local/share/godot/export_templates/4.3.stable
RUN ls -R /root/.local/share/godot/export_templates/4.3.stable
COPY . .
RUN ls $HOME/.local/share/godot/export_templates/4.3.stable/
RUN mkdir /out
RUN godot --headless --export-debug "[Dedicated Server] Linux" /out/open_strike
FROM ubuntu
WORKDIR /app
COPY --from=builder /out .
CMD ["/out/open_strike.sh"]