/
Jenkins 폐쇠망 설치

Jenkins 폐쇠망 설치




젠킨스 설치

폐쇠망 젠킨스 도커 설치 금지 - 환경변수 수동으로 작업해야함

 

Yum 파일 다운로드

Yum localinstall으로 설치

Plugin 설치 스킵

plugin 오프라인으로 업로드 하여 설치 혹은 같은 버전 오픈망에서 설치하여 {Jenkins_home}/plugins 폴더 압축 → 폐쇠망 Jenkins 디렉토리 같은 위치에 복사

젠킨스 실행

 

젠킨스 설정

배포 SSH 서버 등록

SSH 서버 설정

Jenkins 관리 → 시스템 설정 → Publish Over SSH 

SSH server

Name: 서버명(임의로 지정)

  • (예시) 개발API → devapi01

Hostname: 서버IP

username: 서버 사용자

Remote Directory: 최초 진입 경로

고급 → Use password authentication, or use a different key 체크박스 클릭

Passphrase / Password: 사용자 비밀번호



Jenkins 스크립트 적용

Parameters에 파라미터 선언

 

parameters {    // SSH SERVER 접속 정보    choice(name: 'SSH_SERVER_NAME', choices: [ 'apiprd01', 'apiprd02' ]) }

 

 

SSH publisher → configName에 변수 적용

sshPublisher(
  publishers: [
    sshPublisherDesc(
      configName: "${SSH_SERVER_NAME}",
      transfers: [
        sshTransfer(
          remoteDirectory: "${JOB_BASE_NAME}",
          execCommand: """pwd
            echo 'command input'
          """,
          excludes: '',
          cleanRemote: false,
          execTimeout: 2560000,
          flatten: false,
          makeEmptyDirs: false,
          noDefaultExcludes: false,
          patternSeparator: '[, ]+',
          remoteDirectorySDF: false,
          sourceFiles: '**/*.war, shell/backendCore-emmp-prd.sh, libs/libsapjco3.so'
      )],
      usePromotionTimestamp: false,
      useWorkspaceInPromotion: false,
      verbose: false
)])



Master-Slave

안드로이드 및 iOS 빌드 서버 접근 관리

Jenkins관리 → 노드 관리



파이프 라인 스크립트 사용방법

agent 부분에 서버명 선언

label 값은 노드 관리에 등록되어있는 서버명

pipeline { agent { label 'android01 || android02' } }



노드 버전 변경

Nodejs공식 홈페이지에서 다운받아 binary로 설치

  • (예시) /opt/node-v14.16.1-linux-x64 

Jenkins 관리 → global tool config → NodeJS



Run shell command에서 환경변수 등록

# Name = NODE_HOME NODE_VERSION=v14.16.1 NODE_DISTRO=linux-x64 NODE_HOME="/opt/node-${NODE_VERSION}-${NODE_DISTRO}"  export PATH=$PATH:$HOME/bin:$PATH:$NODE_HOME/bin

 

파이프라인 스크립트에 선언

사용하고자 하는 Stage에 선언

 

SSH로 Node 명령어 실행시 환경 변수를 못찾는 경우

emmpadm의 bash_profile에 환경변수 등록 후 사용하고자 하는 위치에서 source ~/.bash_profile 명령어 실행




노드 버전 변경 후 tarball 에러 발생시

API 운영서버 nas에 headers 파일 저장 후 젠킨스에서 실행

sh "npm config set tarball http://emmp-api.skhynix.com/nas/proto-ui-libs/node-v14.16.1-headers.tar.gz"

 

 

 

플러그인 설치

오프라인 환경에서는 업로드 하여 설치 진행



사용하고자 하는 플러그인 검색

https://plugins.jenkins.io/



플러그인 업로드

Jenkins config → 플러그인매니저 → 고급 → 플러그인 업로드 → 지금 확인 클릭

 

Related content

Jenkins 설정
Jenkins 설정
Read with this
Nginx Applicaion 서버 conf 설정
Nginx Applicaion 서버 conf 설정
Read with this
Nginx global 설정(nginx.conf)
Nginx global 설정(nginx.conf)
Read with this
Gitlab 설치 - Docker
Gitlab 설치 - Docker
Read with this
Node.js 설치 - Rhel 7,8
Node.js 설치 - Rhel 7,8
Read with this
서버 초기 설정 - Rhel 7,8
서버 초기 설정 - Rhel 7,8
Read with this