Grunt task not executing
Asked by Philip Parker:

I have Cloud Bamboo.

**Problem statement:** Grunt tasks (build, deploy) not running

**Successful tasks:**

* npm install
* npm install -g grunt-cli
* npm install grunt -g

I have added "Grunt 0.4.x" task for running "grunt deploy. However build does not execute.

bamboo.png

**Log file snippet**

|----------------------|-----------------------------------------------------------------------------------------------------|
|                      |                                                                                                     |
| 16-Mar-2016 09:57:58 | Finished task 'Install Grunt' with result: Success                                                  |
| 16-Mar-2016 09:57:58 | Skipping execution of task 'Deploy' as it is disabled                                               |
| 16-Mar-2016 09:57:58 | Running post build plugin 'Docker Container Cleanup'                                                |
| 16-Mar-2016 09:57:58 | Running post build plugin 'NCover Results Collector'                                                |
| 16-Mar-2016 09:57:58 | Running post build plugin 'Clover Results Collector'                                                |
| 16-Mar-2016 09:57:58 | Running post build plugin 'npm Cache Cleanup'                                                       |
| 16-Mar-2016 09:57:58 | Running post build plugin 'Artifact Copier'                                                         |
| 16-Mar-2016 09:57:58 | Publishing an artifact: Toolkit artifacts                                                           |
| 16-Mar-2016 09:58:19 | Finished publishing of artifact Job artifact: \[Toolkit artifacts\], pattern: \[\*\*/\*.\*\] in 21s |
| 16-Mar-2016 09:58:19 | Finalising the build...                                                                             |
|                      |                                                                                                     |

[](https://community.atlassian.com/t5/Bamboo-questions/Grunt-task-not-executing/qaq-p/346196?attachment-id=3347){#link_11712d90faed7e}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/10963/1/bamboo.png){#display_11712d90faed7e_0}


Answers:
author: Kalle Sirkesalo
body: 1. [Kalle Sirkesalo](https://answers.atlassian.com/questions/users?username=kalle.sirkesalo)  
   * [Edit](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Delete](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Convert to answer](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [yesterday at 6:37 PM](https://answers.atlassian.com/questions/37854320/comments/38046358)  
   That step is currently disabled so this doesn't really tell anything as your grunt won't run if it's disabled. You need to enable the job step.

   Try disabling and enabling it.
2. [Philip Parker](https://answers.atlassian.com/questions/users?username=phil.parker651024977)  
   * [yesterday at 7:16 PM](https://answers.atlassian.com/questions/37854320/comments/38046450)  
   Hi, I have disabled and re-enabled Grunt job step. I ran the build. Enclosed is a link to the log if you have access.

   <https://hpstage.atlassian.net/builds/browse/CAP-TCI-DEMO-98/log>

   The build was successful, but **/deploy** was not created looking at Artifacts

   <https://hpstage.atlassian.net/builds/browse/CAP-TCI-98/artifact/DEMO/Toolkit-artifacts/>

   **Additional question.**

   The path to Grunt CLI executable. Which path would be correct?
   * node_modules/grunt/lib/grunt.js
   * gruntfile.js (my grunt tasks)
3. [Kalle Sirkesalo](https://answers.atlassian.com/questions/users?username=kalle.sirkesalo)  
   * [Edit](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Delete](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Convert to answer](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [yesterday at 8:01 PM](https://answers.atlassian.com/questions/37854320/comments/38046518)  
   It would be the the gruntfile.js as far as I can see what you are doing. Sadly I have no access to the logs.
4. [Philip Parker](https://answers.atlassian.com/questions/users?username=phil.parker651024977)  
   * [yesterday at 8:39 PM](https://answers.atlassian.com/questions/37854320/comments/38046590)  
   I changes to my grunt file reference to execute tasks in "Gruntfile.js". So all the job steps are working except the "grunt deploy --production". This executes locally for me without issues.

   Since the job step creates a "/deploy" directory, could this be a permission issue when the directory can not be created?

   Can I add you to my Bamboo as a user so you can help debug? This would be helpful since these seems like pretty standard build using grunt and bamboo.

5. [Kalle Sirkesalo](https://answers.atlassian.com/questions/users?username=kalle.sirkesalo)  
   * [Edit](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Delete](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Convert to answer](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [about 6 hours ago](https://answers.atlassian.com/questions/37854320/comments/38047115)  
   Okay so then what your missing is the user rights to that folder /deploy \< you need to check that somehow or then deploy on the workspace in this case to test that it works.

   so what you want to do is do it more like

   mkdir deploy

   grunt deploy --production within folder deploy

   This will show you the user right issue then you can just go and add bamboo agent rights to that folder or deploy to somekind of file storage.

   Yeah it's okay to add me.
6. [Philip Parker](https://answers.atlassian.com/questions/users?username=phil.parker651024977)  
   * [18 minutes ago](https://answers.atlassian.com/questions/37854320/comments/38047673)  
   Hi,

   I was able to solve the issue by adding dependency in package.json to "grunt-cli". This installed a local version in /node_modules. Thanks for assistance. Final issue is adding "ruby" and "sass" clients on build\> I have read this is quite difficult based on answers below. Any insights ?

   <https://answers.atlassian.com/questions/225134/how-to-set-up-ruby-and-gems-on-bamboo-ondemand>

7. [Kalle Sirkesalo](https://answers.atlassian.com/questions/users?username=kalle.sirkesalo)  
   * [Edit](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Delete](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [Convert to answer](https://answers.atlassian.com/questions/37854320/comments/38047673)
   * [right now](https://answers.atlassian.com/questions/37854320/comments/38047710)  
   Might not be possible in the on demand instances. I run few self hosted bamboos so can't really say how to setup on demand that much.


author: Kalle Sirkesalo
body: Might not be possible in the on demand instances. I run few self hosted bamboos so can't really say how to setup on demand that much.


author: Philip Parker
body: Hi,

I was able to solve the issue by adding dependency in package.json to "grunt-cli". This installed a local version in /node_modules. Thanks for assistance. Final issue is adding "ruby" and "sass" clients on build\> I have read this is quite difficult based on answers below. Any insights ?

<https://answers.atlassian.com/questions/225134/how-to-set-up-ruby-and-gems-on-bamboo-ondemand>


author: Kalle Sirkesalo
body: Okay so then what your missing is the user rights to that folder /deploy \< you need to check that somehow or then deploy on the workspace in this case to test that it works.

so what you want to do is do it more like

mkdir deploy

grunt deploy --production within folder deploy

This will show you the user right issue then you can just go and add bamboo agent rights to that folder or deploy to somekind of file storage.

Yeah it's okay to add me.


author: Philip Parker
body: I changes to my grunt file reference to execute tasks in "Gruntfile.js". So all the job steps are working except the "grunt deploy --production". This executes locally for me without issues.

Since the job step creates a "/deploy" directory, could this be a permission issue when the directory can not be created?

Can I add you to my Bamboo as a user so you can help debug? This would be helpful since these seems like pretty standard build using grunt and bamboo.


author: Kalle Sirkesalo
body: It would be the the gruntfile.js as far as I can see what you are doing. Sadly I have no access to the logs.


author: Philip Parker
body: Hi, I have disabled and re-enabled Grunt job step. I ran the build. Enclosed is a link to the log if you have access.

<https://hpstage.atlassian.net/builds/browse/CAP-TCI-DEMO-98/log>

The build was successful, but **/deploy** was not created looking at Artifacts

<https://hpstage.atlassian.net/builds/browse/CAP-TCI-98/artifact/DEMO/Toolkit-artifacts/>

**Additional question.**

The path to Grunt CLI executable. Which path would be correct?

* node_modules/grunt/lib/grunt.js
* gruntfile.js (my grunt tasks)


author: Kalle Sirkesalo
body: That step is currently disabled so this doesn't really tell anything as your grunt won't run if it's disabled. You need to enable the job step.

Try disabling and enabling it.


Tags: cloud