Change drone.yml
This commit is contained in:
136
.drone.yml
136
.drone.yml
@@ -117,7 +117,7 @@ steps:
|
||||
- push
|
||||
- tag
|
||||
|
||||
# Сканирование образа на уязвимости (опционально)
|
||||
# Сканирование образа на уязвимости
|
||||
- name: scan-image
|
||||
image: aquasec/trivy
|
||||
commands:
|
||||
@@ -128,137 +128,3 @@ steps:
|
||||
- tag
|
||||
depends_on:
|
||||
- build-and-push
|
||||
|
||||
# Уведомление об успешной сборке (опционально)
|
||||
- name: notify-success
|
||||
image: plugins/slack
|
||||
settings:
|
||||
webhook:
|
||||
from_secret: slack_webhook
|
||||
channel: deployments
|
||||
username: drone
|
||||
template: >
|
||||
✅ Build #{{build.number}} succeeded!
|
||||
|
||||
Repository: {{repo.name}}
|
||||
Branch: {{build.branch}}
|
||||
Commit: {{build.commit}}
|
||||
Author: {{build.author}}
|
||||
|
||||
Docker image: registry.example.com/mc-panel:{{build.commit}}
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
depends_on:
|
||||
- build-and-push
|
||||
|
||||
# Уведомление об ошибке (опционально)
|
||||
- name: notify-failure
|
||||
image: plugins/slack
|
||||
settings:
|
||||
webhook:
|
||||
from_secret: slack_webhook
|
||||
channel: deployments
|
||||
username: drone
|
||||
template: >
|
||||
❌ Build #{{build.number}} failed!
|
||||
|
||||
Repository: {{repo.name}}
|
||||
Branch: {{build.branch}}
|
||||
Commit: {{build.commit}}
|
||||
Author: {{build.author}}
|
||||
|
||||
Link: {{build.link}}
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy-staging
|
||||
|
||||
# Пайплайн для деплоя на staging (опционально)
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- develop
|
||||
|
||||
depends_on:
|
||||
- build-and-publish
|
||||
|
||||
steps:
|
||||
- name: deploy-to-staging
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: staging_host
|
||||
username:
|
||||
from_secret: staging_username
|
||||
key:
|
||||
from_secret: staging_ssh_key
|
||||
port: 22
|
||||
script:
|
||||
- cd /opt/mc-panel
|
||||
- docker-compose pull
|
||||
- docker-compose up -d
|
||||
- docker-compose ps
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy-production
|
||||
|
||||
# Пайплайн для деплоя на production (только для тегов)
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
ref:
|
||||
- refs/tags/v*
|
||||
|
||||
depends_on:
|
||||
- build-and-publish
|
||||
|
||||
steps:
|
||||
- name: deploy-to-production
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: production_host
|
||||
username:
|
||||
from_secret: production_username
|
||||
key:
|
||||
from_secret: production_ssh_key
|
||||
port: 22
|
||||
script:
|
||||
- cd /opt/mc-panel
|
||||
- docker-compose pull
|
||||
- docker-compose up -d
|
||||
- docker-compose ps
|
||||
- echo "Deployed version ${DRONE_TAG}"
|
||||
|
||||
- name: notify-production-deploy
|
||||
image: plugins/slack
|
||||
settings:
|
||||
webhook:
|
||||
from_secret: slack_webhook
|
||||
channel: deployments
|
||||
username: drone
|
||||
template: >
|
||||
🚀 Production deployment successful!
|
||||
|
||||
Version: {{build.tag}}
|
||||
Repository: {{repo.name}}
|
||||
Author: {{build.author}}
|
||||
|
||||
Docker image: registry.example.com/mc-panel:{{build.tag}}
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
|
||||
Reference in New Issue
Block a user