update drone.yaml to build on push

This commit is contained in:
Viktor Barzin 2026-02-01 21:53:18 +00:00
parent f88bba032f
commit 22aa9c86a7
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863

View file

@ -1,66 +1,56 @@
kind: pipeline
type: kubernetes
name: frontend
timeout: 30m
trigger:
event:
- push
- cron
branch:
- master
- master
event:
- push
steps:
- name: Build frontend image
image: plugins/docker
settings:
username: "viktorbarzin"
username: viktorbarzin
password:
from_secret: dockerhub-token
repo: viktorbarzin/immoweb
dockerfile: crawler/frontend/Dockerfile
context: crawler/frontend
cache_from: "viktorbarzin/immoweb:latest"
auto_tag: true
- name: Update deployment
image: alpine
commands:
- "apk add curl"
- apk add curl
- 'curl -X PATCH https://kubernetes:6443/apis/apps/v1/namespaces/realestate-crawler/deployments/realestate-crawler-ui -H "Authorization:Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type:application/strategic-merge-patch+json" -k -d ''{"spec": {"template": {"metadata": { "annotations": {"kubectl.kubernetes.io/restartedAt": "''$(date +%Y-%m-%dT%TZ)''" }}}}}'' | head'
---
kind: pipeline
type: kubernetes
name: api
timeout: 30m
trigger:
event:
- push
- cron
branch:
- master
- master
event:
- push
steps:
- name: Build backend API image
- name: Build API image
image: plugins/docker
settings:
username: "viktorbarzin"
username: viktorbarzin
password:
from_secret: dockerhub-token
repo: viktorbarzin/realestatecrawler
dockerfile: crawler/Dockerfile
context: crawler/
cache_from: "viktorbarzin/realestatecrawler:latest"
auto_tag: true
- name: Update deployment
image: alpine
commands:
- "apk add curl"
- apk add curl
- 'curl -X PATCH https://kubernetes:6443/apis/apps/v1/namespaces/realestate-crawler/deployments/realestate-crawler-api -H "Authorization:Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type:application/strategic-merge-patch+json" -k -d ''{"spec": {"template": {"metadata": { "annotations": {"kubectl.kubernetes.io/restartedAt": "''$(date +%Y-%m-%dT%TZ)''" }}}}}'' | head'
# Sun Feb 1 08:29:56 PM UTC 2026
# Webhook test Sun Feb 1 08:45:52 PM UTC 2026
# 1769978870
# test 1769979073
# final test 1769979293
# no secret test 1769979359