@@ -149,38 +149,8 @@
|
||||
];
|
||||
text = builtins.readFile ./cache-restore.sh;
|
||||
};
|
||||
generate = pkgs.writeShellApplication {
|
||||
name = "generate";
|
||||
runtimeInputs = with pkgs; [
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
jq
|
||||
pup
|
||||
];
|
||||
text = ''
|
||||
shopt -s globstar
|
||||
for vars in distros/**/*.pkrvars.hcl.sh; do
|
||||
bash "./''${vars}"
|
||||
done
|
||||
set -x
|
||||
echo "BUILD=$(date "+%Y.%m.%d.%H")" >> build.env
|
||||
'';
|
||||
};
|
||||
shellcheck = pkgs.writeShellApplication {
|
||||
name = "shellcheck";
|
||||
runtimeInputs = with pkgs; [
|
||||
shellcheck
|
||||
];
|
||||
text = ''
|
||||
scripts=()
|
||||
shopt -s globstar
|
||||
for f in **/*.sh; do
|
||||
scripts+=("$f")
|
||||
done
|
||||
shellcheck -e SC2239 "''${scripts[@]}"
|
||||
'';
|
||||
};
|
||||
generate = pkgs.callPackage (import ./nix/generate.nix) { };
|
||||
shellcheck = pkgs.callPackage (import ./nix/shellcheck.nix) { };
|
||||
};
|
||||
|
||||
checks = {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
writeShellApplication,
|
||||
bash,
|
||||
coreutils,
|
||||
curl,
|
||||
jq,
|
||||
pup,
|
||||
}:
|
||||
|
||||
writeShellApplication {
|
||||
name = "generate";
|
||||
runtimeInputs = [
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
jq
|
||||
pup
|
||||
];
|
||||
text = ''
|
||||
shopt -s globstar
|
||||
for vars in distros/**/*.pkrvars.hcl.sh; do
|
||||
bash "./''${vars}"
|
||||
done
|
||||
set -x
|
||||
echo "BUILD=$(date "+%Y.%m.%d.%H")" >> build.env
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ writeShellApplication, shellcheck }:
|
||||
writeShellApplication {
|
||||
name = "shellcheck";
|
||||
runtimeInputs = [
|
||||
shellcheck
|
||||
];
|
||||
text = ''
|
||||
scripts=()
|
||||
shopt -s globstar
|
||||
for f in **/*.sh; do
|
||||
scripts+=("$f")
|
||||
done
|
||||
shellcheck -e SC2239 "''${scripts[@]}"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user