aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/build62
-rwxr-xr-xbin/publish15
2 files changed, 57 insertions, 20 deletions
diff --git a/bin/build b/bin/build
index 6eaf55e0..23eaa5d0 100755
--- a/bin/build
+++ b/bin/build
@@ -1,16 +1,42 @@
#!/bin/bash
set -e
+web_only=false
+skip_tests=false
+
+while test $# -gt 0; do
+ case "$1" in
+ -h|--help)
+ echo 'options:'
+ echo '-h, --help show help'
+ echo '--web-only skip dotnet build'
+ echo '--skip-tests skip execution of npm and dotnet tests'
+ exit 0
+ ;;
+ --web-only)
+ web_only=true
+ shift
+ ;;
+ --skip-tests)
+ skip_tests=true
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
# build web
cd src/web
echo $'\n> pwd\n'
pwd
-echo $'\n> npm install\n'
-npm install
+echo $'\n> npm ci\n'
+npm ci
-if [ ! "$1" == "--skip-tests" ]; then
+if [ "$skip_tests" == false ]; then
echo $'\n> npm run test-unattended\n'
npm run test-unattended
else
@@ -29,23 +55,27 @@ touch ../slskd/wwwroot/.gitkeep
echo $'\n> cp -r build/* ../slskd/wwwroot/\n'
cp -r build/* ../slskd/wwwroot/
-# build api + web
-cd ../slskd
+if [ "$web_only" == true ]; then
+ echo $'\ndotnet build skipped\n'
+else
+ # build api + web
+ cd ../slskd
-echo $'\n> pwd\n'
-pwd
+ echo $'\n> pwd\n'
+ pwd
-echo $'\n> dotnet build --no-incremental --nologo --configuration Release\n'
-dotnet build --no-incremental --nologo --configuration Release
+ echo $'\n> dotnet build --no-incremental --nologo --configuration Release\n'
+ dotnet build --no-incremental --nologo --configuration Release
-if [ ! "$1" == "--skip-tests" ]; then
- echo $'\n> dotnet test --configuration Release ../../tests/slskd.Tests.Unit'
- dotnet test --configuration Release ../../tests/slskd.Tests.Unit
+ if [ "$skip_tests" == false ]; then
+ echo $'\n> dotnet test --configuration Release ../../tests/slskd.Tests.Unit'
+ dotnet test --configuration Release ../../tests/slskd.Tests.Unit
- echo $'\n> ddotnet test --configuration Release ../../tests/slskd.Tests.Integration'
- dotnet test --configuration Release ../../tests/slskd.Tests.Integration
-else
- echo $'\ntests skipped\n'
+ echo $'\n> ddotnet test --configuration Release ../../tests/slskd.Tests.Integration'
+ dotnet test --configuration Release ../../tests/slskd.Tests.Integration
+ else
+ echo $'\ntests skipped\n'
+ fi
fi
echo $'\nbuild succeded.' \ No newline at end of file
diff --git a/bin/publish b/bin/publish
index 6e53ae90..dfcfc315 100755
--- a/bin/publish
+++ b/bin/publish
@@ -5,7 +5,14 @@ build=true
while test $# -gt 0; do
case "$1" in
- --no-build)
+ -h|--help)
+ echo 'options:'
+ echo '-h, --help show help'
+ echo '--no-web-build skip web build'
+ echo '--runtine a valid RID (https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)'
+ exit 0
+ ;;
+ --no-web-build)
build=false
shift
;;
@@ -26,10 +33,10 @@ if [ -z "$runtime" ]; then
fi
if [ "$build" == true ]; then
- echo $'\n> bin/build\n'
- bin/build
+ echo $'\n> bin/build --web-only --skip-tests\n'
+ bin/build --web-only --skip-tests
else
- echo $'\n build skipped\n'
+ echo $'\nbuild skipped\n'
fi
cd src/slskd