
Jenkins
Pipeline, Jenkinsfile, plugin, agent, declarative vs scripted pipeline, Blue Ocean, build 문제 해결
1Jenkinsfile란 무엇입니까?
Jenkinsfile란 무엇입니까?
답변
Jenkinsfile은 Jenkins pipeline의 정의를 담은 텍스트 파일로, 프로젝트 repository에 저장됩니다. pipeline 구성을 소스 코드와 함께 버전 관리할 수 있어 추적성과 협업이 용이해집니다. Pipeline as Code 접근 방식으로 Jenkinsfile을 사용하는 것은 Jenkins가 권장하는 모범 사례입니다.
2Jenkins에서 declarative pipeline과 scripted pipeline의 주요 차이점은 무엇입니까?
Jenkins에서 declarative pipeline과 scripted pipeline의 주요 차이점은 무엇입니까?
답변
declarative pipeline은 agent와 stages 같은 필수 섹션을 갖춘 구조화되고 사전 정의된 구문을 사용하여 더 단순하고 읽기 쉬운 접근 방식을 제공합니다. scripted pipeline은 순수 Groovy 코드를 사용하여 더 높은 유연성을 제공하지만 프로그래밍 전문성이 필요합니다. 대부분의 경우 단순성과 유지보수성 측면에서 declarative가 권장됩니다.
3declarative Jenkinsfile에서 agent 디렉티브의 목적은 무엇입니까?
declarative Jenkinsfile에서 agent 디렉티브의 목적은 무엇입니까?
답변
agent 디렉티브는 pipeline을 어디서 어떻게 실행할지 지정합니다. 전체 pipeline에 대해 전역으로 정의하거나 stage별로 개별 정의할 수 있습니다. 옵션에는 사용 가능한 임의의 agent에서 실행하는 any, stage별로 특정 agent를 정의하는 none, 특정 label을 가진 agent를 대상으로 하는 label 등이 있습니다. agent를 적절히 구성하면 리소스 사용과 build 성능을 최적화할 수 있습니다.
declarative pipeline에서 stages 섹션의 역할은 무엇입니까?
Jenkinsfile에서 credentials를 안전하게 관리하려면 어떻게 해야 합니까?
+19 면접 질문