-
-
Save kylegibson/3859018 to your computer and use it in GitHub Desktop.
Configure Jenkin slave
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/sh | |
main() { | |
configure_ssh_known_hosts | |
configure_mysql_ram_disk | |
configure_idle_tracking | |
} | |
configure_ssh_known_hosts() { | |
echo configuring ssh known hosts | |
# Fetch github's SSH host information and add it to known_hosts to | |
# prevent git clone from asking whether it is valid or not | |
ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts | |
# Also add github.com's ip address because it seems to be breaking otherwise | |
ssh-keyscan -t rsa $(dig +short A github.com) >> $HOME/.ssh/known_hosts | |
# Hard-code this IP documented by github. We haven't experienced a failure as a result of this, but just in case... | |
# https://help.github.com/articles/error-permission-denied-publickey#check-that-you-are-connecting-to-the-correct-server | |
ssh-keyscan -t rsa 207.97.227.239 >> $HOME/.ssh/known_hosts | |
chmod 600 $HOME/.ssh/known_hosts | |
chown ubuntu.ubuntu $HOME/.ssh/known_hosts | |
} | |
configure_mysql_ram_disk() { | |
echo configuring mysql ram disk | |
sudo service mysql stop; | |
sudo cp -pRL /var/lib/mysql /dev/shm/mysql; | |
sudo cat > /etc/mysql/conf.d/ramdisk.cnf << EOF | |
[mysqld] | |
datadir = /dev/shm/mysql | |
EOF | |
sudo service mysql start; | |
} | |
configure_idle_tracking() { | |
echo configuring idle tracking | |
mkdir -p /tmp/idle-tracking | |
chmod 777 /tmp/idle-tracking | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment