Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should we push the package.json, bower.json, gulpfile.js to production server

I am using gulp, bower, stylus for an angularjs application.

I am not using any Continuous Integration technology, git pulling code from repo manually when git push are made to master branch on bitbucket, considering this scenario :

  1. Is it a good practice to include bower.json, package.json and gulpfile.js on the production server and install dependencies manually by npm install or bower install on server?
  2. Is it safe to include gulpfile.js on the server?

Also, if using any Continuous Integration technology, what would be the best practice?

My .gitignore file is as follows :

node_modules
dist
.tmp
.sass-cache
bower_components
private.xml
nbproject
gruntfile.js
gulpfile.js
package.json
like image 670
imsheth Avatar asked Jul 17 '15 06:07

imsheth


1 Answers

Add package.json and bower.json files to keep the track of dependencies that are being used on production server. However you should skip uploading gulp or grunt files as they are for local use only. They are not needed to be uploaded on production server.

EDIT : If you use grunt/gulp for restarting your node server as well, like using nodemon from grunt/gulp, You may upload grunt/gulp file. In the end if you have structured your node server properly there is no harm putting grunt/gulp file on server, as these interact with your system before server starts.

like image 114
binariedMe Avatar answered Oct 20 '22 17:10

binariedMe