2016-09-16 75 views
2

请找我用来克隆我的git回购代码:如何运行NPM利用混帐回购协议克隆之后木偶上的NodeJS应用程序安装

package { 'git': 
    ensure => 'latest', 
    } 

    vcsrepo { "/nodejs-helloworld": 
    ensure => latest, 
    provider => git, 
    require => [ Package["git"] ], 
    source => "[email protected]:hello-world/nodejs-helloworld.git", 
    revision => 'master', 

    } 

克隆Git仓库中使用的木偶我后,我想运行我的应用程序的NodeJS(克隆库)使用木偶

运行我的应用程序的NodeJS通常请找下面的步骤:

cd nodejs_helloworld/ 
npm install 
npm start 

谁能帮助我或暗示的任何环节为运行节点使用木偶的js应用程序。

回答

2

原油高管将做的伎俩:

exec { '/usr/bin/npm install; /usr/bin/npm start': 
    cwd   => '/nodejs-helloworld', 
    subscribe => Vcsrepo['/nodejs-helloworld'], 
    refreshonly => true, 
}