Compare commits
No commits in common. "2876b56afb8c847075b6f3d3e499c112bbef170f" and "3d6ed8604ac778cff35f87ecb8f2baf464fa2add" have entirely different histories.
2876b56afb
...
3d6ed8604a
14
default.nix
14
default.nix
@ -4,7 +4,7 @@
|
|||||||
hostSystem ? buildSystem,
|
hostSystem ? buildSystem,
|
||||||
pkgsNix ? (import ./nix/pkgs.nix),
|
pkgsNix ? (import ./nix/pkgs.nix),
|
||||||
|
|
||||||
revision ? "dev",
|
revision ? "",
|
||||||
releaseName ? "dev",
|
releaseName ? "dev",
|
||||||
|
|
||||||
bootstrap ? null,
|
bootstrap ? null,
|
||||||
@ -28,6 +28,7 @@ in rec {
|
|||||||
name = "isle-version";
|
name = "isle-version";
|
||||||
|
|
||||||
inherit buildSystem hostSystem revision releaseName;
|
inherit buildSystem hostSystem revision releaseName;
|
||||||
|
repoSrc = ./.;
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgsNative.git ];
|
nativeBuildInputs = [ pkgsNative.git ];
|
||||||
|
|
||||||
@ -40,6 +41,11 @@ in rec {
|
|||||||
|
|
||||||
versionFile=version
|
versionFile=version
|
||||||
|
|
||||||
|
if [ "$revision" = "" ]; then
|
||||||
|
cp -r "$repoSrc" repoSrcCp
|
||||||
|
revision="$(cd repoSrcCp && git rev-parse HEAD)"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Release: $releaseName" >> "$versionFile"
|
echo "Release: $releaseName" >> "$versionFile"
|
||||||
echo "Platform: $hostSystem" >> "$versionFile"
|
echo "Platform: $hostSystem" >> "$versionFile"
|
||||||
echo "Git Revision: $revision" >> "$versionFile"
|
echo "Git Revision: $revision" >> "$versionFile"
|
||||||
@ -163,10 +169,4 @@ in rec {
|
|||||||
mv Isle-* "$out"/bin/isle
|
mv Isle-* "$out"/bin/isle
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
tests = pkgs.writeShellScript "isle-tests" ''
|
|
||||||
export PATH=$PATH:${appImage}/bin
|
|
||||||
test_dir=${./tests}
|
|
||||||
exec $SHELL $test_dir/entrypoint.sh
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
releaseName,
|
releaseName,
|
||||||
revision,
|
|
||||||
|
|
||||||
buildSystem ? builtins.currentSystem,
|
buildSystem ? builtins.currentSystem,
|
||||||
pkgsNix ? (import ./nix/pkgs.nix),
|
pkgsNix ? (import ./nix/pkgs.nix),
|
||||||
@ -13,7 +12,7 @@
|
|||||||
mkRelease = hostSystem: let
|
mkRelease = hostSystem: let
|
||||||
|
|
||||||
appImage = ((import ./default.nix) {
|
appImage = ((import ./default.nix) {
|
||||||
inherit buildSystem hostSystem releaseName revision;
|
inherit buildSystem hostSystem releaseName;
|
||||||
}).appImage;
|
}).appImage;
|
||||||
|
|
||||||
in pkgs.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
|
@ -19,10 +19,7 @@ if [ -e "$out" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
revision=$(git rev-parse HEAD)
|
|
||||||
|
|
||||||
result=$(nix-build \
|
result=$(nix-build \
|
||||||
--argstr revision "$revision" \
|
|
||||||
--argstr releaseName "$releaseName" \
|
--argstr releaseName "$releaseName" \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
release.nix \
|
release.nix \
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
version="$(isle version)"
|
|
||||||
test "$(echo "$version" | wc -l)" -gt 0
|
|
@ -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!'
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user