Repository: incubator-stratos Updated Branches: refs/heads/master 8dd3a71ee -> 8d5df0cd6
latest updates to nodejs after testing it. Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/8d5df0cd Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/8d5df0cd Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/8d5df0cd Branch: refs/heads/master Commit: 8d5df0cd6b08544c11a1f16ea945b675e1e62440 Parents: 8dd3a71 Author: Nirmal Fernando <[email protected]> Authored: Tue Feb 25 11:42:09 2014 +0530 Committer: Nirmal Fernando <[email protected]> Committed: Tue Feb 25 11:42:09 2014 +0530 ---------------------------------------------------------------------- tools/puppet3/modules/nodejs/manifests/init.pp | 29 +++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8d5df0cd/tools/puppet3/modules/nodejs/manifests/init.pp ---------------------------------------------------------------------- diff --git a/tools/puppet3/modules/nodejs/manifests/init.pp b/tools/puppet3/modules/nodejs/manifests/init.pp index 3d967ac..b709612 100644 --- a/tools/puppet3/modules/nodejs/manifests/init.pp +++ b/tools/puppet3/modules/nodejs/manifests/init.pp @@ -9,33 +9,39 @@ class nodejs { $nodejs_home = "${target}/nodejs" } - package { ['npm','git-all']: + package { ['python-software-properties', 'python', 'g++', 'make']: ensure => installed, } - file { - '${nodejs_home}/': - ensure => present; - } - exec { + 'update-apt': + path => ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/'], + command => 'apt-get update > /dev/null 2>&1'; + + 'add-repo': + path => ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/'], + command => 'add-apt-repository ppa:chris-lea/node.js > /dev/null 2>&1'; + 'Create nodejs home': path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', command => "mkdir -p ${nodejs_home}"; 'Install libraries': path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', - cwd => $nodejs_home, - command => 'npm install express', + cwd => "${nodejs_home}", + command => 'apt-get install nodejs', require => [ - File['${nodejs_home}/'], - Package['npm'], + Exec['update-apt'], + Package['python-software-properties', 'python', 'g++', 'make'], + Exec['add-repo'], + Exec['update-apt'], + Exec['Create nodejs home'], ]; 'Start application': path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', - cwd => '${nodejs_home}', + cwd => "${nodejs_home}", onlyif => 'test -f web.js', command => 'node web.js > /dev/null 2>&1 &', tries => 100, @@ -43,3 +49,4 @@ class nodejs { require => Exec['Install libraries']; } } +
