diff --git a/translator/toscalib/tests/artifacts/mongodb/config.sh b/translator/toscalib/tests/artifacts/mongodb/config.sh index c846d1d..c637113 100644 --- a/translator/toscalib/tests/artifacts/mongodb/config.sh +++ b/translator/toscalib/tests/artifacts/mongodb/config.sh @@ -1,2 +1,7 @@ -#!/bin/bash -stop mongodb +#!/bin/sh -x +# Edit the file /etc/mongodb.conf, update with real IP of Mongo server +# This script configures the mongodb server to export its service on +# the server IP +# bind_ip = 127.0.0.1 -> bind_ip = +# The environment variable mongodb_ip is expected to be set up +sed -i "s/127.0.0.1/$mongodb_ip/" /etc/mongodb.conf diff --git a/translator/toscalib/tests/artifacts/mongodb/create.sh b/translator/toscalib/tests/artifacts/mongodb/create.sh index 8d768a5..e02161c 100644 --- a/translator/toscalib/tests/artifacts/mongodb/create.sh +++ b/translator/toscalib/tests/artifacts/mongodb/create.sh @@ -1,2 +1,4 @@ -#!/bin/bash +#!/bin/sh -x +# This script installs mongodb +apt-get update apt-get install -y mongodb diff --git a/translator/toscalib/tests/artifacts/mongodb/start.sh b/translator/toscalib/tests/artifacts/mongodb/start.sh index 6a4883b..829b21d 100644 --- a/translator/toscalib/tests/artifacts/mongodb/start.sh +++ b/translator/toscalib/tests/artifacts/mongodb/start.sh @@ -1,2 +1,3 @@ -#!/bin/bash -start mongodb +#!/bin/sh -x +# This script starts mongodb +restart mongodb diff --git a/translator/toscalib/tests/artifacts/nodejs/config.sh b/translator/toscalib/tests/artifacts/nodejs/config.sh index 17bca56..4a73279 100644 --- a/translator/toscalib/tests/artifacts/nodejs/config.sh +++ b/translator/toscalib/tests/artifacts/nodejs/config.sh @@ -1,24 +1,28 @@ -#!/bin/bash +#!/bin/sh -x +# This script installs an app for nodejs: the app intended is the paypal app +# and it is configured to connect to the mongodb server +# The environment variables github_url and mongodb_ip are expected to be set up export app_dir=/opt/app git clone $github_url /opt/app -if [ -f /opt/app/package.json ] - cd /opt/app/ && npm install +if [ -f /opt/app/package.json ]; then + cd /opt/app/ && npm install + sed -i "s/localhost/$mongodb_ip/" config.json fi cat > /etc/init/nodeapp.conf <> /var/log/nodeapp.log 2>&1 & + export HOME=/ + export NODE_PATH=/usr/lib/node + exec /usr/bin/node ${app_dir}/app.js >> /var/log/nodeapp.log 2>&1 & end script EOS diff --git a/translator/toscalib/tests/artifacts/nodejs/create.sh b/translator/toscalib/tests/artifacts/nodejs/create.sh index d555008..0fde17d 100644 --- a/translator/toscalib/tests/artifacts/nodejs/create.sh +++ b/translator/toscalib/tests/artifacts/nodejs/create.sh @@ -1,4 +1,5 @@ -#!/bin/bash -add-apt-repository ppa: chris-lea/node.js +#!/bin/sh -x +# This script installs nodejs and the prereq +add-apt-repository ppa:chris-lea/node.js apt-get update -apt-get install -y nodejs build-essential curl git npm +apt-get install -y nodejs build-essential diff --git a/translator/toscalib/tests/artifacts/nodejs/pre_configure_source.sh b/translator/toscalib/tests/artifacts/nodejs/pre_configure_source.sh deleted file mode 100644 index eb9b201..0000000 --- a/translator/toscalib/tests/artifacts/nodejs/pre_configure_source.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cat > /opt/node/config.js<