Created
August 19, 2015 03:22
-
-
Save hell0again/7ccc3929d89b85cde49b to your computer and use it in GitHub Desktop.
deploy key運用向けにGIT_SSHで指定するラッパースクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Description: | |
# GIT_SSH wrapper for github "deploy key" solution | |
# | |
# Usage: | |
# 1. create ssh key in .ssh/deploy_key/${YOUR_REPO}/id_rsa{,.pub} | |
# 2. register the created ssh key as deploy key | |
# 3. GIT_SSH=~/.ssh/git_ssh git pull origin master | |
set -eu | |
[ ${SET_X:-false} = true ] && set -x | |
SCRIPT_DIR=$(cd $(dirname $0) && pwd) | |
KEYS=$(find ${SCRIPT_DIR}/deploy_key/ -type f ! -name "*.pub") | |
#echo ssh $(for key in ${KEYS}; do printf ' -i %s' ${key}; done) $@ | |
ssh $(for key in ${KEYS}; do printf ' -i %s' ${key}; done) $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment