Jenkins 서버가 내부 네트워크망에 있어 별도의 프록시 서버를 통해서만 외부 접근이 가능할 경우 외부에 접속하여 바로 설치할 수 있는 Plugin 조회 및 설치가 불가합니다. HTTP 프록시를 설정하고 프록시 서버를 통해 Plugin 설치가 가능하도록 Plugin 설정을 알아봅시다.
Jenkins Plugin 설정 변경
Jenkins 관리 -> System Configuration -> 플러그인 관리 메뉴에 접속하여 Plugin 관련 설정을 추가합니다.
Advanced Setting 메뉴에서 HTTP 프록시 설정의 서버 항목과 포트 항목을 프록시 서버 정보로 설정한 후 Submit 버튼을 클릭하여 적용합니다.
HTTP 프록시 설정을 추가 완료하였으므로 Available Plugins 메뉴에서 설치하고자하는 Plugin 조회 및 설치가 가능합니다.
Jenkins Pulugin HTTP 프록시 설정을 추가하는 작업을 완료하였습니다...! 끝...!
Jenkins는 지속적 통합(Continuous Integration)을 제공하는 툴입니다. GitHub, GitLab과 같은 Code Repository와 연동하여 소스 코드의 커밋을 감지하여 빌드 및 테스트를 자동화 할 수 있습니다. Docker 컨테이너를 통해 Jenkins 서비스를 설치해보겠습니다.
Jenkins docker-compose.yml 파일 작성
최신 LTS 버전인 jenkins/jenkins:lts-jdk11 이미지를 사용하여 Jenkins를 구성해보도록 하겠습니다. 서비스 포트인 8080번, 50000번 포트를 포워딩 설정하고, 주요 디렉토리를 마운트하도록 설정합니다.
리눅스 head 명령어를 통해 문자열의 앞부분을 확인하거나 tail 명령어로 마지막 부분을 출력할 수 있습니다.
테스트 시 활용할 text 파일 내용
# cat text
An apple is a fruit.
The sky is blue.
Today is Monday.
Cutting paper with scissors.
Trees grow on the ground.
The sun rises in the east.
The earth is round.
The winter night air is cold.
Drinking water every morning.
The bus has already left.
문자열 앞부분 출력하기
문자열 앞부분 두번째 줄까지 출력하기
-n 옵션을 사용하거나 직접 -2 숫자를 지정할 수 있습니다.
# cat text | head -n 2
An apple is a fruit.
The sky is blue.
# cat text | head -2
An apple is a fruit.
The sky is blue.
문자열 앞부분부터 특정 바이트 단위까지 출력하기
-c 옵션 사용
# cat text | head -c 50
An apple is a fruit.
The sky is blue.
Today is Mon
문자열 마지막 부분 출력하기
문자열 마지막 부분 세번째 줄까지 출력하기
-n 옵션을 사용하거나 직접 -2 숫자를 지정할 수 있습니다.
# cat text | tail -n 3
The winter night air is cold.
Drinking water every morning.
The bus has already left.
# cat text | tail -3
The winter night air is cold.
Drinking water every morning.
The bus has already left.
문자열 마지막 부분부터 특정 바이트 단위까지 출력하기
-c 옵션 사용
# cat text | tail -c 50
ng water every morning.
The bus has already left.