انتقل إلى المحتوى
أمين أبوزيد
JNR-052

أساسيات النشر (Deployment)

  • 7 درس
  • 3 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • ملفات JAR القابلة للتنفيذ
  • النشر بالحاويات
  • الإعدادات
  • فحوص الصحة

تعلّم أولًا

3 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Deploy the containerized app and a managed PostgreSQL to a hosting platform or VM.
  2. Configure the deployment entirely through environment variables.
  3. Expose liveness and readiness health checks and explain the difference.
  4. Perform graceful shutdown and roll back to the previous image.

الدروس

  1. 01من المخرَج إلى خدمة تعمل
  2. 02مقارنة بين أهداف النشر
  3. 03الإعدادات في بيئات النشر
  4. 04فحوص الصحة: Liveness مقابل Readiness
  5. 05الإيقاف السلس والتراجع
  6. 06عرض عملي: نشر Shop وقاعدة بياناته
  7. 07عرض عملي: التراجع عن إصدار سيئ

المختبر والتمارين

Lab

JNR-052-LAB1 · Shop goes live

Outcomes: 1–4 · Time: ~3 h Deploy from the pipeline to a public URL with a managed database, configured through environment variables, with probes and graceful shutdown; perform and document a rollback. Acceptance: deployed instance reachable; rollback under 5 minutes.

Exercises (assessment: deployment walkthrough)

IDOutcomeTask
JNR-052-EX011Compare VM, PaaS, and managed containers for Shop on cost, control, and effort; recommend one.
JNR-052-EX021Write the numbered steps from "merge to main" to "live URL".
JNR-052-EX032Convert a application-prod.yml with a database password into environment-variable configuration.
JNR-052-EX043Enable liveness and readiness probes and show both endpoints' responses.
JNR-052-EX053Explain why liveness should not call the database, using a database-outage scenario.
JNR-052-EX064Enable graceful shutdown and prove an in-flight request finishes during a stop.
JNR-052-EX074Write a five-step rollback runbook with expected timing.
أظهر الحلول
  • EX01 For example: VM is cheapest but needs patching and setup; PaaS is fastest to start; recommend a PaaS for a first deployment. Verify current prices.
  • EX02 Merge, CI passes, image pushed with SHA tag, deploy job updates the service, health check passes, URL serves traffic.
  • EX03 Remove the password; set SPRING_DATASOURCE_PASSWORD in the platform secret store; keep only non-secret defaults in the file.
  • EX04 management.endpoint.health.probes.enabled=true; /actuator/health/liveness and /actuator/health/readiness return {"status":"UP"} (verify for your Boot version).
  • EX05 If the database goes down, liveness failing restarts every instance, causing restart loops and extra load; readiness failing only removes traffic until it recovers.
  • EX06 server.shutdown=graceful and a shutdown timeout; start a slow request, send SIGTERM, and see the response complete before exit.
  • EX07 Identify the bad release; find the previous tag; redeploy it; verify health; record the time; communicate the result.
  • Common mistakes (credentials in the image) are checked in the walkthrough assessment.

الاختبار

Outcomes: O1 deploying the app and database · O2 environment configuration · O3 liveness and readiness · O4 graceful shutdown and rollback.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1The easiest first deployment target is usually a:O1
  2. 2Between environments you should keep the same:O1
  3. 3Where should database credentials live?O2
  4. 4SPRING_DATASOURCE_URL maps to:O2
  5. 5Readiness answers:O3
  6. 6Liveness answers:O3
  7. 7A liveness probe that calls the database can cause:O3
  8. 8Graceful shutdown means the app:O4
  9. 9The quickest rollback is:O4
  10. 10Why keep old image tags?O4

الجزء العملي

Seven exercises JNR-052-EX01 to EX07 plus the lab; the assessment is a deployment walkthrough. Pass: quiz 8/10, at least five exercises correct, deployed instance reachable, and a documented rollback under 5 minutes.

أخطاء شائعة

Database credentials in the image; health checks that call the database for liveness.

التقييم

Deployment walkthrough.

الصلة بالمسار الوظيفي

Kubernetes (MID-057) and production readiness (SRC-011).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.