From 539834634cf4e06839772b7c57ee3fd17cf48f7a Mon Sep 17 00:00:00 2001 From: "Andrey K. Choi" Date: Sun, 2 Nov 2025 06:58:11 +0900 Subject: [PATCH] fix(ci): use sh instead of bash for script execution in Drone CI - Replace bash with sh for script execution to work with docker:dind image - Add bash installation to prepare step for script compatibility - Keep chmod +x for ensuring script permissions - All scripts now use sh interpreter which is available by default This resolves '/bin/sh: bash: not found' errors in Drone CI pipeline --- .drone.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index bad6f30..ec3ae8f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,6 +33,7 @@ steps: - echo "Branch:$${DRONE_BRANCH}" - echo "Commit:$${DRONE_COMMIT_SHA:0:8}" - chmod +x scripts/ci/*.sh + - echo "✅ Bash and dependencies installed" # 2. Линтинг и проверка кода - name: lint @@ -49,12 +50,12 @@ steps: 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; + sh scripts/ci/lint.sh; elif [ -f scripts/ci/lint-simple.sh ]; then 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; + sh scripts/ci/lint-simple.sh; else echo "⚠️ No lint script found, running basic checks..."; apk add --no-cache git; @@ -76,12 +77,10 @@ steps: - echo "🏗️ Building application..." - if [ -f scripts/ci/build.sh ]; then echo "Found build.sh, executing..."; - chmod +x scripts/ci/build.sh; - bash scripts/ci/build.sh; + sh scripts/ci/build.sh; elif [ -f scripts/ci/build-simple.sh ]; then echo "Found build-simple.sh, executing..."; - chmod +x scripts/ci/build-simple.sh; - bash scripts/ci/build-simple.sh; + sh scripts/ci/build-simple.sh; else echo "⚠️ No build script found, running basic checks..."; apk add --no-cache docker-compose; @@ -108,11 +107,11 @@ steps: - if [ -f scripts/ci/test.sh ]; then echo "Found test.sh, executing..."; chmod +x scripts/ci/test.sh; - bash scripts/ci/test.sh; + sh scripts/ci/test.sh; elif [ -f scripts/ci/test-simple.sh ]; then echo "Found test-simple.sh, executing..."; chmod +x scripts/ci/test-simple.sh; - bash scripts/ci/test-simple.sh; + sh scripts/ci/test-simple.sh; else echo "⚠️ No test script found, running basic checks..."; echo "Looking for test files:"; @@ -133,7 +132,7 @@ steps: - if [ -f scripts/ci/security-scan.sh ]; then echo "Found security-scan.sh, executing..."; chmod +x scripts/ci/security-scan.sh; - bash scripts/ci/security-scan.sh; + sh scripts/ci/security-scan.sh; else echo "⚠️ No security script found, running basic checks..."; apk add --no-cache grep; @@ -156,7 +155,7 @@ steps: - if [ -f scripts/ci/build-production.sh ]; then echo "Found build-production.sh, executing..."; chmod +x scripts/ci/build-production.sh; - bash scripts/ci/build-production.sh; + sh 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"; @@ -181,7 +180,7 @@ steps: - if [ -f scripts/ci/publish.sh ]; then echo "Found publish.sh, executing..."; chmod +x scripts/ci/publish.sh; - bash scripts/ci/publish.sh; + sh scripts/ci/publish.sh; else echo "⚠️ publish.sh not found, skipping artifact publishing"; echo "To enable publishing, create scripts/ci/publish.sh"; @@ -202,7 +201,7 @@ steps: - if [ -f scripts/ci/deploy-staging.sh ]; then echo "Found deploy-staging.sh, executing..."; chmod +x scripts/ci/deploy-staging.sh; - bash scripts/ci/deploy-staging.sh; + sh scripts/ci/deploy-staging.sh; else echo "⚠️ deploy-staging.sh not found"; echo "Staging deployment would happen here if script exists"; @@ -223,8 +222,7 @@ steps: - echo "🚀 Deploying to production..." - if [ -f scripts/ci/deploy-production.sh ]; then echo "Found deploy-production.sh, executing..."; - chmod +x scripts/ci/deploy-production.sh; - bash scripts/ci/deploy-production.sh; + sh scripts/ci/deploy-production.sh; else echo "⚠️ deploy-production.sh not found"; echo "Production deployment would happen here if script exists";