2016-09-16 72 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, 
}