83 lines
1.9 KiB
YAML
83 lines
1.9 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: Build and Deploy Pipeline
|
|
|
|
workspace:
|
|
path: /drone/mail-autoconfig
|
|
|
|
steps:
|
|
- name: Build and Publish Docker Image
|
|
image: plugins/docker
|
|
settings:
|
|
auto_tag: true
|
|
repo: git.mifi.dev/mifi-holdings/mail-autoconfig
|
|
registry: git.mifi.dev
|
|
username: <token>
|
|
password:
|
|
from_secret: gitea_package_token
|
|
secrets: [gitea_package_token]
|
|
|
|
- name: Send Deploy Status Notification
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
|
"text": "[{{ repo.name }} - Build # {{ build.number }}] Publish {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
|
"username":"DroneBot"
|
|
}
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Production Deploy Pipeline
|
|
|
|
workspace:
|
|
path: /drone/mail-autoconfig
|
|
|
|
clone:
|
|
disable: true
|
|
|
|
steps:
|
|
- name: Deploy to Production
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://portainer.mifi.dev/api/stacks/webhooks/f7e63722-cafd-4970-8729-9f1936c6a070
|
|
|
|
- name: Send Production Deploy Status
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
|
"text": "[{{ repo.name }} - Build # {{ build.number }}] Production Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
|
"username":"DroneBot"
|
|
}
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
depends_on:
|
|
- Build and Deploy Pipeline
|
|
|
|
trigger:
|
|
event:
|
|
- promote
|
|
target:
|
|
- production
|