GitOps / Jenkins - Pipeline Ver. K8S

codelab·2024년 1월 23일
0

GitOps

목록 보기
4/4
post-thumbnail

GitOps / Jenkins - Pipeline Ver. Docker 과의 차이점 위주로 기술됩니다.
안 보신 분은 보고와 주세요 :)


젠킨스 관리 > 플러그인

  • GitHub plugin 설치

젠킨스 관리 > 시큐리티

  • Git Hooks - 체크

    • Allow on Controller
      Allow git hooks to run on the Jenkins Controller
    • Allow on Agents
      Allow git hooks to run on Jenkins Agents
  • Git plugin notifyCommit access tokens

    • Add new access token -> 복사

깃헙 > 웹훅스

  • 시크릿: 붙여넣기

젠킨스 > 파이프라인

  • docker 직접사용 > container('dind') {} 구문으로 변경
node {
    def app

   stage('Check Docker installation') {
      sh 'docker --version || echo "Docker is not installed"'
   }

   stage('Clone repository') {
      checkout scm
   }

   stage('Build-Docker-Image') {
        container('dind') {
            sh 'docker build -t ap-seoul-1.ocir.io/cnqphqevfxnp/test-storage:latest --target development .'
        }
    }
}
profile
Think about a better architecture

0개의 댓글