deployment - Should you check in your compiled assets to Git? -
so i've been having discussion co-workers , i'd other people weigh in on this. i'm curious see other developers doing.
what ignore entire build/assets folder repo. folder contains compiled css, javascript, , compressed images. think source files should checked in. find annoying every time make change stylesheet or js file, have check in source file , new compiled version. introduces merge conflicts , other issues when have multiple people working on project. keep repo nice , light , have developer build project locally set up. or when deploy, have server build out project.
this issue, because co-workers use git deploy process. when want deploy, check code git, push remote repo, , ssh server , git fetch && git pull. means of website files have live in repo. have check in assets folder.
how guys handle this? i'm using bedrock-ansible
wordpress site, , there's option run commands right before deploys, configured run npm install && gulp build
, build out project, issue way slow. way bedrock-ansible works creates new release directory each deployment, , symlinks latest 1 current
directory. each time deployed, ran npm install
when in reality, need dependencies in 1 shared directory. there might way npm install --prefix install/dir
haven't tested out yet. think might introduce more issues.
for now, had check in of compiled assets git, working. on gulp watch
task, don't have minification happening, when want deploy, want run gulp build
first minify , uglify - technically have make commit when want deploy site. it's mess. think way handle this?
gulp build
put compiled files in dist/
directory , gulp publish
push directory remote. can use git-directory-deploy this:
$ git-directory-deploy --directory dist --branch master
or can manually set separate branch compiled assets , push remote server when deploying website (this answer might help).
this way can maintain clean history on development branch , not worry merge conflicts while still using git deploy process.
Comments
Post a Comment