studybook
  • Introduction
  • 실무 하며 깨닫는 부분 정리
    • 옵션에 대해서
    • 코드 작성의 순서
    • 자바 프로그램에 문제가 생겼다면
    • 장애 대처법
  • Logstash, Beats 정리
  • Zookeeper 정리
  • Message Queue 정리
    • RabbitMQ 삽질
  • Java 관련 정리
    • Java Primitive Wrapper class
    • Java NIO
    • Java8 Double colon operator
    • Effective Java
      • 4장
      • 5장
      • 6장 - Enum, Annotation
      • 7장 - Method
      • 8장 - 프로그래밍 일반
      • 9장 - Exception
    • Java8 Lambda expression
    • JDBC
    • Linux에서 WatchService 이상동작
  • Spring 관련 정리
    • Spring Bean init, destroy 순서
    • Spring Async Controller
    • Spring Executable jar 웹 개발 및 배포
    • Spring Boot Font 배포 에러
    • Spring AOP
      • Spring AOP로 모든 Request 로그 남기기
    • Spring Cache
    • Spring Cloud
      • Consul로 spring 설정 관리하기
    • Spring Test
      • Spring Test DirtiesContext
      • Spring Test MockBean, SpyBean
      • Spring Test Dynamic @Scheduled
    • Spring JDBC
    • Spring Validation
    • Spring Transaction Management
      • Spring with JTA 삽질
    • Spring에서 효율적으로 Static resource 관리하기
    • Zuul을 사용해서 Spring Reverse proxy 만들기
    • Spring Security
    • 스프링 어노테이션이 안 먹힐 때 의심해볼만한 것
    • Spring Data
    • Spring Webflux
      • Tobi 강연
  • 코드 리팩토링
    • 한번에 하나씩
  • 지속적 통합 (CI)
    • Jenkins pipeline 삽질기
  • Log Aggregator 정리
    • Flume 테스트
    • Fluentd 테스트
  • Web Socket 정리
  • Akka
    • Actor 모델
    • Supervision
  • IE 8 대응 정리
  • 함수형 프로그래밍
    • 모나드
  • Netty
    • Netty 기본 예제
    • Netty 주요 특징
    • Netty 부트스트랩
    • Netty 채널 파이프라인, 코덱
    • Netty 이벤트 모델
    • Netty 바이트 버퍼
  • 스칼라 관련 정리
    • Maven으로 컴파일하기
    • Scala def 괄호 여부의 차이
    • 스칼라 function, method 차이점
    • ScalaTest와 Spring 연동하기
    • Programming in Scala
  • J2S 컨퍼런스
  • Android
    • 테스트
    • NDK
  • DDOS
  • HTTP
  • HttpClient
  • Container
    • Image 개요
    • cri-o
    • kata containers
    • Open Container Initiative Image
    • Buildkit
  • Github pages
  • Static Website
  • Webhook
  • Service Discovery Tools
    • Etcd
    • Eureka
    • Consul
      • ACL
    • 비교
  • React
    • JSX
    • React Element
    • Components, Props
    • State, Lifecycle
    • Handling Event
    • Flux
  • Vagrant
    • SSH 접속
  • Linux
    • Systemd
    • Alternatives
  • Messaging protocols
    • XMPP
    • AMQP
  • Windows
    • Windows10 내장 우분투에 ssh 클라이언트로 접속하기
    • Windows10 Hyper-V와 Virtual Box가 충돌을 일으켰을 때
    • Hyper-V 기반 docker에서 Shared Drives 설정 실패할 때
    • 윈도우 개발환경 설정
    • Docker desktop 없이 docker 환경 세팅하기
    • UWP 앱을 항상 관리자권한으로 실행하는 바로가기 만들기
  • Spring camp 2017
    • Project Reactive
    • 이벤트 소싱
    • CQRS
  • Spring webflux
  • 리액티브 프로그래밍
  • Linux Settings
    • 홈서버 백업 및 복구기
    • 홈서버 트러블슈팅
  • Kubernetes
    • k3s 설치 및 삽질
    • pod resources
    • Argo workflow
    • 트러블 슈팅
      • Kubernetes namespace의 phase가 Terminating에서 멈춰있을 때
    • 쿠버네티스 마스터
    • Knative
    • Knative Pipeline
    • Aggrerated API server
    • Accessing the API
      • Authenticating
  • Sonarqube
  • HTTP/2
  • Go
    • Go Module
    • Go dependency injection
    • Go Error handling
    • Go in Action
      • 3장 패키지
      • 4장 배열, 슬라이스, 맵
      • 5장 GO의 타입 시스템
      • 6장 동시성
      • 7장 동시성 패턴
      • 8장 표준 라이브러리
      • 9장 테스트와 벤치마킹
    • Go Channel 사용법
  • Cloud Native
Powered by GitBook
On this page
  • 설정
  • 젠킨스 설치
  • 젠킨스 플러그인 설치
  • Global Tool Configuration 설정
  • Configure Credentials
  • 파이프라인 생성
  • Github 연동
  • 테스트
  • 정적 검사
  • 배포
  • 이슈
  • git 접속 실패
  • Github Push 연동 실패
  1. 지속적 통합 (CI)

Jenkins pipeline 삽질기

Previous지속적 통합 (CI)NextLog Aggregator 정리

Last updated 7 years ago

설정

젠킨스 설치

  • centOS 설치 방법 :

  • Jenkins 관련 기본 설정들은 /etc/sysconfig/jenkins 에 존재

젠킨스 플러그인 설치

  • 젠킨스 default 포트는 8080

  • Credentials Plugin

  • Git plugin

  • Pipeline*

Global Tool Configuration 설정

JDK 세팅

Maven 세팅

git 세팅

Configure Credentials

git Credential 추가

파이프라인 생성

Github 연동

Github 계정 Token 생성

Github plugin 설정

프로젝트 설정

테스트

  • Publish JUnit test result report Build Step 실행

정적 검사

배포

  • 생략

Groovy pipeline script

node {
  // JDK 8 사용하도록 설정하기
  stage 'Setting'
  def javaHome = tool name: 'jdk8', type: 'hudson.model.JDK'
  env.JAVA_HOME = "${javaHome}"
  env.PATH = "${env.PATH}:${env.JAVA_HOME}/bin"

  // github에서 소스 얻어오기
  stage 'Checkout'
  git branch: 'development', credentialsId: '{your credential id}', url: '{your git url}'

  // Maven으로 빌드 실행하기
  stage 'Build'
  def mvnHome = tool 'M3'
  sh "${mvnHome}/bin/mvn -P local -Dmaven.test.skip=true -Ddeploy-path=./deploy clean install"

  // 테스트 진행하기
  stage 'Test'
  sh "${mvnHome}/bin/mvn -P local -B -Dmaven.test.failure.ignore verify"
  step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])

  // 정적 검사 수행
  stage 'Analysis'
  sh "${mvnHome}/bin/mvn site"
  step([$class: 'CheckStylePublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/checkstyle-result.xml', unHealthy: ''])
  step([$class: 'FindBugsPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', pattern: '**/findbugsXml.xml', unHealthy: ''])
  step([$class: 'PmdPublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd.xml', unHealthy: ''])

  // 패키지 저장
  step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
}

이슈

git 접속 실패

  • git 버전 1.7.13 이상부터 --local 옵션을 지원하기 때문에 발생하는 문제

  • CentOS 기본 repository에서 2016.5.30 현재 기준으로 1.7.1이 설치된다

    • 이미 구버전 git이 깔려있는 상황에서는 이렇게 하면 됨

    • sudo yum install epel-release

    • sudo yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel

    • git clone https://git.kernel.org/pub/scm/git/git.git

    • 생성된 클론 디렉토리로 이동해서 make configure

    • ./configure --prefix=/usr

    • sudo make install

    • git --version 1.7.13 이상인지 확인

Github Push 연동 실패

URL 문제

  • Item 설정에서 GitHub project 하위 Project url을 다시 재확인

토큰 변경, 잡 변경 등으로 인한 문제

필요

필요

필요

선택

참고해서 최신으로 설치해야함

처럼 끝에 .git이 붙으면 안 된다.

처럼 뒤쪽에 branch 관련 Path가 있어도 안 된다.

다시 GitHub 설정으로 가서 고급... 버튼을 누르면 추가로 나타나는 옵션 중 위 사진의 버튼을 눌러서 다시 Hook을 등록 시도 해보면 됨.

Github Plugin
JUnit Plugin
Static Code Analysis Plug-ins
Dashboard View
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
https://oss.navercorp.com/ohchang-kwon/npush2-feedback-api.git
https://oss.navercorp.com/ohchang-kwon/npush2-feedback-api/tree/development
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions