티아카데미 Jenkins를 활용한 CICD TIL - CICD & Jenkins 실습

2020-12-25

.

Data_Engineering_TIL(20201224)

study_program : 티아카데미 Jenkins를 활용한 CI/CD

URL : https://tacademy.skplanet.com/frontMain.action

[실습내용]

  • 먼저 ec2를 하나띄우고 ssh로 접속해서 아래와 같이 명령어를 실행하여 jenkins를 구동한다.
[ec2-user@ip-10-0-1-231 ~]$ sudo yum update -y
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                                         | 3.7 kB  00:00:00
No packages marked for update

# Jenkins 패키지 추가
# 젠킨스를 다운받을 수 있는 yum repo를 다운을 받고, 그 레포에 접근할 수 있는 키를 받는다.
[ec2-user@ip-10-0-1-231 ~]$ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat/jenkins.repo && sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
--2020-12-24 06:18:52--  http://pkg.jenkins.io/redhat/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 151.101.110.133, 2a04:4e42:1a::645
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.110.133|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://pkg.jenkins.io/redhat/jenkins.repo [following]
--2020-12-24 06:18:52--  https://pkg.jenkins.io/redhat/jenkins.repo
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71
Saving to: /etc/yum.repos.d/jenkins.repo

100%[================================================================================================================================================>] 71          --.-K/s   in 0s

2020-12-24 06:18:52 (3.96 MB/s) - /etc/yum.repos.d/jenkins.repo saved [71/71]

# Install java, docker, git
[ec2-user@ip-10-0-1-231 ~]$ sudo yum install -y java-1.8.0-openjdk jenkins git tree docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd

...

Complete!

# 자바 버전 8 로 설정
[ec2-user@ip-10-0-1-231 ~]$ sudo alternatives --config java

There is 1 program that provides 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.amzn2.0.1.x86_64/jre/bin/java)

Enter to keep the current selection[+], or type selection number: 1

[ec2-user@ip-10-0-1-231 ~]$ java -version
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
    
[ec2-user@ip-10-0-1-231 ~]$ sudo service jenkins start
Starting jenkins (via systemctl):                          [  OK  ]
    
[ec2-user@ip-10-0-1-231 ~]$ sudo usermod -aG docker ec2-user
[ec2-user@ip-10-0-1-231 ~]$ sudo usermod -aG docker jenkins
[ec2-user@ip-10-0-1-231 ~]$ sudo chmod 666 /var/run/docker.sock
[ec2-user@ip-10-0-1-231 ~]$ sudo service docker start
Redirecting to /bin/systemctl start docker.service

[ec2-user@ip-10-0-1-231 ~]$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
b5exxxxxxxxxxxxxxxxxxxxxxxxxxxx88d5
# 이 코드를 컨트롤+c로 복사한다.
  • ec2의 보안그룹에서 나의 ip가 등록되어 있는지 확인하고, 웹브라우저를 열고 [ec2_public_ip]:8080으로 접속한다.

그 다음에 복사한 코드를 Administrator password에 붙어넣기하고 continue를 클릭한다.

그 다음에 install suggested plugins 클릭

그러면 플러그인들이 쭉 설치된다.

  • 플러그인이 설치 완료되면 Create First Admin User 화면이 뜨는데 아래와 같이 입력하고 save and continue를 클릭한다.

계정명 : minman

비번 : mypasswd3#

비번확인 : mypasswd3#

이름 : minman

이메일주소 : minmanaddress@myemail.com

  • Instance Configuration에서는 변동없이 바로 save and finish를 클릭한다. 그런 다음에 start using jenkins를 클릭한다. 그러면 젠킨스를 사용할 수 있는 상태가 된다.

  • jenkins에서 사용할 git repository를 생성하자.

github에서 나의 계정으로 로그인하고, jenkins_test라는 레포지토리를 새로 만들어준다. 그리고 실습파일 알집파일을 압축을 해제해서 아래와 같이 로컬pc의 터미널에서 해당 레포지토리에 업로드시킨다.

user@DESKTOP-QKRJSLG MINGW64 ~/Desktop/aa
$ git clone https://github.com/mygithubid/jenkins_test.git
Cloning into 'jenkins_test'...
warning: You appear to have cloned an empty repository.

user@DESKTOP-QKRJSLG MINGW64 ~/Desktop/aa
$ cd jenkins_test/

user@DESKTOP-QKRJSLG MINGW64 ~/Desktop/aa/jenkins_test (master)
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitignore
        Jenkinsfile
        README.md
        server/
        website/

nothing added to commit but untracked files present (use "git add" to track)

user@DESKTOP-QKRJSLG MINGW64 ~/Desktop/aa/jenkins_test (master)
$ git add -A
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in Jenkinsfile.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/.eslintrc.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/Dockerfile.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/index.test.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/index.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/not_linted.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/package.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in server/tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in website/index.html.
The file will have its original line endings in your working directory

user@DESKTOP-QKRJSLG MINGW64 ~/Desktop/aa/jenkins_test (master)
$ git commit -m "upload new files"
[master (root-commit) c542b74] upload new files
 12 files changed, 5429 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Jenkinsfile
 create mode 100644 README.md
 create mode 100644 server/.eslintrc.js
 create mode 100644 server/Dockerfile
 create mode 100644 server/index.test.js
 create mode 100644 server/index.ts
 create mode 100644 server/not_linted.js
 create mode 100644 server/package-lock.json
 create mode 100644 server/package.json
 create mode 100644 server/tsconfig.json
 create mode 100644 website/index.html

user@DESKTOP-QKRJSLG MINGW64 ~/Desktop/aa/jenkins_test (master)
$ git push
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (16/16), 58.75 KiB | 3.26 MiB/s, done.
Total 16 (delta 0), reused 0 (delta 0)
To https://github.com/mygithubid/jenkins_test.git
 * [new branch]      master -> master
  • 그러면 jenkins에서 git에 연결해보자.

먼저 jenkins가 git에 접근할 수 있도록 해줘야 한다.

github 화면에서 우측상단에 내계정 아이콘 클릭 –> settings 메뉴 클릭 –> 좌측에 Developer settings 클릭 –> generate new token 클릭 –> Note에 jenkins_test_20201224 입력 –> repo 체크박스 클릭 –> Generate token 클릭 –> 생성된 액세스 토큰을 메모장에 복사해둔다.

생성한 깃헙 액세스 토큰을 젠킨스에 등록해보자.

젠킨스 메인화면 좌측에 ‘jenkins 관리’ 클릭 –> ‘Manage credentials’ 클릭 –> ‘Stores scoped to Jenkins’ 메뉴에서 Jenkins 클릭 –> ‘Global credentials (unrestricted)’ 클릭 –> 좌측에 ‘Add credentials’ 클릭 –> kind 클릭 후 username with password 클릭 –> Username 에 내 깃허브 아이디 입력 –> Password에 메모장에 복사한 액세스 토큰을 입력 –> ID에는 access_token_for_github 라고 입력 –> OK 클릭

그리고 젠킨스에서 aws 리소스에 접근할 수 있도록 aws credential을 등록해주자.

젠킨스 메인화면 좌측에 ‘jenkins 관리’ 클릭 –> ‘Manage credentials’ 클릭 –> ‘Stores scoped to Jenkins’ 메뉴에서 Jenkins 클릭 –> ‘Global credentials (unrestricted)’ 클릭 –> 좌측에 ‘Add credentials’ 클릭 –> kind 클릭 후 secret text 클릭 –> Secret에 aws credential에서 나의 Access key ID(코드형태)를 입력 ID에 awsAccessKeyId 라고 입력–> OK 클릭

그리고 다시한번 아래와 같이 해준다.

젠킨스 메인화면 좌측에 ‘jenkins 관리’ 클릭 –> ‘Manage credentials’ 클릭 –> ‘Stores scoped to Jenkins’ 메뉴에서 Jenkins 클릭 –> ‘Global credentials (unrestricted)’ 클릭 –> 좌측에 ‘Add credentials’ 클릭 –> kind 클릭 후 secret text 클릭 –> Secret에 aws credential에서 나의 Secret access key(코드형태)를 입력 ID에 awsSecretAccessKey 라고 입력–> OK 클릭

그러면 Global credentials (unrestricted) 화면에서 access_token_for_github, awsAccessKeyId, awsSecretAccessKey 총 3개가 등록된 것을 확인할 수 있다.

  • 실습에서 사용할 s3 버킷을 하나 생성해준다.

임의의 이름으로 s3 버킷을 하나 만들어준다.

pms-jenkins-test 라는 이름으로 s3 버킷을 하나 만들었다.

  • jenkins에서 특정 이메일로 post할 수 있도록 설정해준다.

참고로 구글smtp를 사용하기 위해서는 구글계정에 로그인하고 ‘앱비밀번호’라는 걸 만들어서 해당 비밀번호를 사용해야 한다.

참고 URL : https://support.google.com/accounts/answer/185833?p=InvalidSecondFactor

그래서 구글에서 아래 그림과 같이 앱비밀번호 16자리를 만들어서 해당 비밀번호를 메모장에 복사해둔다.

google_앱비밀번호_생성화면

젠킨스 메인화면 좌측에 ‘jenkins 관리’ 클릭 –> ‘시스템 설정’ 클릭 –> 스크롤을 쭉 내려서 Extended ‘E-mail로 알려줌’ 메뉴에서 ‘고급’ 버튼 클릭 –> SMTP 서버에 smtp.gmail.com 를 입력 –> Use SMTP Authentication 체크박스 클릭 후 사용자명에 나의 gmail 주소와 비밀번호에는 위에서 복사한 앱비밀번호를 입력 –> 저장 클릭

  • jenkinsfile에서 $변수로 ENV가 어떤거인지(PROD인지 DEV인지) 이런거를 사용하고 싶다면 아래와 같이 해준다.

젠킨스 홈화면 –> 좌측에 ‘jenkins 관리’ 클릭 –> ‘시스템 설정’ 클릭 –> Global properties 의 Environment variables 체크박스 클릭, 키-값 목록 추가 클릭 –> 이름에 ENV 입력, 값에 PROD 를 입력 –> ‘저장’ 클릭

  • 젠킨스 ec2 터미널로 돌아가서 아래와 같이 실습 레포지토리를 다운받는다.
[ec2-user@ip-10-0-1-231 ~]$ git clone https://github.com/mygithubid/jenkins_test.git
Cloning into 'jenkins_test'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 16 (delta 0), reused 16 (delta 0), pack-reused 0
Unpacking objects: 100% (16/16), done.

[ec2-user@ip-10-0-1-231 ~]$ tree jenkins_test
jenkins_test
├── Jenkinsfile
├── README.md
├── server
│   ├── Dockerfile
│   ├── index.test.js
│   ├── index.ts
│   ├── not_linted.js
│   ├── package.json
│   ├── package-lock.json
│   └── tsconfig.json
└── website
    └── index.html

2 directories, 10 files

# 웹사이트를 띄웠을때 보이는 index.html이 있다.
[ec2-user@ip-10-0-1-231 ~]$ cat jenkins_test/website/index.html
<html>

<body>
  <h1>Hello World</h1>
</body>

</html>

# index.ts를 설명하면 웹서버는 80번 포트를 리스닝할 것이다.
# 그리고 /(루트) 디렉토리로 접근하면 200 메세지를 날리겠다는 것이다.
# 결론적으로 웹서버 하나를 80번 포트 열어서 띄우겠다는 것이다.
[ec2-user@ip-10-0-1-231 ~]$ cat jenkins_test/server/index.ts
import express from 'express'

const app = express()

app.get('', (req, res, next) => {
  res.send(200)
})

app.listen(80, () => {
  console.log('listening...')
})

위에까지 진행했으면 실습 준비가 완료된 것이다.

우리는 웹사이트를 하나 배포할 것이고, 서버를 하나 배포할 것이다. 그리고 어떻게 배포할건지에 대한 jenkinsfile이 있다.

[ec2-user@ip-10-0-1-231 ~]$ cat jenkins_test/Jenkinsfile
//pipeline의 시작이다. 내가 여기에다가 파이프라인을 작성할 것이다 라는 의미
pipeline {
    // 에이전트=노예를 어떤거를 쓸거냐 라는 의미다.
    // any = 아무거나 쓰겠다.
    agent any

    //  파이프라인이 어떤 주기로 트리거가 될거냐 크론 신텍스로 정의함
    //  파이프라인을 3 주기로 구동하겠다는 의미
    triggers {
        pollSCM('*/3 * * * *')
    }

    //  파이프라인에서 사용할 환경변수에 대한 정의다.
    // 위에서 설정한 젠킨스 ec2에 aws configure로 크레덴셜 설정 해준부분에 대해서 참조하겠다는 것이다.
    environment {
      AWS_ACCESS_KEY_ID = credentials('awsAccessKeyId')
      AWS_SECRET_ACCESS_KEY = credentials('awsSecretAccessKey')
      AWS_DEFAULT_REGION = 'ap-northeast-2'
      HOME = '.' // Avoid npm root owned
    }

    // stages는 파이프라인의 내용을 어떤 단계로 진행할 것인지에 대한 상세 작업내용이라고 보면 된다.
    // 여기에 정의된 stage는 크게 Prepare, Deploy Frontend, Lint Backend, Test Backend, Bulid Backend, Deploy Backend 라는
    // 이름의 6가지 스테이지로 구성되어 있다.
    stages {
        // 레포지토리를 다운로드 받음
        stage('Prepare') {
            agent any

            steps {
                echo 'Clonning Repository'

                git url: 'https://github.com/yourgithubid/jenkins_test.git',
                    branch: 'master',
                    credentialsId: 'access_token_for_github'
            }

            // 메세지를 전달하는 기능이라고 보면 된다.
            // post 안에서 메일도 보낼  있고, 슬랙 메세지도 보낼  있다.
            // 성공했을때, 항상, 클린업은 post가 전부  완료해서 끝냈을때 분기 처리한것으로 이해하면된다.
            post {
                // If Maven was able to run the tests, even if some of the test
                // failed, record the test results and archive the jar file.
                success {
                    echo 'Successfully Cloned Repository'
                }

                always {
                  echo "i tried..."
                }

                cleanup {
                  echo "after all other post condition"
                }
            }
        }
        
        // branch가 production이고, APP_ENV가 prod이면 어떤 작업을 실행해라라는 stage이다.
        // 다시말해서 프로덕션 환경에서만 어떤 작업을 하고 싶을때
        // 이런 문법을 응용할 수도 있다.
        // stage('Only for production') {
        //    when {
        //        branch 'production'
        //        environment name : 'APP_ENV', value: 'prod'
        //        any Of{
        //            environment name : 'DEPLOY_TO', value: 'production'
        //            environment name : 'DEPLOY_TO', value: 'staging'
        //        }                
        //    }
        //}

        // aws s3  파일을 올림
        // index.html을 작성하고, 지정된 경로의 s3에 업로드하겠다는 스테이지다.
        stage('Deploy Frontend') {
          steps {
            echo 'Deploying Frontend'
            // 프론트엔드 디렉토리의 정적파일들을 S3  올림,  전에 반드시 EC2 instance profile  등록해야함.
            // 원래는 아래에 dir (./website) 되어있었는데 index.html이 s3에 업로드 되지 않는 현상이 있어서
            // 확인을 해보니까 /var/lib/jenkins/workspace/20201224_test에 저장이 되야하는데 20201224_test@2 라는 폴더에
            // 깃허브 클론한 파일들이 저장되어 있어서 아래와 같이 경로를 바꿔주었음.
            dir ('/var/lib/jenkins/workspace/20201224_test@2/website'){
                sh '''
                aws s3 sync ./ s3://yourbucketname/
                '''
            }
          }

          // 작업 성공여부에 따라 이메일이 보내지게되는데
          // 보내려고 하는 email 주소에 credential 등록을 해줘야 한다.
          post {
              // If Maven was able to run the tests, even if some of the test
              // failed, record the test results and archive the jar file.
              success {
                  echo 'Successfully Cloned Repository'

                  mail  to: 'youremailadd@gmail.com',
                        subject: "Deploy Frontend Success",
                        body: "Successfully deployed frontend!"

              }

              failure {
                  echo 'I failed :('

                  mail  to: 'youremailadd@gmail.com',
                        subject: "Failed Pipelinee",
                        body: "Something is wrong with deploy frontend"
              }
          }
        }

        // 무언가 자바 라이브러리(npm install)  다음에 lint를 해주는 부분이다.
        // jenkins_test 폴더 내에 not_linted.js라는 파일이 있는데 파일 내용을 보면 lint가 안되어있다
        // 주의해야  점은 노드서버인데 젠킨스 ec2 내에는 노드가 없으니까 도커에다가 노드하나 받아서 여기에다가
        // install하고 lint run까지 하라는 것이다.
        stage('Lint Backend') {
            // Docker plugin and Docker Pipeline 두개를 깔아야 사용가능!
            // 슬레이브 일을 docker한테 시키는 것이다.
            agent {
              docker {
                image 'node:latest'
              }
            }

            steps {
              dir ('./server'){
                  sh '''
                  npm install&&
                  npm run lint
                  '''
              }
            }
        }

        // 테스트를 하려면 마찬가지로 npm이 있어야하고
        // 이를 위해서 node 도커 컨테이너를 이용했다.
        // 그래서 도커 안에서 npm install하고 test를  것이다.
        // 테스트 코드를 돌리는 것인데 jenkins_test 폴더내에 index.test.js를 돌리는 것이다.
        stage('Test Backend') {
          agent {
            docker {
              image 'node:latest'
            }
          }
          steps {
            echo 'Test Backend'

            dir ('./server'){
                sh '''
                npm install
                npm run test
                '''
            }
          }
        }

        // 서버는 배포할때 그냥 배포하는게 아니라 도커를 만들어서 배포해야 한다.
        // 그래서 아래와 같이 도커 빌드 명령어를 사용하는 것이다.
        // 도커를 젠킨스에 설치하고 실행시켜놔야 한다.
        // --build-arg를 이용할수도 있는데 뭐냐면 도커 빌드할때 멀티배포환경을 관리하는것이 중요하기 때문에
        // 이런식으로 아규먼트를 사용할  있다는 것을 의미한다.
        stage('Bulid Backend') {
          agent any
          steps {
            echo 'Build Backend'

            dir ('./server'){
                sh """
                docker build . -t server --build-arg env=${ENV}
                """
            }
          }

         // 위에서 post들은 해당 stage 작업들이 실패해도 그냥 다음 단계로 넘어가도록 했는데
         // 여기서는 아예 failure나서 파이프라인을 다운시키도록 해둔 것이다.
          post {
            failure {
              error 'This pipeline stops here...'
            }
          }
        }

        // 원래 있던 이미지를 지우고 새로 빌드한 도커 컨테이너로 바꿔치기 하는 것이다.
        stage('Deploy Backend') {
          agent any

          steps {
            echo 'Build Backend'

            dir ('./server'){
                sh '''
                docker rm -f $(docker ps -aq)
                docker run -p 80:80 -d server
                '''
            }
          }

          post {
            success {
              mail  to: 'youremailadd@gmail.com',
                    subject: "Deploy Success",
                    body: "Successfully deployed!"

            }
          }
        }
    }
}

그런 다음에 젠킨스의 도커 플러그인과 깃 플러그인을 깔아야 한다.

젠킨스 홈화면 –> 좌측에 ‘jenkins 관리’ 클릭 –> ‘플러그인 관리’ 클릭 –> ‘설치 가능’ 탭 클릭 –> Docker, Docker Pipeline, Pipeline: GitHub 총 3개의 플러그인을 설치해준다.

위에까지 했으면 젠킨스가 일을 할 준비가 완료된 것이다.

그러면 젠킨스에 새로운 아이템을 등록해보자.

젠킨스 홈화면에서 좌측에 ‘새로운 item’을 클릭 –> Enter an item name에 이름을 아무렇게 입력해주고, Pipeline을 클릭한 다음에 Ok를 클릭 –> 스크롤을 조금 내리면 Pipeline가 있는데 거기에 위에 Jenkinsfile 내용을 복붙해준다.

** 참고사항 : jenkinsfile 파일 자체를 받아올 수도 있다. Pipeline의 Definition에서 pipeline script from SCM을 클릭하고, SCM은 나의 git으로 설정해주고 경로를 잡아주는 설정을 해주면 된다.

그런 다음에 스크롤을 조금 올려서 ‘GitHub project’ 체크박스를 클릭 –> Project url에 https://github.com/yourgithubid/jenkins_test 를 입력한다. https://github.com/minman2115/jenkins_test.git 에서 .git만 제거한 형태이다.

그 다음에 ‘Build Triggers’에 ‘Poll SCM’ 체크박스를 클릭 (위에서 작성한 jenkinsfile에 poll scm을 어떻게 할건지에 대해 이미 설정을 해주었고, 이를 활성화 하기 위해서 ‘Poll SCM’ 체크박스를 클릭한 것이다.)

그런 다음에 ‘저장’을 클릭한다.

젠킨스 홈화면에서 내가 등록한 item을 클릭하고, ‘build now’를 클릭한다.

그러면 아래와 같이 build Error가 날 것이다.

docker_rm_build_error화면

최초에 빌드할때는 기존에 도커 이미지 떠있는게 없기 때문에 docker rm -f $(docker ps -aq) 명령어를 날리면 Error가 난다. 따라서 jenkinsfile의 Deploy Backend stage에서 최초빌드할때는 docker rm -f $(docker ps -aq)를 빼주고 해주면 된다.

최초빌드에 성공하고 이후 빌드할때는 jenkinsfile의 Deploy Backend stage에 docker rm -f $(docker ps -aq)를 다시 넣어준다.

그러면 전stage가 초록색으로 빌드가 성공적으로 이루어진 것을 확인할 수 있다.

참고로 빌드중에 콘솔에서 어떤로그가 찍혔는지 전부 알고 싶으면 아래와 같이 확인해보면 된다.

좌측에 build history –> 원하는 build number 오른쪽에 역삼각형 아이콘 클릭 –> console output 클릭

console_output_print

또한 웹브라우저를 열고 [ec2 public ip]:80 으로 접속 시 ok가 전시된 것을 확인하고, 아까 생성한 s3 버킷에 이동하면 index.html 이 있으면 빌드가 성공한 것이다.

  • 젠킨스 적용사례

jenkins 적용사례

  • Q&A

Q: 젠킨스 파이프 라인의 각 스테이지는 병렬로 처리되나요?

A: 젠킨스 파이프라인은 기본적으로 직렬로 처리되지만 개발자가

병렬로 처리가 필요하다고 생각되는 경우 병렬로 처리하도록 할 수 있습니다.

예를 들어 여러 젠킨스 노드가 있다면 각 노드에게 서로 다른 일을 시켜 일을 분산시킬 수 있습니다.

Q: 바스천이 있는 환경에서 Jenkins 를 어떻게 활용하나요?

A: 바스천을 통해 proxy ssh 를 활용해서 접근할 수 있습니다.