Last active
December 26, 2015 09:09
-
-
Save xarses/7126943 to your computer and use it in GitHub Desktop.
Git post hook setup script.
This file contains 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
[remote "node"] | |
fetch = +refs/heads/*:refs/remotes/node/* | |
url = ssh://10.108.3.2/root/git-repo/fuel.git | |
url = ssh://10.108.7.2/root/git-repo/fuel.git | |
url = ssh://10.108.11.2/root/git-repo/fuel.git |
This file contains 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
git push -f +ceph-rados:refs/heads/master |
This file contains 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/bash | |
download=`host -t A download.mirantis.com | awk '/has address/{print $4}'` | |
pubkey=`cat ~/.ssh/id_rsa.pub` | |
ssh -t root@$1 <<EOF | |
echo ${download} download.mirantis.com >>/etc/hosts | |
echo ${pubkey} >> ~/.ssh/authorized_keys | |
puppet apply -e "class {'ceph::yum':}" | |
yum install -y git | |
cd ~ | |
mkdir -p git-repo/fuel.git | |
cd git-repo/fuel.git | |
git init --bare | |
mkdir /root/fuel | |
echo '#!/bin/sh' > hooks/post-receive | |
echo 'GIT_WORK_TREE=/root/fuel git checkout -f' >> hooks/post-receive | |
chmod +x hooks/post-receive | |
rm -rf /etc/puppet/modules | |
chmod +rx /root | |
ln -s /root/fuel/deployment/puppet /etc/puppet/modules | |
rm /etc/puppet/manifests/site.pp | |
ln -s /etc/puppet/modules/osnailyfacter/examples/site.pp /etc/puppet/manifests/site.pp | |
EOF | |
git remote add node ssh://root@${1}/root/git-repo/fuel.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment