feat: Use yaml-rust2 to get line numbers for better errors

This commit is contained in:
Gerald Pinder 2024-11-01 16:04:38 -04:00
parent e67a427dc3
commit 1481fba40a
14 changed files with 930 additions and 221 deletions

View file

@ -89,6 +89,7 @@ validate:
RUN --no-cache bluebuild -v validate recipes/recipe-invalid.yml && exit 1 || exit 0
RUN --no-cache bluebuild -v validate recipes/recipe-invalid-module.yml && exit 1 || exit 0
RUN --no-cache bluebuild -v validate recipes/recipe-invalid-stage.yml && exit 1 || exit 0
RUN --no-cache bluebuild -v validate recipes/recipe-invalid-from-file.yml && exit 1 || exit 0
legacy-base:
FROM ../+blue-build-cli-alpine --RELEASE=false

View file

@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://schema.blue-build.org/module-list-v1.json
modules:
# Tests installing rpms from a combo image stage
- type: akmods
install: openrazer

View file

@ -0,0 +1,37 @@
---
# yaml-language-server: $schema=https://schema.blue-build.org/module-stage-list-v1.json
stages:
- name: ubuntu-test
from:
- ubuntu
modules: {}
- name: debian-test
from: debian
modules:
- from-file: stages.yml
- name: fedora-test
from: fedora
modules:
- from-file: stages.yml
- name: alpine-test
from: alpine
modules:
- from-file: stages.yml
modules:
- type: files
files:
- usr: /usr
- type: script
scripts:
- example.sh
snippets:
- echo "test" > /test.txt
- type: test-module
source: local
- type: containerfile
containerfiles:
- labels
snippets:
- RUN echo "This is a snippet"
- type: rpm-ostree
install: micro

View file

@ -0,0 +1,58 @@
---
# yaml-language-server: $schema=https://schema.blue-build.org/recipe-v1.json
name: cli/test
description: This is my personal OS image.
base-image: ghcr.io/ublue-os/silverblue-main
image-version: 40
stages:
- from-file: invalid-stages.yml
modules:
- from-file: invalid-module.yml
- from-file: flatpaks.yml
- type: files
files:
- source: usr
destination: /usr
- type: script
scripts:
- example.sh
- type: rpm-ostree
repos:
- https://copr.fedorainfracloud.org/coprs/atim/starship/repo/fedora-%OS_VERSION%/atim-starship-fedora-%OS_VERSION%.repo
install:
- micro
- starship
remove:
- firefox
- firefox-langpacks
- type: signing
- type: test-module
source: local
- type: containerfile
containerfiles:
- labels
snippets:
- RUN echo "This is a snippet" && ostree container commit
- type: copy
from: alpine-test
src: /test.txt
dest: /
- type: copy
from: ubuntu-test
src: /test.txt
dest: /
- type: copy
from: debian-test
src: /test.txt
dest: /
- type: copy
from: fedora-test
src: /test.txt
dest: /