definisi jobs.deployment.strategy
Strategi penyebaran memungkinkan Anda mengonfigurasi bagaimana pembaruan dikirimkan.
Definisi yang mereferensikan definisi ini: jobs.deployment
Implementasi
Penerapan | Deskripsi |
---|---|
strategi: runOnce | Jalankan strategi penyebaran sekali. |
strategi: bergulir | Strategi penyebaran bergulir. |
strategi: kenari | Strategi penyebaran kenari. |
Keterangan
Saat Anda menyebarkan pembaruan aplikasi, penting bahwa teknik yang Anda gunakan untuk memberikan pembaruan akan:
- Aktifkan inisialisasi.
- Sebarkan pembaruan.
- Arahkan lalu lintas ke versi yang diperbarui.
- Uji versi yang diperbarui setelah merutekan lalu lintas.
- Jika terjadi kegagalan, jalankan langkah-langkah untuk memulihkan ke versi baik terakhir yang diketahui.
Kami mencapai ini dengan menggunakan kait siklus hidup yang dapat menjalankan langkah-langkah selama penyebaran. Setiap kait siklus hidup diselesaikan menjadi pekerjaan agen atau pekerjaan server (atau pekerjaan kontainer atau validasi di masa mendatang), tergantung pada atribut kumpulan. Secara default, kait siklus hidup akan mewarisi kumpulan yang ditentukan oleh pekerjaan penyebaran.
Pekerjaan penyebaran menggunakan $(Pipeline.Workspace) system variable.
Jika Anda menggunakan agen yang dihost sendiri, Anda dapat menggunakan opsi bersih ruang kerja untuk membersihkan ruang kerja penyebaran Anda.
jobs:
- deployment: deploy
pool:
vmImage: ubuntu-latest
workspace:
clean: all
environment: staging
strategi: runOnce
Strategi penyebaran runOnce meluncurkan perubahan dengan menjalankan masing-masing langkahnya satu kali.
strategy:
runOnce: # RunOnce Deployment strategy.
preDeploy: # Pre deploy hook for runOnce deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where pre deploy steps will run.
deploy: # Deploy hook for runOnce deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where deploy steps will run.
routeTraffic: # Route traffic hook for runOnce deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where route traffic steps will run.
postRouteTraffic: # Post route traffic hook for runOnce deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where post route traffic steps will run.
on: # On success or failure hook for runOnce deployment strategy.
failure: # Runs on failure of any step.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where post on failure steps will run.
success: # Runs on success of all of the steps.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where on success steps will run.
Properti
runOnce
jobs.deployment.strategy.runOnce.
Strategi Penyebaran RunOnce.
Keterangan
runOnce
adalah strategi penyebaran paling sederhana di mana semua kait siklus hidup, yaitu preDeploy
deploy
, , routeTraffic
dan postRouteTraffic
, dijalankan sekali. Lalu, baik on: success
maupun on: failure
atau dijalankan.
strategi: bergulir
Penyebaran bergulir menggantikan instans versi aplikasi sebelumnya dengan instans versi baru aplikasi pada sekumpulan komputer virtual tetap (set bergulir) di setiap iterasi.
strategy:
rolling: # Rolling Deployment strategy.
maxParallel: string # Maximum number of jobs running in parallel.
preDeploy: # Pre deploy hook for rolling deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where pre deploy steps will run.
deploy: # Deploy hook for rolling deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where deploy steps will run.
routeTraffic: # Route traffic hook for rolling deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where route traffic steps will run.
postRouteTraffic: # Post route traffic hook for rolling deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where post route traffic steps will run.
on: # On success or failure hook for rolling deployment strategy.
failure: # Runs on failure of any step.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where post on failure steps will run.
success: # Runs on success of all of the steps.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where on success steps will run.
Properti
rolling
jobs.deployment.strategy.rolling.
Strategi Penyebaran Bergulir.
strategi: kenari
Strategi penyebaran kenari meluncurkan perubahan pada subset kecil server.
strategy:
canary: # Canary Deployment strategy.
increments: [ string ] # Maximum batch size for deployment.
preDeploy: # Pre deploy hook for canary deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where pre deploy steps will run.
deploy: # Deploy hook for canary deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where deploy steps will run.
routeTraffic: # Route traffic hook for canary deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where route traffic steps will run.
postRouteTraffic: # Post route traffic hook for canary deployment strategy.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where post route traffic steps will run.
on: # On success or failure hook for canary deployment strategy.
failure: # Runs on failure of any step.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where post on failure steps will run.
success: # Runs on success of all of the steps.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
pool: string | pool # Pool where on success steps will run.
Properti
canary
jobs.deployment.strategy.canary.
Strategi Penyebaran Kenari.
Keterangan
Strategi penyebaran Kenari adalah strategi penyebaran tingkat lanjut yang membantu mengurangi risiko yang terlibat dalam meluncurkan versi aplikasi baru. Dengan menggunakan strategi ini, Anda dapat meluncurkan perubahan ke sebagian kecil server terlebih dahulu. Saat Anda semakin percaya diri dengan versi baru, Anda dapat merilisnya ke lebih banyak server di infrastruktur Anda dan mengarahkan lebih banyak lalu lintas ke sana.