Created
March 18, 2013 20:56
-
-
Save tabo/5190734 to your computer and use it in GitHub Desktop.
Helper scripts for my jenkins server that spawn databases in RAM
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 | |
HOST=dummy_test_database_server | |
createuser -U jenkins -h $HOST -p 5434 postgres -s | |
createdb -U jenkins -h $HOST -p 5434 treebeard | |
mysql -u root -P 3308 -h $HOST -e 'CREATE DATABASE treebeard;' | |
mysql -u root -P 3308 -h $HOST -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';" |
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 | |
. ramdisk.sh | |
. mysql-spawn.sh | |
. postgres-spawn.sh | |
. mysql-start.sh | |
. postgres-start.sh | |
sleep 1 | |
. createdbs.sh | |
. jenkins-start.sh | |
echo 'WOO! <o/' |
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 | |
PATH=$HOME/.local/bin:$HOME/.pythonbrew/bin:$HOME/.pythonbrew/pythons/Python-2.7.2/bin:$PATH \ | |
java \ | |
-d64 -server \ | |
-XX:+UseConcMarkSweepGC \ | |
-Xms256m -Xmx512m \ | |
-jar jenkins.war --ajp13Port=-1 --httpPort=8004 --prefix=/jenkins \ | |
--logfile=$HOME/.jenkins/jenkins.log \ | |
--daemon |
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 | |
unset TMPDIR | |
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/Volumes/jenkins_ramdisk/mysql --tmpdir=/tmp |
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 | |
MYSQL_DIR="/Volumes/jenkins_ramdisk/mysql" | |
echo "Starting JENKINS MySQL (0.0.0.0:3308)..." | |
mysqld_safe --no-defaults --datadir=$MYSQL_DIR --pid-file=$MYSQL_DIR/mysql.pid --port=3308 --socket=$MYSQL_DIR/sock > /dev/null 2>&1 & |
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 | |
kill -0 `cat /Volumes/jenkins_ramdisk/mysql/mysql.pid` | |
kill `cat /Volumes/jenkins_ramdisk/mysql/mysql.pid` |
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
local all all trust | |
host all all 127.0.0.1/32 trust | |
host all all ::1/128 trust | |
host all all 10.211.55.0/24 trust |
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 | |
initdb /Volumes/jenkins_ramdisk/postgres | |
cp pg_hba.conf /Volumes/jenkins_ramdisk/postgres/ |
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 | |
PGDIR="/Volumes/jenkins_ramdisk/postgres" | |
echo "Starting JENKINS PostgreSQL (0.0.0.0:5434)..." | |
pg_ctl -D $PGDIR -l $PGDIR/postgresl.log -o '-F -i -h 0.0.0.0 -p 5434' start |
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 | |
PGDIR="/Volumes/jenkins_ramdisk/postgres" | |
pg_ctl -D $PGDIR stop -s -m fast |
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 | |
# 512MB ramdish | |
diskutil erasevolume HFS+ "jenkins_ramdisk" `hdiutil attach -nomount ram://1058576` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment