diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-01-03 14:02:54 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-01-03 14:02:54 -0600 |
| commit | 4c982fda3cb120f72ce23f583e0b2b332b73f86e (patch) | |
| tree | 841dafeda66887c42aaf653aef3c3b3f16a8f4f0 /bin | |
| parent | 25b99dec06be8b2f47c7cd3eff7ffeda42575089 (diff) | |
| download | slskd-4c982fda3cb120f72ce23f583e0b2b332b73f86e.tar.gz | |
tweak build scripts
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/build | 62 | ||||
| -rwxr-xr-x | bin/publish | 15 |
2 files changed, 57 insertions, 20 deletions
@@ -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 |
