79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: Pipeline started discord notification
|
|
image: appleboy/drone-discord
|
|
settings:
|
|
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: "Pipeline ${DRONE_BUILD_NUMBER} has started\nhttp://192.168.2.6/ldooks/dragon-bot/${DRONE_BUILD_NUMBER}"
|
|
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
|
|
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: Pipeline Completed discord notification
|
|
image: appleboy/drone-discord
|
|
settings:
|
|
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: "Pipeline ${DRONE_BUILD_NUMBER} has succeeded\nhttp://192.168.2.6/ldooks/dragon-bot/${DRONE_BUILD_NUMBER} ✅"
|
|
trigger:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|