Compare commits

..

12 Commits

Author SHA1 Message Date
38e1058e05 Merge pull request 'drone yml update' (#12) from develop into test
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #12
2026-03-27 21:36:01 +03:00
Bulut Kuru
acd3298c61 drone yml update 2026-03-27 21:35:37 +03:00
486d1b55c5 Merge pull request 'develop' (#10) from develop into test
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Reviewed-on: #10
2026-03-27 20:56:42 +03:00
Bulut Kuru
733607493a deploy sh6
All checks were successful
continuous-integration/drone/pr Build is passing
2026-03-27 20:54:05 +03:00
Bulut Kuru
8bd35c425d deploy sh5
Some checks reported errors
continuous-integration/drone/push Build was killed
2026-03-27 20:53:18 +03:00
Bulut Kuru
5ad61853b4 Simplify Drone pipeline for test and prod only
All checks were successful
continuous-integration/drone/push Build is passing
2026-03-27 20:51:20 +03:00
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
5 changed files with 46 additions and 32 deletions

View File

@@ -3,27 +3,13 @@ type: docker
name: bogazici-api
trigger:
event:
- push
branch:
- develop
- test
- main
steps:
- name: laravel-check
image: php:8.4-cli
when:
branch:
- develop
commands:
- apt-get update && apt-get install -y git unzip curl libzip-dev libicu-dev default-mysql-client
- docker-php-ext-install pdo_mysql zip intl
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- cp .env.example .env || true
- composer install --no-interaction --prefer-dist --optimize-autoloader
- php artisan key:generate --force || true
- php artisan optimize:clear || true
- php artisan test || true
- name: deploy-test
image: appleboy/drone-ssh
when:

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

@@ -5,7 +5,6 @@ services:
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,29 @@ 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 rm -f bogazici-api-prod-bdc-api-prod-1 2>/dev/null || true
docker rm -f bdc-api-prod 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 --no-dev
docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" exec -T "$CONTAINER" php artisan optimize:clear

View File

@@ -37,14 +37,29 @@ if ! grep -q '^APP_KEY=base64:' .env; then
exit 1
fi
mkdir -p "$UPLOADS_DIR"/{images,videos,hero-slides,settings,pages,courses,announcements,categories}
find "$UPLOADS_DIR" -type d -exec chmod 2775 {} \; 2>/dev/null || true
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 rm -f bogazici-api-test-bdc-api-test-1 2>/dev/null || true
docker rm -f bdc-api-test 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