Skip to content

Instantly share code, notes, and snippets.

@treehouse-su
Last active August 29, 2015 14:25
Show Gist options
  • Save treehouse-su/ae54996f3d382f403d1a to your computer and use it in GitHub Desktop.
Save treehouse-su/ae54996f3d382f403d1a to your computer and use it in GitHub Desktop.
qa bell nation install scripts
#!/bin/sh
sleep 1
docker start oldnation
sleep 1
docker start newnation
#!/bin/bash
# rename hostname of image to qa
pirateship rename qa
pirateship ethernet 204.9.221.79 255.255.255.128 204.9.221.1 "204.9.221.30 204.9.223.18 204.9.223.19"
sleep 10
function nation {
# s1 = name
# s2 = port
# s3 = version
# create couchdb docker container
docker run -d -p $2:5984 --name $1 -v /srv/data/$1:/usr/local/var/lib/couchdb -v /srv/log/$1:/usr/local/var/log/couchdb dogi/rpi-couchdb
# download BeLL-Apps
mkdir -p /root/ole/$3
cd /root/ole/$3
wget https://github.com/open-learning-exchange/BeLL-Apps/archive/0.11.$3.zip
unzip *.zip
ln -s BeLL-Apps-* BeLL-Apps
cd BeLL-Apps
# create install_linux
echo "node_modules/.bin/couchapp push \$1 \$2" > pushDocToDb.sh
chmod +x node_modules/.bin/couchapp pushDocToDb.sh
cp install_windows install_linux
sed -i "s/pushDocToDb.bat/.\/pushDocToDb.sh/" install_linux
sed -i 's#databases\\\\#databases/#' install_linux
# install nation
node install_linux http://127.0.0.1:$2
curl -X PUT 'http://127.0.0.1:'$2'/_config/httpd/allow_jsonp' -d '"true"'
#curl -X PUT 'http://127.0.0.1:'$2'/_config/httpd/enable_cors' -d '"true"'
#curl -X PUT 'http://127.0.0.1:'$2'/_config/cors/origins' -d '"*"'
curl -X PUT 'http://127.0.0.1:'$2'/_config/admins/nation' -d '"oleoleole"'
}
nation oldnation 5984 52
nation newnation 5985 56
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment