Skip to content

Commit

Permalink
chore: Install jq and prefer over yq for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpinder committed Nov 23, 2024
1 parent 5af92e5 commit bf34e3e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
rustc
bacon
earthly
yq
jq
nixpkgs-fmt
];
Expand Down
9 changes: 9 additions & 0 deletions scripts/pre_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -euo pipefail

if ! command -v jq > /dev/null; then
rpm-ostree install jq
fi

ostree container commit
6 changes: 3 additions & 3 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ if [ -f /etc/os-release ]; then
if [ "$ID" = "alpine" ]; then
echo "Setting up Alpine based image to run BlueBuild modules"
apk update
apk add --no-cache bash curl coreutils wget grep
apk add --no-cache bash curl coreutils wget grep jq
elif [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
echo "Setting up Ubuntu based image to run BlueBuild modules"
apt-get update
apt-get install -y bash curl coreutils wget
apt-get install -y bash curl coreutils wget jq
elif [ "$ID" = "fedora" ]; then
echo "Settig up Fedora based image to run BlueBuild modules"
dnf install -y --refresh bash curl wget coreutils
dnf install -y --refresh bash curl wget coreutils jq
else
echo "OS not detected, proceeding without setup"
fi
Expand Down
3 changes: 3 additions & 0 deletions template/templates/Containerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ RUN --mount=type=bind,from=stage-bins,src=/bins,dst=/tmp/bins \
&& cp /tmp/bins/* /usr/bin/ \
&& ostree container commit

RUN --mount=type=bind,from={{ build_scripts_image }},src=/scripts/,dst=/scripts/ \
/scripts/pre_build.sh

{% call modules::main_modules_run(recipe.modules_ext, os_version) %}

RUN --mount=type=bind,from={{ build_scripts_image }},src=/scripts/,dst=/scripts/ \
Expand Down

0 comments on commit bf34e3e

Please sign in to comment.