0

Part of my employer's practices is to avoid including css files in project repositories. Due to past issues with merge conflicts centering around CSS, its been decided to push SASS file changes only, and re-compile the stylesheets as necessary. We use Compass in house for compiling SASS to CSS.

What I'd like to do is implement a compass compile execution upon a successful git pull event. This seems easily done with a git pull alias, but git hooks also exist. Finally, a third option is to have compass watch run as an infinite process.

This last seems to be resource wasteful, as the production server is updated weekly at best. So what would be best practice in executing a compass compile event after a successful git pull and how would it be done?

Jason
  • 11,263
  • 21
  • 87
  • 181
  • Does your site run off the source directories, exactly as committed to git? Or is there a build phase, which creates final artifacts (class files, libs, etc.)? – Paul Hicks May 07 '14 at 20:27
  • Initially, this would be used on a drupal site, so no artifacts are generated. However, it would be helpful if the solution could be adapted to Java projects in development. – Jason May 07 '14 at 20:33

1 Answers1

0

If your production server pulls from a remote repository, you probably want to put your script in the post-merge client-side hook.

If your workflow pushes changes to the production server, then you want the post-receive hook.

For projects with a build phase, then you probably shouldn't use hooks, since you'll be building from the git repository (source tree) to a different location (target tree), that isn't committed to git. The compiling of your CSS files happens in the same manner as compiling your java files. You should have a build step, in your pom, ant script, or whatever tool you use to govern each project's build, and it looks after production of all artifacts.

Paul Hicks
  • 13,289
  • 5
  • 51
  • 78