From 721a6b23793e1d7922bfb31b1b4fd70b98163f87 Mon Sep 17 00:00:00 2001 From: Luis Galeas Date: Tue, 24 Sep 2024 06:49:47 +0100 Subject: [PATCH] fix scripts for no tty --- .../code/development-environment/dev_depen_check.sh | 4 ++-- .../code/development-environment/dev_linter_check.sh | 6 ++++-- .../code/development-environment/dev_linter_fix.sh | 3 ++- .../code/development-environment/dev_test.sh | 4 +++- .../code/development-environment/dev_type_check.sh | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/application/backend-monorepo-multiservice/code/development-environment/dev_depen_check.sh b/application/backend-monorepo-multiservice/code/development-environment/dev_depen_check.sh index b2a151bc..6e46d67b 100755 --- a/application/backend-monorepo-multiservice/code/development-environment/dev_depen_check.sh +++ b/application/backend-monorepo-multiservice/code/development-environment/dev_depen_check.sh @@ -2,9 +2,9 @@ set -e echo "Checking dependency tracking for general dependencies" -docker exec -it php-all-services-test "php" "vendor/bin/deptrac" "analyze" "--config-file" "depfile_general.yml" +docker exec -t php-all-services-test "php" "vendor/bin/deptrac" "analyze" "--config-file" "depfile_general.yml" echo "Checking dependency tracking for bounded contexts" -docker exec -it php-all-services-test "php" "vendor/bin/deptrac" "analyze" "--config-file" "depfile_bounded_context.yml" +docker exec -t php-all-services-test "php" "vendor/bin/deptrac" "analyze" "--config-file" "depfile_bounded_context.yml" echo "All dependency checks succesful!!!" \ No newline at end of file diff --git a/application/backend-monorepo-multiservice/code/development-environment/dev_linter_check.sh b/application/backend-monorepo-multiservice/code/development-environment/dev_linter_check.sh index a7a8946c..a3e2a80a 100755 --- a/application/backend-monorepo-multiservice/code/development-environment/dev_linter_check.sh +++ b/application/backend-monorepo-multiservice/code/development-environment/dev_linter_check.sh @@ -1,13 +1,15 @@ #!/bin/bash set -e -if docker exec -it php-all-services-test "php" "vendor/bin/php-cs-fixer" "fix" "--config=.php-cs-fixer.php-highest.php" "--allow-risky=yes" "--dry-run" | grep 'src'; then +echo "Running linter checks" + +if docker exec -t php-all-services-test "php" "vendor/bin/php-cs-fixer" "fix" "--config=.php-cs-fixer.php-highest.php" "--allow-risky=yes" "--dry-run" | grep 'src'; then echo "Styling in ./src failed. To fix run ./dev_linter_fix.sh" exit 1 else echo "Styling in ./src passed." fi -if docker exec -it php-all-services-test "php" "vendor/bin/php-cs-fixer" "fix" "--config=.php-cs-fixer.php-highest.php" "--allow-risky=yes" "--dry-run" | grep 'tests'; then +if docker exec -t php-all-services-test "php" "vendor/bin/php-cs-fixer" "fix" "--config=.php-cs-fixer.php-highest.php" "--allow-risky=yes" "--dry-run" | grep 'tests'; then echo "Styling in ./tests failed. To fix run ./dev_linter_fix.sh" exit 1 else diff --git a/application/backend-monorepo-multiservice/code/development-environment/dev_linter_fix.sh b/application/backend-monorepo-multiservice/code/development-environment/dev_linter_fix.sh index a93d3916..69f94e75 100755 --- a/application/backend-monorepo-multiservice/code/development-environment/dev_linter_fix.sh +++ b/application/backend-monorepo-multiservice/code/development-environment/dev_linter_fix.sh @@ -1,4 +1,5 @@ #!/bin/bash set -e -docker exec -it php-all-services-test "php" "vendor/bin/php-cs-fixer" "fix" "--config=.php-cs-fixer.php-highest.php" "--allow-risky=yes" \ No newline at end of file +echo "Running linter fixes" +docker exec -t php-all-services-test "php" "vendor/bin/php-cs-fixer" "fix" "--config=.php-cs-fixer.php-highest.php" "--allow-risky=yes" \ No newline at end of file diff --git a/application/backend-monorepo-multiservice/code/development-environment/dev_test.sh b/application/backend-monorepo-multiservice/code/development-environment/dev_test.sh index d11e5f2a..ff2fd449 100755 --- a/application/backend-monorepo-multiservice/code/development-environment/dev_test.sh +++ b/application/backend-monorepo-multiservice/code/development-environment/dev_test.sh @@ -1,7 +1,9 @@ #!/bin/bash set -e +echo "Running tests" + # Allows you to do filters as needed -docker exec -it php-all-services-test "php" "vendor/bin/phpunit" "$@" +docker exec -t php-all-services-test "php" "vendor/bin/phpunit" "$@" echo "All tests passed!!!" \ No newline at end of file diff --git a/application/backend-monorepo-multiservice/code/development-environment/dev_type_check.sh b/application/backend-monorepo-multiservice/code/development-environment/dev_type_check.sh index 3e988cb0..248882c1 100755 --- a/application/backend-monorepo-multiservice/code/development-environment/dev_type_check.sh +++ b/application/backend-monorepo-multiservice/code/development-environment/dev_type_check.sh @@ -2,6 +2,6 @@ set -e echo "PHPStan for /srv/src" -docker exec -it php-all-services-test "php" "vendor/bin/phpstan" "analyse" "--level" "max" "-c" "phpstan.src.neon" "-vvv" +docker exec -t php-all-services-test "php" "vendor/bin/phpstan" "analyse" "--level" "max" "-c" "phpstan.src.neon" "-vvv" echo "All type checks succesful!!!" \ No newline at end of file