DevOps

Jenkins

Pipelines, Jenkinsfile, plugins, agents, declarative vs scripted pipelines, Blue Ocean, troubleshooting builds

22 câu hỏi phỏng vấn·
Mid-Level
1

What is a Jenkinsfile?

Câu trả lời

A Jenkinsfile is a text file containing the definition of a Jenkins pipeline, stored in the project repository. It allows versioning the pipeline configuration with the source code, facilitating traceability and collaboration. Using a Jenkinsfile with the Pipeline as Code approach is a best practice recommended by Jenkins.

2

What is the main difference between a declarative and scripted pipeline in Jenkins?

Câu trả lời

Declarative pipelines use a structured and predefined syntax with mandatory sections like agent and stages, offering a simpler and more readable approach. Scripted pipelines use pure Groovy code, offering more flexibility but requiring programming expertise. For most cases, declarative is recommended for its simplicity and maintainability.

3

What is the purpose of the agent directive in a declarative Jenkinsfile?

Câu trả lời

The agent directive specifies where and how the pipeline should execute. It can be defined globally for the entire pipeline or individually per stage. Options include any to run on any available agent, none to define specific agents per stage, or label to target agents with specific labels. Properly configuring agents allows optimizing resource usage and build performance.

4

What is the role of the stages section in a declarative pipeline?

5

How to manage credentials securely in a Jenkinsfile?

+19 câu hỏi phỏng vấn

Các chủ đề phỏng vấn DevOps khác

Nắm vững DevOps cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí