Cum să rulezi build-uri la crearea tag-urilor în Drone CI
DodaTech
Updated 2025-01-15
1 min read
In this tutorial, you'll learn about Cum să rulezi build. We cover key concepts, practical examples, and best practices.
Build-urile declanșate de tag-uri sunt ideale pentru release-uri și deploy-uri automate în producție.
Configurare de bază
kind: pipeline
name: release
steps:
- name: build
image: golang:1.20
commands:
- go build -o app-${DRONE_TAG}
trigger:
event:
- tag
Filtrare după tag
trigger:
event:
- tag
ref:
- refs/tags/v*
- refs/tags/release-*
Release automat
steps:
- name: build
image: golang:1.20
commands:
- go build -o app
- tar -czf app-${DRONE_TAG}.tar.gz app
- name: github-release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: app-${DRONE_TAG}.tar.gz
title: Release ${DRONE_TAG}
Deploy la tag semantic
trigger:
event:
- tag
ref:
include:
- refs/tags/v[0-9]*.[0-9]*.[0-9]*
Prevenire
- Folosește versionare semantică pentru tag-uri
- Testează pipeline-ul înainte de a crea tag-ul
- Verifică filtrele de tag în configurație
DodaTech Tools
Doda Browser notifică despre release-uri noi. DodaZIP arhivează artefactele fiecărui release.
Întrebări frecvente
Construit de echipa Doda Browser, DodaZIP și Durga Antivirus Pro.
← Previous
Cum să semnezi fișierul .drone.yml în Drone CI
Next →
Cum să setezi timeout pentru build-uri în Drone CI
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro