사용자 도구

사이트 도구


ci:jenkins:agent

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
ci:jenkins:agent [2021/10/11 23:35]
kwon37xi [AWS Fargate]
ci:jenkins:agent [2022/05/30 23:19] (현재)
kwon37xi
줄 1: 줄 1:
 ====== Jenkins Agent ( slave ) ====== ====== Jenkins Agent ( slave ) ======
   * see [[ci:jenkins:slave|Jenkins Slave]]   * see [[ci:jenkins:slave|Jenkins Slave]]
 +  * [[https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds|Jenkins : Distributed builds]]
  
 ===== 제한 사항 ===== ===== 제한 사항 =====
   * agent 의 executor 는 CPU 갯수를 넘기지 말도록 하고 더 적게한다.   * agent 의 executor 는 CPU 갯수를 넘기지 말도록 하고 더 적게한다.
 +
 +===== agent 기본 사항 =====
 +  * [[https://www.youtube.com/watch?v=e2RkeISsDVE&t=1s|Jenkins Master and Slave Configuration | Jenkins Distributed Architecture Tutorial]] : 동일 machine 에서 ''agent.jar''로 직접 만드는 slave agent.
  
  
줄 12: 줄 16:
   * [[https://www.youtube.com/watch?v=ymI02j-hqpU|How to Setup Docker Containers As Build Agents for Jenkins - YouTube]]   * [[https://www.youtube.com/watch?v=ymI02j-hqpU|How to Setup Docker Containers As Build Agents for Jenkins - YouTube]]
  
-===== AWS Fargate =====+===== docker images =====
   * [[aws:fargate|AWS Fargate]]를 이용하면, [[:docker|Docker]] 컨테이너를 필요에 따라 수행하는 Jenkins Agent 로 만들 수 있다.   * [[aws:fargate|AWS Fargate]]를 이용하면, [[:docker|Docker]] 컨테이너를 필요에 따라 수행하는 Jenkins Agent 로 만들 수 있다.
-  * [[ci:jenkins:aws_plugin|Jenkins AWS Plugins]] +    * [[ci:jenkins:aws_plugin|Jenkins AWS Plugins]] 
-  * [[https://plugins.jenkins.io/amazon-ecs/|Amazon Elastic Container Service (ECS) Fargate | Jenkins plugin]] +  * [[https://hub.docker.com/r/jenkins/agent/|jenkins/agent]] : 다른 agent 들의 부모. debian, alpine, windows 선택가능. 
-  * [[https://www.jenkins.io/doc/pipeline/steps/amazon-ecs/|Amazon Elastic Container Service (ECS) Fargate plugin]] +    * [[https://github.com/jenkinsci/docker-agent|jenkinsci/docker-agent: Base Docker image for Jenkins Agents]] 
-  * [[https://www.youtube.com/hashtag/learnwithsandip|Run Jenkins Pipeline With AWS ECS Fargate & AWS EC2 Based ECS Cluster Learn DevOps Tools Ep4 YouTube]]+    * username : ''jenkins'' 
 +  * [[https://hub.docker.com/r/jenkins/inbound-agent/|Docker jenkins/inbound-agent]] : java 버전별로 찾을 수 있다. docker & fargate 용. 
 +    * [[https://github.com/jenkinsci/docker-inbound-agent|jenkinsci/docker-inbound-agent: Docker image for a Jenkins agent which can connect to Jenkins using TCP or Websocket protocols]] 
 +  * [[https://hub.docker.com/r/jenkins/ssh-agent|jenkins/ssh-agent - Docker Image Docker Hub]] 
 +  * [[https://hub.docker.com/r/jenkins/agent|jenkins/agent Docker Image | Docker Hub]]
  
 ===== kubernetes / k8s ===== ===== kubernetes / k8s =====
   * [[:kubernetes|Kubernetes k8s]]   * [[:kubernetes|Kubernetes k8s]]
   * [[https://www.youtube.com/watch?v=ZXaorni-icg|How to Use Kubernetes Pods As Jenkins Agents - YouTube]]   * [[https://www.youtube.com/watch?v=ZXaorni-icg|How to Use Kubernetes Pods As Jenkins Agents - YouTube]]
 +
 +===== Windows =====
 +  * on [[:windows|Windows]]
 +  * [[https://www.youtube.com/watch?v=N8AQTlHoBKc|How to Install Jenkins Agent on Windows - YouTube]]
 +
 +===== stash / unstash =====
 +  * [[https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/|Pipeline: Basic Steps]] ''stash''
 +  * [[https://www.youtube.com/watch?v=0GQZzLlnUws|What Is stash and unstash in Jenkins? - YouTube]]
 +  * 특정 agent 에서 ''stash'' 한 것을 다른 agent 에서 ''unstash'' 하여 여러 agent 들 간에 build 도중 생성된 파일을 공유할 수 있다.
 +  * [[https://gist.github.com/darinpope/74462757661613ac9b8cdd742c3918a2|What-Is-stash-and-unstash-in-Jenkins.md]]
 +
 +<code groovy>
 +pipeline {
 +  agent none
 +
 +  stages {
 +    stage('Hello') {
 +      agent { label 'linux' }
 +      steps {
 +        sh '''
 +          touch file.txt
 +          mkdir -p target
 +          touch target/file2.jar
 +          touch target/file3.war
 +          tree
 +        '''
 +        stash(name: 'myStash', includes: '**/*.war')
 +      }
 +    }
 +    stage('check the file') {
 +      agent { label 'macos' }
 +      steps {
 +        unstash 'myStash'
 +        sh 'tree'
 +      }
 +    }
 +  }
 +}
 +
 +</code>
  
 ===== 참조 ===== ===== 참조 =====
   * [[https://www.youtube.com/watch?v=99DddJiH7lM|How to Create an Agent Node in Jenkins - YouTube]]   * [[https://www.youtube.com/watch?v=99DddJiH7lM|How to Create an Agent Node in Jenkins - YouTube]]
 +  * [[https://youtu.be/MTLgbp0GH8w|How to restart jenkins agent]] : UI, Script 등으로 재시작하기
ci/jenkins/agent.1633962907.txt.gz · 마지막으로 수정됨: 2021/10/11 23:35 저자 kwon37xi