Working with GRUNT in a (live) dev environment powered by SVN

Hello Everyone

I’m very new to working with Grunt and LESS so I’m trying to get things going at a reasonably pace for myself. My dev environment is live, all commits to SVN get pushed to the DEV server so that multiple developers working with me can access and update on the fly to a dedicated development server. This has benefits for multiple developers working together from different areas.

The downside is that there is no real local development because changes are pushed to the server so the entire team can see and work with the modifications. From looking at the using grunt screencast, it appears that grunt will only run when you locally run the operation.

Are there any options of having grunt run on the server end or would someone need to update the SVN on their end, run the grunt operation and then do a new commit with grunt run changes performed locally first?

Thanks

I would like to know the same!
I absolutely love Grunt and LESS in Roots, so far I’ve been developing a project locally in MAMP with Grunt watch but now I’m ready to deploy the project to a (shared) webhosting environment.

What are the options to keep on using Grunt server side? A workflow where you have to make modifications locally in order to keep on using Grunt and manually upload all the modified files every time, is not really an option for me.

Can’t really find any documentation about this…
Thanks!

There’s no reason why Grunt can’t be run server-side. It’s really no different than running it locally. You just need Node + Grunt installed on the server and to run the same commands.

You could take a look at https://npmjs.org/package/grunt-deploy

Thanks for the information. I think for now I’ll just run the commands locally and update the SVN because I’d be the only one with server level access of the team to run the commands server side and I’d still need to do it. So might as well just do it locally then commit the changes.

But its good to know that option might be available. At an initial view of grunt and roots at a very noob level I thought it ran on the fly where it would detect changes and run the operation. That is not the case and a misunderstanding on my part.

The screencast was definitely a good buy. I would like to see more of those available from the Roots team. Although 90% of my work is Genesis & Genesis Child Theme related. When there is a need (like this one project) Roots is a good way to build your own primary theme.

Hmm, okay thanks!
I have to say I’m quit the noob with node and command lines on servers, therefore I was really happy I got everything running locally :slight_smile: But I’m really interested to get this new Roots workflow working remotely too!

So I got a few questions regarding running Grunt server-side in that perspect (and forgive me if these are noob questions, I’m actually a webdesigner, not a programmer):

  1. What is the server-side equivalent of MacOs Terminal and how do I access it from let’s say DirectAdmin or Plesk?
  2. How do I install Node on a remote shared server, with an installer or with a command line?
  3. How do I install Grunt on a remote shared server, with the same command line: npm install -g grunt-cli?
  4. When working locally, every time when I startup MAMP and start working on a project, I set the right directory in Terminal with cd and start grunt watch. Would I have to do the same on the remote server or will grunt watch run continuously?

Thanks a lot for your expertise!
Cheers

  1. I have no idea about Plesk or DirectAdmin but you definitely need SSH and probably root access to your server. You’d just connect with Terminal also… ssh user@host.

  2. Depends on the server OS, but it will be from the command line.

  3. Grunt is installed the same way via npm once Node is available.

  4. You probably wouldn’t run watch on the server. Just run grunt whenever you want to update the files.

Hmm ok thanks for your reply!
I looked it up and most of my webhosting companies don’t have the option to enable SSH, so that’s useless…

I’m just wundering how everyone else handles this? Always work locally and manually upload the compiled main.min.css everytime? Would be nice if there would be some kind of Grunt Wordpress plugin something like BW LESS-CSS: http://support.briteweb.com/plugins/bw-less-css/

If you can’t get ssh access It’s time to switch webhosts. Greengeeks is fairly cheap and easy and offers ssh. I haven’t installed node.js on their server though, so I run this Gruntfile locally https://gist.github.com/BGundlach/80e36e33c63b3db3b8a7