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
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:
43
.drone.yml
43
.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";
|
||||
|
||||
Reference in New Issue
Block a user