Compare commits

..

No commits in common. "2876b56afb8c847075b6f3d3e499c112bbef170f" and "3d6ed8604ac778cff35f87ecb8f2baf464fa2add" have entirely different histories.

6 changed files with 8 additions and 44 deletions

View File

@ -4,7 +4,7 @@
hostSystem ? buildSystem,
pkgsNix ? (import ./nix/pkgs.nix),
revision ? "dev",
revision ? "",
releaseName ? "dev",
bootstrap ? null,
@ -28,6 +28,7 @@ in rec {
name = "isle-version";
inherit buildSystem hostSystem revision releaseName;
repoSrc = ./.;
nativeBuildInputs = [ pkgsNative.git ];
@ -40,6 +41,11 @@ in rec {
versionFile=version
if [ "$revision" = "" ]; then
cp -r "$repoSrc" repoSrcCp
revision="$(cd repoSrcCp && git rev-parse HEAD)"
fi
echo "Release: $releaseName" >> "$versionFile"
echo "Platform: $hostSystem" >> "$versionFile"
echo "Git Revision: $revision" >> "$versionFile"
@ -163,10 +169,4 @@ in rec {
mv Isle-* "$out"/bin/isle
'';
};
tests = pkgs.writeShellScript "isle-tests" ''
export PATH=$PATH:${appImage}/bin
test_dir=${./tests}
exec $SHELL $test_dir/entrypoint.sh
'';
}

View File

@ -1,6 +1,5 @@
{
releaseName,
revision,
buildSystem ? builtins.currentSystem,
pkgsNix ? (import ./nix/pkgs.nix),
@ -13,7 +12,7 @@
mkRelease = hostSystem: let
appImage = ((import ./default.nix) {
inherit buildSystem hostSystem releaseName revision;
inherit buildSystem hostSystem releaseName;
}).appImage;
in pkgs.stdenv.mkDerivation {

View File

@ -19,10 +19,7 @@ if [ -e "$out" ]; then
exit 1
fi
revision=$(git rev-parse HEAD)
result=$(nix-build \
--argstr revision "$revision" \
--argstr releaseName "$releaseName" \
--no-out-link \
release.nix \

View File

@ -1,3 +0,0 @@
#!/usr/bin/env sh
$(nix-build --no-out-link -A tests)

View File

@ -1,2 +0,0 @@
version="$(isle version)"
test "$(echo "$version" | wc -l)" -gt 0

View File

@ -1,27 +0,0 @@
set -e
# cd into script's directory
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
tmp="$(mktemp --tmpdir -d isle-tests.XXXXXX)"
trap 'rm -rf $tmp' EXIT
export TMPDIR="$tmp"
echo "tmp dir is $TMPDIR"
echo -e '\nrunning all tests...\n'
for file in $(find . -type f -name '*.sh' | grep -v entrypoint.sh | sort -n); do
echo "running test $file"
if ! $SHELL -e -x "$file" >"$tmp/$file.log" 2>&1; then
echo "TEST FAILED"
echo "output of test is as follows"
echo "------------------------------"
cat "$tmp/$file.log"
echo "------------------------------"
exit 1
fi
done
echo -e '\ntests succeeded!'