Reputation: 195
I have a Jenkins server sending commands via SSH to another machine in order to deploy a website, as part of this process I'm using Grunt to build SASS. If I login in to the server and run "grunt build-dev" it works fine, however if I use the following command to send the command to the same server via SSH
ssh myserver.org 'cd /var/www/myserver.org/htdocs/sites/all/themes/myserver; grunt build-dev'
I get an error as following;
npm WARN package.json [email protected] No README data
Running "sass:dev" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Use --force to continue.
Aborted due to warnings.
I have used npm install to add the dependancies for Grunt with no luck, I've also tried adding npm install to the SSH command send to the server which does install the dependancies as expected.
Upvotes: 0
Views: 391
Reputation: 195
As jim mcnamara pointed out in response to my question the issue was indeed an issue with the PATH variable. I managed to resolve the issue with the help of another Stack Overflow question. I added source /etc/profile
to the beginning of my SSH command.
Alternatively I could have probably used RVM to install Ruby/Sass globally rather than local to the SSH use.
Upvotes: 1