dragon-bot/.drone.yml
2023-05-22 09:52:57 -07:00

81 lines
2.4 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: docker
name: Build and Push docker image
steps:
- name: Post pipeline status to discord
image: appleboy/drone-discord
settings:
username: Drone CI Bot
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
avatar_url: https://miro.medium.com/v2/resize:fit:1358/0*AqO_2lNemh_Fl9Gm.png
message: "Drone build [[#{{build.number}}]({{build.link}})] has started"
trigger:
branch:
- master
event:
- push
- name: lint-python
image: python:3.10-slim
commands:
- pip install -U -q black
- black --fast --check .
trigger:
event:
- push
- name: docker-build
image: plugins/docker
settings:
username: ldooks
password:
from_secret: docker_token
repo: ldooks/dragon-bot
platform: linux/amd64
purge: false
tags:
- latest
- ${DRONE_BUILD_NUMBER}
trigger:
branch:
- master
event:
- push
- name: sync_argo
# stage: .post
image: python:alpine
environment:
ARGOCD_TOKEN:
from_secret: ARGOCD_TOKEN
commands:
- apk add --no-cache jq curl
- latest=$(curl -sL https://api.github.com/repos/argoproj/argo-cd/releases/latest | jq -r '.assets[] | select( .name | contains("argocd-linux-amd64")).browser_download_url')
- curl -Ls $latest -o /tmp/argocd && chmod +x /tmp/argocd
- /tmp/argocd --insecure --server 192.168.2.205 --auth-token $ARGOCD_TOKEN app set dragon-bot --helm-set image.tag=${DRONE_BUILD_NUMBER}
trigger:
branch:
- master
event:
- push
- name: Post pipeline starting to discord
image: appleboy/drone-discord
settings:
username: Drone CI Bot
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
avatar_url: https://miro.medium.com/v2/resize:fit:1358/0*AqO_2lNemh_Fl9Gm.png
message: "{{#success build.status}}✅{{else}}❌{{/success}} Repository `[{{repo.name}}/{{commit.branch}}]` triggered by event `[{{uppercase build.event}}]` for build.\n - Commit [[{{commit.sha}}]({{commit.link}})]\n - Author `[{{commit.author}} / {{commit.email}}]`\n - Message: {{commit.message}} - Drone build [[#{{build.number}}]({{build.link}})] reported `[{{uppercase build.status}}]` at `[{{datetime build.finished \"2006.01.02 15:04\" \"\"}}]`\n"
trigger:
branch:
- master
event:
- push