Compare commits

...

11 Commits

Author SHA1 Message Date
1fd5cab540 Merge pull request 'deploy sh4' (#9) from develop into test
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #9
2026-03-27 14:58:46 +03:00
Bulut Kuru
272010d738 deploy sh4
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2026-03-27 14:55:05 +03:00
72da6a7600 Merge pull request 'deploy sh3' (#7) from develop into test
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Reviewed-on: #7
2026-03-27 14:41:37 +03:00
Bulut Kuru
9e88de9902 deploy sh3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-27 14:40:18 +03:00
87fbf98858 Merge pull request 'deploy sh2' (#6) from develop into test
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #6
2026-03-27 14:37:50 +03:00
Bulut Kuru
fa14e752ac deploy sh2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-27 14:36:01 +03:00
a24c2f18d8 Merge pull request 'develop' (#4) from develop into test
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Reviewed-on: #4
2026-03-27 14:25:43 +03:00
Bulut Kuru
fea885f6cf Fix Drone test deploy without sudo
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2026-03-27 14:23:49 +03:00
Bulut Kuru
268bf371df Fix Drone test deploy without sudo 2026-03-27 14:23:27 +03:00
49f9f69b1e Merge pull request 'deploy sh1' (#3) from develop into test
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #3
2026-03-27 14:13:08 +03:00
c7e251cc1c Merge pull request 'develop' (#2) from develop into test
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
Reviewed-on: #2
2026-03-27 13:39:44 +03:00
4 changed files with 40 additions and 22 deletions

View File

@@ -1,9 +1,10 @@
name: bogazici-api-prod
services:
bdc-api-prod:
build:
context: .
dockerfile: Dockerfile
container_name: bdc-api-prod
restart: unless-stopped
volumes:
- ./:/var/www/html

View File

@@ -1,9 +1,10 @@
name: bogazici-api-test
services:
bdc-api-test:
build:
context: .
dockerfile: Dockerfile
container_name: bdc-api-test
restart: unless-stopped
volumes:
- ./:/var/www/html

View File

@@ -15,11 +15,10 @@ cd "$PROJECT_DIR"
git config --global --add safe.directory "$PROJECT_DIR" || true
sudo chown -R "$USER":www-data storage bootstrap/cache 2>/dev/null || true
sudo find storage -type d -exec chmod 2775 {} \; 2>/dev/null || true
sudo find storage -type f -exec chmod 664 {} \; 2>/dev/null || true
sudo find bootstrap/cache -type d -exec chmod 2775 {} \; 2>/dev/null || true
sudo find bootstrap/cache -type f -exec chmod 664 {} \; 2>/dev/null || true
find storage -type d -exec chmod 2775 {} \; 2>/dev/null || true
find storage -type f -exec chmod 664 {} \; 2>/dev/null || true
find bootstrap/cache -type d -exec chmod 2775 {} \; 2>/dev/null || true
find bootstrap/cache -type f -exec chmod 664 {} \; 2>/dev/null || true
git fetch origin
git checkout "$BRANCH"
@@ -38,15 +37,23 @@ if ! grep -q '^APP_KEY=base64:' .env; then
exit 1
fi
sudo mkdir -p "$UPLOADS_DIR"/{images,videos,hero-slides,settings,pages,courses,announcements,categories}
sudo chown -R "$USER":www-data "$UPLOADS_DIR" 2>/dev/null || true
sudo find "$UPLOADS_DIR" -type d -exec chmod 2775 {} \; 2>/dev/null || true
sudo find "$UPLOADS_DIR" -type f -exec chmod 664 {} \; 2>/dev/null || true
mkdir -p "$UPLOADS_DIR"
chmod 2775 "$UPLOADS_DIR" 2>/dev/null || true
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" down --remove-orphans || true
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" up -d --build
sleep 5
for i in {1..30}; do
if docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" ps --status running | grep -q "$CONTAINER"; then
break
fi
if [ "$i" -eq 30 ]; then
echo "❌ HATA: Container zamanında ayağa kalkmadı"
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" logs --tail=100
exit 1
fi
sleep 1
done
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" exec -T "$CONTAINER" composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" exec -T "$CONTAINER" php artisan optimize:clear

View File

@@ -15,11 +15,10 @@ cd "$PROJECT_DIR"
git config --global --add safe.directory "$PROJECT_DIR" || true
sudo chown -R "$USER":www-data storage bootstrap/cache 2>/dev/null || true
sudo find storage -type d -exec chmod 2775 {} \; 2>/dev/null || true
sudo find storage -type f -exec chmod 664 {} \; 2>/dev/null || true
sudo find bootstrap/cache -type d -exec chmod 2775 {} \; 2>/dev/null || true
sudo find bootstrap/cache -type f -exec chmod 664 {} \; 2>/dev/null || true
find storage -type d -exec chmod 2775 {} \; 2>/dev/null || true
find storage -type f -exec chmod 664 {} \; 2>/dev/null || true
find bootstrap/cache -type d -exec chmod 2775 {} \; 2>/dev/null || true
find bootstrap/cache -type f -exec chmod 664 {} \; 2>/dev/null || true
git fetch origin
git checkout "$BRANCH"
@@ -38,15 +37,25 @@ if ! grep -q '^APP_KEY=base64:' .env; then
exit 1
fi
sudo mkdir -p "$UPLOADS_DIR"/{images,videos,hero-slides,settings,pages,courses,announcements,categories}
sudo chown -R "$USER":www-data "$UPLOADS_DIR" 2>/dev/null || true
sudo find "$UPLOADS_DIR" -type d -exec chmod 2775 {} \; 2>/dev/null || true
sudo find "$UPLOADS_DIR" -type f -exec chmod 664 {} \; 2>/dev/null || true
mkdir -p "$UPLOADS_DIR"
chmod 2775 "$UPLOADS_DIR" 2>/dev/null || true
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" down --remove-orphans || true
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" up -d --build
sleep 5
echo "⏳ Container hazır olması bekleniyor..."
for i in {1..30}; do
if docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" ps --status running | grep -q "$CONTAINER"; then
echo "✅ Container ayakta"
break
fi
if [ "$i" -eq 30 ]; then
echo "❌ HATA: Container zamanında ayağa kalkmadı"
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" logs --tail=100
exit 1
fi
sleep 1
done
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" exec -T "$CONTAINER" composer install --no-interaction --prefer-dist --optimize-autoloader
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" exec -T "$CONTAINER" php artisan optimize:clear