feat: add per-recipe shell script support (#38)

This commit is contained in:
Emmett Wasik (Viv)
2023-04-24 14:40:51 -04:00
committed by GitHub
parent a9c15ac306
commit 37143b0e23
4 changed files with 22 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ ARG RECIPE
COPY etc /etc
# COPY usr /usr
# copy scripts
RUN mkdir /tmp/scripts
COPY scripts /tmp/scripts
RUN find /tmp/scripts -type f -exec chmod +x {} \;
COPY ${RECIPE} /tmp/ublue-recipe.yml
# yq used in build.sh and the setup-flatpaks recipe to read the recipe.yml

View File

@@ -1,4 +1,13 @@
#!/bin/bash
# run scripts
echo "-- Running scripts defined in recipe.yml --"
buildscripts=$(yq '.scripts[]' < /tmp/ublue-recipe.yml)
for script in $(echo -e "$buildscripts"); do \
echo "Running: ${script}" && \
/tmp/scripts/$script; \
done
echo "---"
# remove the default firefox (from fedora) in favor of the flatpak
rpm-ostree override remove firefox firefox-langpacks

View File

@@ -15,6 +15,11 @@ fedora-version: 37
# This description will be visible in the container metadata
description: A starting point for further customization of uBlue images. Make your own! https://ublue.it/making-your-own/
# These scripts will be executed during the container build
# Place scripts in scripts/ and put the corresponding filename here
scripts:
# - example.sh
# These rpms will be installed from the fedora repository
# using rpm-ostree and will be preinstalled in the final image
rpms:

3
scripts/example.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo 'This is an example shell script'
echo 'Scripts here will run during build if specified in recipe.yml'