dragon-bot/.drone.yml
2023-05-19 12:08:06 -07:00

63 lines
2.0 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
- name: Notify discord pipeline has started
image: curltools/curl
commands:
- curl --json '{"username": "Drone CI", "avatar_url": "https://miro.medium.com/v2/resize:fit:1358/0*AqO_2lNemh_Fl9Gm.png","content": "Build ${DRONE_BUILD_NUMBER} has started🏁\nhttp://192.168.2.6/ldooks/dragon-bot/${DRONE_BUILD_NUMBER}"}' https://discord.com/api/webhooks/1109178686734868490/DPBYWK5bFrt5ebq433xk9ZWkAxTLkD01WY2K66l2IleQQCG_bUnCzYpjZeTV2-R7oM4j
trigger:
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: Notify discord pipeline has started
image: curltools/curl
commands:
- curl --json '{"username": "Drone CI", "avatar_url": "https://miro.medium.com/v2/resize:fit:1358/0*AqO_2lNemh_Fl9Gm.png","content": "Build ${DRONE_BUILD_NUMBER} has finished\nhttp://192.168.2.6/ldooks/dragon-bot/${DRONE_BUILD_NUMBER}"}' https://discord.com/api/webhooks/1109178686734868490/DPBYWK5bFrt5ebq433xk9ZWkAxTLkD01WY2K66l2IleQQCG_bUnCzYpjZeTV2-R7oM4j
trigger:
event:
- push