5 Commits

Author SHA1 Message Date
7388962a7d Merge branch 'codex/hosting-drone-setup'
Some checks failed
continuous-integration/drone/push Build was killed
2026-03-18 19:14:09 +07:00
7c54c57633 trying to merge this file 2026-03-18 19:12:13 +07:00
05b8efd0f2 Prepare hosting deployment and Drone image builds
Some checks failed
continuous-integration/drone/push Build was killed
continuous-integration/drone/pr Build was killed
2026-03-18 15:26:18 +06:00
fd84094aa4 Another attempt to fix .drone.yml...
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-22 10:37:05 +07:00
7eb2ea5662 An attempt to fix .drone.yml, deleted python-security stage
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-01-22 10:32:21 +07:00

View File

@@ -8,27 +8,21 @@ trigger:
- pull_request
steps:
- name: python-lint
- name: backend-sanity
image: python:3.11-slim
commands:
- cd backend
- pip install flake8
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- pip install --no-cache-dir -r requirements.txt
- python -m py_compile main.py auth.py daemons.py oidc_config.py
- name: frontend-lint
- name: frontend-build-check
image: node:20-alpine
commands:
- cd frontend
- npm ci --silent
- npm run build
- npm run lint || echo "ESLint warnings found"
- name: python-security
image: python:3.11-slim
commands:
- cd backend
- pip install safety
- safety check --file=requirements.txt --exit-zero || echo "Security warnings found"
- name: frontend-security
image: node:20-alpine
commands:
@@ -39,7 +33,7 @@ steps:
---
kind: pipeline
type: docker
name: build-backend
name: build-images
trigger:
branch:
@@ -61,8 +55,9 @@ steps:
repo: registry.nevetime.ru/mc-panel-backend
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
- ${DRONE_BRANCH}
- "${DRONE_BUILD_NUMBER}"
- "${DRONE_COMMIT_SHA:0:8}"
- "${DRONE_BRANCH}"
auto_tag: true
dockerfile: backend/Dockerfile
context: backend
@@ -70,33 +65,7 @@ steps:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- BUILD_DATE=${DRONE_BUILD_CREATED}
- VCS_REF=${DRONE_COMMIT_SHA}
- VERSION=${DRONE_TAG:-${DRONE_BRANCH}}
when:
event:
- push
- tag
---
kind: pipeline
type: docker
name: build-frontend
trigger:
branch:
- main
- master
- develop
event:
- push
- tag
depends_on:
- code-quality
steps:
- name: build-frontend-image
image: plugins/docker
settings:
@@ -104,12 +73,12 @@ steps:
repo: registry.nevetime.ru/mc-panel-frontend
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
- ${DRONE_BRANCH}
- "${DRONE_BUILD_NUMBER}"
- "${DRONE_COMMIT_SHA:0:8}"
- "${DRONE_BRANCH}"
auto_tag: true
dockerfile: frontend/Dockerfile
context: frontend
target: production
username:
from_secret: docker_username
password:
@@ -148,8 +117,8 @@ steps:
repo: registry.nevetime.ru/mc-panel
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
- ${DRONE_BRANCH}
- "${DRONE_COMMIT_SHA:0:8}"
- "${DRONE_BRANCH}"
auto_tag: true
dockerfile: Dockerfile
context: .
@@ -165,69 +134,3 @@ steps:
event:
- push
- tag
---
kind: pipeline
type: docker
name: deploy-staging
trigger:
branch:
- develop
event:
- push
depends_on:
- build-backend
- build-frontend
- build-monolith
steps:
- name: deploy-separate-services
image: alpine:latest
environment:
STAGING_HOST:
from_secret: staging_host
STAGING_USER:
from_secret: staging_user
STAGING_KEY:
from_secret: staging_ssh_key
commands:
- apk add --no-cache openssh-client
- echo "Deploying separate services to staging..."
- echo "$STAGING_KEY" | base64 -d > /tmp/ssh_key
- chmod 600 /tmp/ssh_key
- ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key $STAGING_USER@$STAGING_HOST "docker pull registry.nevetime.ru/mc-panel-backend:${DRONE_COMMIT_SHA:0:8} && docker pull registry.nevetime.ru/mc-panel-frontend:${DRONE_COMMIT_SHA:0:8}"
---
kind: pipeline
type: docker
name: deploy-production
trigger:
ref:
- refs/tags/v*
event:
- tag
depends_on:
- build-backend
- build-frontend
- build-monolith
steps:
- name: deploy-separate-services
image: alpine:latest
environment:
PROD_HOST:
from_secret: production_host
PROD_USER:
from_secret: production_user
PROD_KEY:
from_secret: production_ssh_key
commands:
- apk add --no-cache openssh-client
- echo "Deploying separate services to production..."
- echo "$PROD_KEY" | base64 -d > /tmp/ssh_key
- chmod 600 /tmp/ssh_key
- ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key $PROD_USER@$PROD_HOST "docker pull registry.nevetime.ru/mc-panel-backend:${DRONE_TAG} && docker pull registry.nevetime.ru/mc-panel-frontend:${DRONE_TAG}"