LoginSignup
0
2

More than 5 years have passed since last update.

Bitbucket - SSH接続、Jenkins連携、Slack連携

Last updated at Posted at 2017-03-30

Jenkins連携

  1. Bitbucket Pluginpluginインストール
  2. Jenkins > project > settings
    1. source code management
      • repo URL: https~
      • auth info: add account
    2. build/trigger
      • Build when a change is pushed to BitBucket
  3. Bitbucket > repo > settings > Hooks
    1. Bitbucket Server Webhook to Jenkins

Jenkins再起動方法

Jenkins URL: http://host:8080/safeRestartにアクセスする

Slack連携

  1. Slack Notification Pluginpluginインストール
  2. Jenkins > Jenkins management
    1. Global Slack Notifier Settings
      • Team Subdomain
      • Integration Token
  3. Jenkins > Project > settings
    1. ビルド後の処理
      • 必要なものにチェック
  4. Slack > Apps & integrations
    1. 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 setting

# ~/.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を追加する

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2