As a bonus, removed the apt-get stuff from Lua and reqs
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-fw_depends nodejs
@@ -1,14 +1,12 @@
#!/bin/bash
-export NODE_HOME=${IROOT}/node-v0.10.8-linux-x64
sed -i 's|mongodb://.*/hello_world|mongodb://'"${DBHOST}"'/hello_world|g' app.js
sed -i 's|localhost|'"${DBHOST}"'|g' app.js
-export PATH=$PATH:$NODE_HOME/bin
+fw_depends nodejs
-${NODE_HOME}/bin/npm install
-${NODE_HOME}/bin/node app &
+npm install
+node app &
# !DO NOT REMOVE!
#
@@ -1,14 +1,11 @@
-export NODE_ENV=production
@@ -17,4 +14,4 @@ ${NODE_HOME}/bin/node app &
# executing this script will be terminated before the
# application has time to awaken and be forked, and
# express will fail to be started
-sleep 5
+sleep 5
@@ -1,5 +0,0 @@
@@ -1,15 +1,12 @@
sed -i 's|localhost|'"${DBHOST}"'|g' hello.js
sed -i 's|mongodb//.*/hello_world|mongodb//'"${DBHOST}"'/hello_world|g' hello.js
-${NODE_HOME}/bin/node hello.js &
+node hello.js &
@@ -18,4 +15,4 @@ ${NODE_HOME}/bin/node hello.js &
-fw_depends java ringojs
@@ -2,12 +2,12 @@
sed -i 's|dbHost = \x27.*\x27;|dbHost = \x27'"${DBHOST}"'\x27|g' app/models.js
-sudo rm -rf /usr/share/ringojs/packages/*
-sudo ringo-admin install oberhamsi/sql-ringojs-client
-sudo ringo-admin install grob/ringo-sqlstore
-sudo ringo-admin install ringo/stick
-sudo ringo-admin install oberhamsi/reinhardt
-sudo mkdir -p /usr/share/ringojs/packages/ringo-sqlstore/jars/
-sudo cp /usr/share/ringojs//packages/sql-ringojs-client/jars/mysql.jar /usr/share/ringojs/packages/ringo-sqlstore/jars/
-ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &
+fw_depends java ringojs
+
+rm -rf $RINGOJS_HOME/packages/*
+ringo-admin install oberhamsi/sql-ringojs-client
+ringo-admin install grob/ringo-sqlstore
+ringo-admin install ringo/stick
+ringo-admin install oberhamsi/reinhardt
+ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &
@@ -2,6 +2,8 @@
sed -i 's|dbHost = \x27.*\x27;|dbHost = \x27'"${DBHOST}"'\x27|g' ringo-main.js
-fw_depends lua nginx openresty
-sudo luarocks install --server=http://rocks.moonscript.org lapis
@@ -4,7 +4,8 @@ sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' config.lua
sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' config.moon
sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' nginx.conf
-export LAPIS_OPENRESTY=${IROOT}/openresty-1.7.7.1
-export PATH=${LAPIS_OPENRESTY}/nginx/sbin:$PATH
+fw_depends lua luarocks nginx openresty lapis
-lapis server production &
+luarocks install lapis
+lapis server production &
@@ -1,7 +1,8 @@
-export OPENRESTY_HOME=${IROOT}/openresty-1.7.7.1
sed -i 's|CWD|'"${TROOT}"'|g' nginx.conf
sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' app.lua
-${OPENRESTY_HOME}/nginx/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes '"${MAX_THREADS}"';" &
+fw_depends lua nginx openresty
+nginx -c $TROOT/nginx.conf -g "worker_processes '"${MAX_THREADS}"';" &
@@ -83,7 +83,7 @@ class FrameworkTestType:
# Get response body
p = subprocess.Popen(["curl", "-m", "15", "-s", url], stdout=PIPE, stderr=PIPE)
(out, err) = p.communicate()
- print " Response (trimmed to 40 bytes): \"%s\"" % out.strip()[:40]
+ print " Response (trimmed to 40 bytes): \"%s\"" % out.strip().replace('\n','')[:40]
return out
def verify(self, base_url):
@@ -1,14 +1,17 @@
-RETCODE=$(fw_exists ${IROOT}/lua5.1.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
-# Eventually, we should also install lua5.2 and luajit
-#
-# At the moment they seem to cause issues with lapis
-# being able to compile. Since no Lua test is using
-# either luajit or lua5.2 at the moment I have just
-# left them out
-sudo apt-get install -y lua5.1 luarocks
-touch ${IROOT}/lua5.1.installed
+VERSION="5.1.5"
+LUA=$IROOT/lua$VERSION
+RETCODE=$(fw_exists ${LUA}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+ source $LUA.installed
+ return 0; }
+fw_get https://github.com/LuaDist/lua/archive/5.1.5-Ubuntu-x86_64.tar.gz
+fw_untar 5.1.5-Ubuntu-x86_64
+LUA_HOME=$IROOT/lua-5.1.5-Ubuntu-x86_64
+echo "export LUA_HOME=${LUA_HOME}" > $LUA.installed
+echo -e "export PATH=${LUA_HOME}/bin:\$PATH" >> $LUA.installed
+source $LUA.installed
@@ -1,15 +1,21 @@
-RETCODE=$(fw_exists ${IROOT}/node-v0.10.8.installed)
+VERSION="0.10.8"
+NODE=$IROOT/node-v$VERSION
+NODE_HOME=$NODE-linux-x64
+RETCODE=$(fw_exists ${NODE}.installed)
+ source $NODE.installed
-fw_get http://nodejs.org/dist/v0.10.8/node-v0.10.8-linux-x64.tar.gz
-fw_untar node-v0.10.8-linux-x64.tar.gz
+fw_get http://nodejs.org/dist/v$VERSION/node-v$VERSION-linux-x64.tar.gz
+fw_untar node-v$VERSION-linux-x64.tar.gz
# Upgrade npm to avoid https://github.com/npm/npm/issues/4984
${NODE_HOME}/bin/npm install -g npm
-touch ${IROOT}/node-v0.10.8.installed
+echo "export NODE_HOME=${NODE_HOME}" > $NODE.installed
+echo "export NODE_ENV=production" >> $NODE.installed
+echo -e "export PATH=${NODE_HOME}/bin:\$PATH" >> $NODE.installed
+source $NODE.installed
@@ -1,12 +1,17 @@
-RETCODE=$(fw_exists ${IROOT}/ringojs_0.10.installed)
+VERSION="0.10"
+RINGOJS=$IROOT/ringojs_$VERSION
+RINGOJS_HOME=$IROOT/ringojs-$VERSION
+RETCODE=$(fw_exists ${RINGOJS}.installed)
+ source $RINGOJS.installed
-fw_get http://www.ringojs.org/downloads/ringojs_0.10-1_all.deb
-sudo apt-get install -y jsvc
-sudo dpkg -i ringojs_0.10-1_all.deb
+fw_get http://ringojs.org/downloads/ringojs-0.10.tar.gz
+fw_untar ringojs-0.10.tar.gz
-rm -f ringojs_0.10-1_all.deb
+echo "export RINGOJS_HOME=${RINGOJS_HOME}" > $RINGOJS.installed
+echo -e "export PATH=${RINGOJS_HOME}/bin:\$PATH" >> $RINGOJS.installed
-touch $IROOT/ringojs_0.10.installed
+source $RINGOJS.installed
@@ -0,0 +1,22 @@
+#!/bin/bash
+VERSION="2.2.1"
+LUAROCKS=$IROOT/luarocks-$VERSION
+RETCODE=$(fw_exists ${LUAROCKS}.installed)
+ source $LUAROCKS.installed
+fw_depends lua
+fw_get http://luarocks.org/releases/luarocks-2.2.1.tar.gz
+fw_untar luarocks-2.2.1.tar.gz
+cd $LUAROCKS
+./configure --prefix=$LUAROCKS --with-lua=$LUA_HOME
+make bootstrap
+echo "export LUAROCKS_HOME=${LUAROCKS}" > $LUAROCKS.installed
+echo -e "export PATH=${LUAROCKS}/bin:\$PATH" >> $LUAROCKS.installed
+source $LUAROCKS.installed
@@ -1,7 +0,0 @@
-RETCODE=$(fw_exists /usr/local/bin/lapis)
-sudo apt-get install -y luarocks
-sudo luarocks install http://github.com/leafo/lapis/raw/9e8b92bf40983a830312c1745c73db74db77192d/lapis-dev-1.rockspec
@@ -1,7 +1,11 @@
-RETCODE=$(fw_exists ${IROOT}/openresty-1.7.7.1.installed)
+VERSION="1.7.7.1"
+OPENRESTY=$IROOT/openresty-$VERSION
+RETCODE=$(fw_exists ${OPENRESTY}.installed)
+ source $OPENRESTY.installed
fw_depends nginx lua
@@ -13,4 +17,7 @@ cd ngx_openresty-1.7.7.1
make -j4
make install
-touch ${IROOT}/openresty-1.7.7.1.installed
+echo "export OPENRESTY_HOME=${OPENRESTY}" > $OPENRESTY.installed
+echo -e "export PATH=${OPENRESTY}/nginx/sbin:\$PATH" >> $OPENRESTY.installed
+source $OPENRESTY.installed