SSH 연결, Jenkins 연계, Slack 연계

5492 단어 Bitbucket


Jenkins 협력


  • Bitbucket Plugin 플러그인 설치
  • Jenkins > project > settings
  • source code management
  • repo URL: https~
  • auth info: add account

  • build/trigger
  • Build when a change is pushed to BitBucket


  • Bitbucket > repo > settings > Hooks
  • Bitbucket Server Webhook to Jenkins
  • Jenkins URL: http://host:8080/safeRestart
  • Repo Clone URL: HTTP



  • Jenkins 재부팅 방법



    Jenkins URL : http://host:8080/safeRestart 방문

    Slack 협력


  • Slack Notification Plugin 플러그인 설치
  • Jenkins > Jenkins management
  • Global Slack Notifier Settings
  • Team Subdomain
  • Integration Token


  • Jenkins > Project > settings
  • 빌드 후 처리
  • 필요한 것에 체크


  • Slack > Apps & integrations
  • Jenkins CI
  • Add Configuration
  • Select channel



  • git



    Git Shortcut Key


    git config --system alias.st status
    git config --system alias.co checkout
    git config --system alias.br branch
    git config --system alias.cm commit
    git config --global --list
    alias g='git'
    # Powershellの場合
    # Set-Alias g git
    

    Bitbucket SSH 설정


    # ~/.ssh/id_rsa.pubと~/.ssh/id_rsaを作成
    ssh-keygen
    
    # id_rsa.pubの中身をbitbucketマイページの ssh settingsにコピペ
    cat ~/.ssh/id_rsa.pub
    

    ~/.bashrc
    SSH_ENV=$HOME/.ssh/environment
    
    # start the ssh-agent
    function start_agent {
        echo "Initializing new SSH agent..."
        # spawn ssh-agent
        /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
        echo succeeded
        chmod 600 "${SSH_ENV}"
        . "${SSH_ENV}" > /dev/null
        /usr/bin/ssh-add
    }
    
    if [ -f "${SSH_ENV}" ]; then
         . "${SSH_ENV}" > /dev/null
         ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
            start_agent;
        }
    else
        start_agent;
    fi
    
    bash -l
    git clone <repo>
    

    SourceTree를 사용하는 경우
    PuTTY Key Generator를 사용하여 ~/.ssh/id_rsa.ppk 만들기
    SSH Agent를 시작하고 ~/.ssh/id_rsa.ppk 추가

    좋은 웹페이지 즐겨찾기