cd /home/data/links && git commit -m "fix(ci): use bash for script execution in Drone CI
Some checks failed
continuous-integration/drone/push Build is failing

- 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
This commit is contained in:
2025-11-02 06:53:14 +09:00
parent 8b68bcad55
commit 08380a71ef

View File

@@ -42,13 +42,19 @@ steps:
path: /var/run/docker.sock path: /var/run/docker.sock
commands: commands:
- echo "🔍 Running code quality checks..." - 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 - if [ -f scripts/ci/lint.sh ]; then
echo "Found lint.sh, executing..."; echo "Found lint.sh, checking permissions and executing...";
./scripts/ci/lint.sh; 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 elif [ -f scripts/ci/lint-simple.sh ]; then
echo "Found lint-simple.sh, executing..."; echo "Found lint-simple.sh, checking permissions and executing...";
./scripts/ci/lint-simple.sh; ls -la scripts/ci/lint-simple.sh;
chmod +x scripts/ci/lint-simple.sh;
bash scripts/ci/lint-simple.sh;
else else
echo "⚠️ No lint script found, running basic checks..."; echo "⚠️ No lint script found, running basic checks...";
apk add --no-cache git; apk add --no-cache git;
@@ -70,10 +76,12 @@ steps:
- echo "🏗️ Building application..." - echo "🏗️ Building application..."
- if [ -f scripts/ci/build.sh ]; then - if [ -f scripts/ci/build.sh ]; then
echo "Found build.sh, executing..."; 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 elif [ -f scripts/ci/build-simple.sh ]; then
echo "Found build-simple.sh, executing..."; 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 else
echo "⚠️ No build script found, running basic checks..."; echo "⚠️ No build script found, running basic checks...";
apk add --no-cache docker-compose; apk add --no-cache docker-compose;
@@ -99,10 +107,12 @@ steps:
- echo "🧪 Running tests..." - echo "🧪 Running tests..."
- if [ -f scripts/ci/test.sh ]; then - if [ -f scripts/ci/test.sh ]; then
echo "Found test.sh, executing..."; 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 elif [ -f scripts/ci/test-simple.sh ]; then
echo "Found test-simple.sh, executing..."; 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 else
echo "⚠️ No test script found, running basic checks..."; echo "⚠️ No test script found, running basic checks...";
echo "Looking for test files:"; echo "Looking for test files:";
@@ -122,7 +132,8 @@ steps:
- echo "🔒 Running security scans..." - echo "🔒 Running security scans..."
- if [ -f scripts/ci/security-scan.sh ]; then - if [ -f scripts/ci/security-scan.sh ]; then
echo "Found security-scan.sh, executing..."; 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 else
echo "⚠️ No security script found, running basic checks..."; echo "⚠️ No security script found, running basic checks...";
apk add --no-cache grep; apk add --no-cache grep;
@@ -144,7 +155,8 @@ steps:
- echo "🚀 Building production images..." - echo "🚀 Building production images..."
- if [ -f scripts/ci/build-production.sh ]; then - if [ -f scripts/ci/build-production.sh ]; then
echo "Found build-production.sh, executing..."; 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 else
echo "⚠️ build-production.sh not found, skipping production build"; echo "⚠️ build-production.sh not found, skipping production build";
echo "To enable production builds, create scripts/ci/build-production.sh"; echo "To enable production builds, create scripts/ci/build-production.sh";
@@ -168,7 +180,8 @@ steps:
- echo "📦 Publishing artifacts..." - echo "📦 Publishing artifacts..."
- if [ -f scripts/ci/publish.sh ]; then - if [ -f scripts/ci/publish.sh ]; then
echo "Found publish.sh, executing..."; echo "Found publish.sh, executing...";
./scripts/ci/publish.sh; chmod +x scripts/ci/publish.sh;
bash scripts/ci/publish.sh;
else else
echo "⚠️ publish.sh not found, skipping artifact publishing"; echo "⚠️ publish.sh not found, skipping artifact publishing";
echo "To enable publishing, create scripts/ci/publish.sh"; echo "To enable publishing, create scripts/ci/publish.sh";
@@ -188,7 +201,8 @@ steps:
- echo "🚀 Deploying to staging..." - echo "🚀 Deploying to staging..."
- if [ -f scripts/ci/deploy-staging.sh ]; then - if [ -f scripts/ci/deploy-staging.sh ]; then
echo "Found deploy-staging.sh, executing..."; 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 else
echo "⚠️ deploy-staging.sh not found"; echo "⚠️ deploy-staging.sh not found";
echo "Staging deployment would happen here if script exists"; echo "Staging deployment would happen here if script exists";
@@ -209,7 +223,8 @@ steps:
- echo "🚀 Deploying to production..." - echo "🚀 Deploying to production..."
- if [ -f scripts/ci/deploy-production.sh ]; then - if [ -f scripts/ci/deploy-production.sh ]; then
echo "Found deploy-production.sh, executing..."; 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 else
echo "⚠️ deploy-production.sh not found"; echo "⚠️ deploy-production.sh not found";
echo "Production deployment would happen here if script exists"; echo "Production deployment would happen here if script exists";