Jenkins連携
-
Bitbucket Plugin
pluginインストール - Jenkins > project > settings
- source code management
- repo URL:
https~
- auth info:
add account
- repo URL:
- build/trigger
Build when a change is pushed to BitBucket
- source code management
- Bitbucket > repo > settings > Hooks
- Bitbucket Server Webhook to Jenkins
- Jenkins URL: http://host:8080/safeRestart
- Repo Clone URL:
HTTP
- Bitbucket Server Webhook to Jenkins
Jenkins再起動方法
Jenkins URL: http://host:8080/safeRestartにアクセスする
Slack連携
-
Slack Notification Plugin
pluginインストール - Jenkins > Jenkins management
- Global Slack Notifier Settings
- Team Subdomain
- Integration Token
- Global Slack Notifier Settings
- Jenkins > Project > settings
- ビルド後の処理
- 必要なものにチェック
- ビルド後の処理
- Slack > Apps & integrations
- Jenkins CI
- Add Configuration
- Select channel
- Jenkins CI
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を追加する