fix: indexer apps + add ci-job-all app

This commit is contained in:
DavHau 2022-09-01 11:30:05 +02:00
parent 877b83654f
commit 293e906ff2

View File

@ -97,16 +97,20 @@ in rec {
gnugrep gnugrep
]) ])
'' ''
mainBranch=$(git branch | grep -E '(master)|(main)') flake=$(cat flake.nix)
git branch data || : flakeLock=$(cat flake.lock)
git checkout data set -x
git fetch origin data
git checkout origin/data
git checkout -b data
# the flake should always be the one from the current main branch # the flake should always be the one from the current main branch
git checkout $mainBranch flake.nix rm -rf ./*
git checkout $mainBranch flake.lock echo "$flake" > flake.nix
echo "$flakeLock" > flake.lock
${(mkIndexApp name input).program} ${(mkIndexApp name input).program}
${(mkTranslateApp name).program} ${(mkTranslateApp name).program}
git add . git add .
git commit "automatic update - $(date --rfc-3339=seconds)" git commit -m "automatic update - $(date --rfc-3339=seconds)"
'' ''
); );
translateApps = l.listToAttrs ( translateApps = l.listToAttrs (
@ -139,6 +143,30 @@ in rec {
) )
indexes indexes
); );
ciJobAllApp = mkApp (
utils.writePureShellScript
(with pkgs; [
coreutils
git
gnugrep
])
''
flake=$(cat flake.nix)
flakeLock=$(cat flake.lock)
set -x
git fetch origin data
git checkout origin/data
git checkout -b data
# the flake should always be the one from the current main branch
rm -rf ./*
echo "$flake" > flake.nix
echo "$flakeLock" > flake.lock
${lib.concatStringsSep "\n" (l.mapAttrsToList (_: app: app.program) indexApps)}
${lib.concatStringsSep "\n" (l.mapAttrsToList (_: app: app.program) translateApps)}
git add .
git commit -m "automatic update - $(date --rfc-3339=seconds)"
''
);
mkIndexOutputs = name: let mkIndexOutputs = name: let
src = "${toString source}/${name}/locks"; src = "${toString source}/${name}/locks";
@ -167,7 +195,8 @@ in rec {
outputs = { outputs = {
packages = allPackages; packages = allPackages;
apps = apps =
indexApps {ci-job-all = ciJobAllApp;}
// indexApps
// translateApps // translateApps
// ciJobApps; // ciJobApps;
}; };