{"id":438,"date":"2013-10-14T10:01:00","date_gmt":"2013-10-14T10:01:00","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/2013\/10\/14\/puppet-module-to-setup-nodejs-deployment\/"},"modified":"2025-11-21T20:35:26","modified_gmt":"2025-11-21T15:05:26","slug":"puppet-module-to-setup-nodejs-deployment","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2013\/10\/14\/puppet-module-to-setup-nodejs-deployment\/","title":{"rendered":"Puppet module to setup                                                      nodejs deployment"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\">\n<p>I would like to share my puppet module to setup nodejs deployment infrastructure on a linux box. This module performs the basic setup required to facilitate the automated deployment of a nodejs app. Very soon I&#8217;ll be introducing another generic puppet module that will run on top of this module &amp; provide a full fledged automatic deployment of any node app. To view the source code of this module you can refer my github repository.<\/p>\n<p>Let&#8217;s talk about what this module actually does. First of all we create a nodejs user which we will use for all deployment related activities of all the node app&#8217;s, as a convention we have created a folder \/home\/nodejs\/nodeapps this folder will contain all the code of our node applications.<\/p>\n<p>This modules adds 2 scripts as well the first one is <i>deployNodeApp.sh<\/i>, <i>deployNodeApp.sh<\/i> is a generic script that assumes that node app code will be present in tar form at \/home\/nodejs it will clean existing code of nodeapp at <i>\/home\/nodejs\/nodeapps<\/i> untar the code at corresponding directory of node app &amp; restart the node app. As another convention we are using upstart for managing the node app i.e starting &amp; stopping the node app I&#8217;ll talk about the upstart configuration in my next blog where I&#8217;ll talk about generic puppet module for a node app. Another script <i>startNodeApp.sh<\/i> will take care of starting the node app after doing some per-processing such as loading some environment specific properties of node app which we don&#8217;t want to commit in the codebase i.e want to separate it out from deployment process choosing a specific version of node.<\/p>\n<p>This module also takes cares of installing <b>nvm<\/b> for nodejs user so that nodejs version can be managed locally for this user or app.<\/p>\n<p>Though we already have a puppet module for <a href=\"https:\/\/forge.puppetlabs.com\/proletaryo\/nvm_nodejs\" target=\"_blank\" rel=\"noopener\">nodejs<\/a>, but I had some specific requirements which I wanted to handle that&#8217;s why I&#8217;ve created this module.<\/p>\n<p>Let me know if you have some points of improvement in this module, one thing that I wanted to add in this module is to add npm installation but it had some other dependencies also I had some doubts whether I should have npm as part of nodejs module or not.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I would like to share my puppet module to setup nodejs deployment infrastructure on a linux box. This module performs the basic setup required to facilitate the automated deployment of a nodejs app. Very soon I&#8217;ll be introducing another generic puppet module that will run on top of this module &amp; provide a full fledged &hellip; <a href=\"https:\/\/opstree.com\/blog\/2013\/10\/14\/puppet-module-to-setup-nodejs-deployment\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Puppet module to setup                                                      nodejs deployment&#8221;<\/span><\/a><\/p>\n","protected":false},"author":171775670,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474,3548],"tags":[44070,768739308,31896918,530811,768739288],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-74","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/438"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/171775670"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":2,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":30018,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions\/30018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}