From 08380a71ef993b724a32d37d1efd3aa2710fd35a Mon Sep 17 00:00:00 2001 From: "Andrey K. Choi" Date: Sun, 2 Nov 2025 06:53:14 +0900 Subject: [PATCH] cd /home/data/links && git commit -m "fix(ci): use bash for script execution in Drone CI - Replace ./scripts/ci/*.sh with bash scripts/ci/*.sh for better compatibility - Add chmod +x before script execution to ensure permissions - Add debugging info showing current directory and file permissions - This should resolve the 'script not found' error even when files exist The issue was that ./script.sh requires the script to be in PATH or current dir with execute permissions, while bash script.sh explicitly invokes bash interpreter" s --- .drone.yml | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4996c73..bad6f30 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,13 +42,19 @@ steps: path: /var/run/docker.sock commands: - echo "๐Ÿ” Running code quality checks..." - - ls -la scripts/ci/ || echo "CI scripts directory not found" + - echo "Current directory:" $(pwd) + - echo "Directory contents:" && ls -la + - echo "CI scripts directory:" && ls -la scripts/ci/ || echo "CI scripts directory not found" - if [ -f scripts/ci/lint.sh ]; then - echo "Found lint.sh, executing..."; - ./scripts/ci/lint.sh; + echo "Found lint.sh, checking permissions and executing..."; + ls -la scripts/ci/lint.sh; + chmod +x scripts/ci/lint.sh; + bash scripts/ci/lint.sh; elif [ -f scripts/ci/lint-simple.sh ]; then - echo "Found lint-simple.sh, executing..."; - ./scripts/ci/lint-simple.sh; + echo "Found lint-simple.sh, checking permissions and executing..."; + ls -la scripts/ci/lint-simple.sh; + chmod +x scripts/ci/lint-simple.sh; + bash scripts/ci/lint-simple.sh; else echo "โš ๏ธ No lint script found, running basic checks..."; apk add --no-cache git; @@ -70,10 +76,12 @@ steps: - echo "๐Ÿ—๏ธ Building application..." - if [ -f scripts/ci/build.sh ]; then echo "Found build.sh, executing..."; - ./scripts/ci/build.sh; + chmod +x scripts/ci/build.sh; + bash scripts/ci/build.sh; elif [ -f scripts/ci/build-simple.sh ]; then echo "Found build-simple.sh, executing..."; - ./scripts/ci/build-simple.sh; + chmod +x scripts/ci/build-simple.sh; + bash scripts/ci/build-simple.sh; else echo "โš ๏ธ No build script found, running basic checks..."; apk add --no-cache docker-compose; @@ -99,10 +107,12 @@ steps: - echo "๐Ÿงช Running tests..." - if [ -f scripts/ci/test.sh ]; then echo "Found test.sh, executing..."; - ./scripts/ci/test.sh; + chmod +x scripts/ci/test.sh; + bash scripts/ci/test.sh; elif [ -f scripts/ci/test-simple.sh ]; then echo "Found test-simple.sh, executing..."; - ./scripts/ci/test-simple.sh; + chmod +x scripts/ci/test-simple.sh; + bash scripts/ci/test-simple.sh; else echo "โš ๏ธ No test script found, running basic checks..."; echo "Looking for test files:"; @@ -122,7 +132,8 @@ steps: - echo "๐Ÿ”’ Running security scans..." - if [ -f scripts/ci/security-scan.sh ]; then echo "Found security-scan.sh, executing..."; - ./scripts/ci/security-scan.sh; + chmod +x scripts/ci/security-scan.sh; + bash scripts/ci/security-scan.sh; else echo "โš ๏ธ No security script found, running basic checks..."; apk add --no-cache grep; @@ -144,7 +155,8 @@ steps: - echo "๐Ÿš€ Building production images..." - if [ -f scripts/ci/build-production.sh ]; then echo "Found build-production.sh, executing..."; - ./scripts/ci/build-production.sh; + chmod +x scripts/ci/build-production.sh; + bash scripts/ci/build-production.sh; else echo "โš ๏ธ build-production.sh not found, skipping production build"; echo "To enable production builds, create scripts/ci/build-production.sh"; @@ -168,7 +180,8 @@ steps: - echo "๐Ÿ“ฆ Publishing artifacts..." - if [ -f scripts/ci/publish.sh ]; then echo "Found publish.sh, executing..."; - ./scripts/ci/publish.sh; + chmod +x scripts/ci/publish.sh; + bash scripts/ci/publish.sh; else echo "โš ๏ธ publish.sh not found, skipping artifact publishing"; echo "To enable publishing, create scripts/ci/publish.sh"; @@ -188,7 +201,8 @@ steps: - echo "๐Ÿš€ Deploying to staging..." - if [ -f scripts/ci/deploy-staging.sh ]; then echo "Found deploy-staging.sh, executing..."; - ./scripts/ci/deploy-staging.sh; + chmod +x scripts/ci/deploy-staging.sh; + bash scripts/ci/deploy-staging.sh; else echo "โš ๏ธ deploy-staging.sh not found"; echo "Staging deployment would happen here if script exists"; @@ -209,7 +223,8 @@ steps: - echo "๐Ÿš€ Deploying to production..." - if [ -f scripts/ci/deploy-production.sh ]; then echo "Found deploy-production.sh, executing..."; - ./scripts/ci/deploy-production.sh; + chmod +x scripts/ci/deploy-production.sh; + bash scripts/ci/deploy-production.sh; else echo "โš ๏ธ deploy-production.sh not found"; echo "Production deployment would happen here if script exists";