Obsidian/Recognition/Work Related/1.업무메모/2024-03-25.md

4.7 KiB

SFR-27

  1. 플랫폼 감시
  2. 플랫폼 제어
  • 하부시스템에 대한 Start, Stop, Restart, Shutdown 동작
  • 응용프로그램 설치 및 update
  1. 플랫폼 관리
  • 설치된 SW 버전 관리
    • S/W 별 버전 정보 이력이 표시 된다.
  • 최신 SW 및 어플리케이션 관리
  • ~~운영환경 관리
    • 관리시스템 S/W

Jenkins Book

https://www.jenkins.io/doc/book/blueocean/

Jenkins 사용

https://dev-overload.tistory.com/39

Jenkins 설치

https://marindie.github.io/jenkins/Ubuntu-Jenkins-Install-KR-copy/#google_vignette https://server-engineer.tistory.com/763

https://ppoble.tistory.com/52#google_vignette

https://hwannny.tistory.com/89

Jenkins + Docker

https://1minute-before6pm.tistory.com/49

특정 파일만 배포

https://hye0-log.tistory.com/42 https://velog.io/@ysy3285/GitLab-Jenkins-CICD-%EA%B5%AC%EC%B6%95%ED%95%98%EA%B8%B02 https://g4daclom.tistory.com/78

젠킨스 플러그인 사이트 : https://plugins.jenkins.io/

publish over ssh 대체 SSH Plugin : https://ktaes.tistory.com/100


Docker-compose

# 인터넷 연결되는 환경에서 작업
# docker image, jenkins plugin 파일 다운받아야함.

mkdir ./jenkins && cd jenkins
mkdir ./jenkins_home
nano docker-compose-jenkins.yml

--------------------------------------------------------------------------------
version: '3.8'
services:
  jenkins: 
    image: jenkins/jenkins:lts
    container_name: jenkins
    user: root
#    environment:
#      - TZ=Asia/Seoul
    privileged: true
    ports:
      - 9900:8080
#      - 9000:50000
    volumes:
      - ./jenkins_home:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
	restart: unless-stopped
--------------------------------------------------------------------------------
docker-compose build && docker-compose up -d


# Jenkins Unlock Password 확인 (Unlock 이후 파일 삭제됨)
cat ./jenkins_home/secrets/initialAdminPassword

# jenkins 페이지 초기 설정 
1. http://{hostname}:9900 접속하여 Unlock
2. 계정 생성
3. Jenkins URL 정보 확인 및 수정
Start using Jenkins 버튼


# Install Suggested plugins 선택하여 기본 plugin 설치
# 또는 Plugin 수동 설치 [Plugin 수동 설치]

# 추가 플러그인 설치
> Jenkins 관리 -> Jenkins Global Tool Configuration
1. Bitbucket Pipeline for Blue Ocean
2. Dashboard for Blue Ocean
3. Personalization for Blue Ocean
4. Display URL for Blue Ocean
5. Server Sent Events (SSE) Gateway
6. Events API for Blue Ocean
7. Blue Ocean Pipeline Editor
8. i18n for Blue Ocean
9. Autofavorite for Blue Ocean
10. Blue Ocean
11. NodeJS
12. GitLab
13. Generic Webhook Trigger
14. Gitlab Authentication
15. Gitlab API
16. GitLab Branch Source
17. Gitlab Merge Request Builder
18. Config File Provider
19. Docker
20. Docker Pipeline
21. docker-build-step

※ GITLAB ?
https://pangtrue.tistory.com/356
https://pulpul8282.tistory.com/288


# publish over ssh 설정

# SSH key 발급
docker exec -it jenkins bash

ssh-keygen

cat /root/.ssh/id_rsa

-------------------------------------------------------
#배포 대상 서버 설정
## jenkins 서버에서 내용복사
cat /root/.ssh/id_rsa.pub

## 배포서버 root 로그인
## 파일생성하고 복사한 내용 붙여넣기
nano /root/.ssh/authorized_keys

## 폴더, 파일 권한 변경
chmod 700 /root/.ssh
chmod 644 /root/.ssh/authorized_keys
---------------------------------------------------------

# Jenkins 페이지에서 배포서버 추가
Dashboard > Jenkins 관리 >System
Publish over SSH > 추가




https://velog.io/@wijoonwu/AWS-Jenkins-%EC%9E%90%EB%8F%99-%EB%B0%B0%ED%8F%AC

Plugin 수동 설치


cp -r jenkins_home/plugins/*.jpi jenkins_plugins/

ls | grep '.jpi' | cut -d . -f 1 | while read line; do mv $line.jpi $line.hpi; done

tar -cvf plugins.tar ./jenkins_plugins


# 수동설치 할 서버
tar -xvf plugins.tar -C /home/gmt/jenkins_home/plugins/




```bash

ssh-keygen

# Key Jenkins 등록
cat /root/.ssh/id_rsa

# 접속 대상서버로 Key 전송
ssh-copy-id -i id_rsa.pub -p 11443 root@10.200.31.136


  • GitLab 설정

  • Webhook 설정시 (Url is blocked: Requests to the local network are not allowed) 오류시
    ~~ /admin/application_settings/network Outbound requests -> Allow requests to the local network from web hooks and services 체크

기타