seferov
seferov

Reputation: 4161

Continuous integration and deployment of Node.js application on Bamboo

The application I want to implement continuous deployment on Bamboo has node modules and bower component dependencies. On the bamboo server nodejs, npm have been installed.

There are only three tasks on default job:

  1. Source Code Checkout

  2. Build dependencies:

    npm install
    bower install
    
  3. Deploy to the staging server

The problem is on the second task, bamboo fails with the message "No failed tests found, a possible compilation error occurred." I don't even run any tests.

The log file is not explanatory at all:

Starting task 'Build dependencies' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'

Failing task since return code of [/bin/sh /home/ubuntu/bamboo-installation/temp/WEB-WEB-JOB1-8-ScriptBuildTask-4430338079602360707.sh] was 1 while expected 0

Upvotes: 3

Views: 5092

Answers (3)

otavio.leitao
otavio.leitao

Reputation: 40

Bamboo AMI originally have npm version 1.4.28 installed and you are probably using a more recent version on you development environment. I had the same issue and resolved it by creating a script task to update npm version on the very beginning of my build process. Here is the script:

# update npm
curl -O -L https://npmjs.org/install.sh
chmod +x install.sh
sudo PATH=$PATH:/opt/node-0.10/bin ./install.sh

Upvotes: 0

Robin Pokorny
Robin Pokorny

Reputation: 10705

Good to see you solved it.

There is a setup I use and which could prevent further problems with CI:

export npm_config_prefix=.npm/
export PATH=.npm/bin:$PATH
export CI=true
npm install -g bower
bower install
npm install

This installs bower (and others like grunt-cli if you want) in your project folder so you can e.g. have a specific version, sets CI=true as advised in bower docs, and then installs all dependencies.

Upvotes: 2

seferov
seferov

Reputation: 4161

Ok, I solved the problem. The issue was the wrong node (which obviously messed things up) was installed on the bamboo server. Uninstalled the wrong one and everything worked as expected.

Upvotes: 2

Related Questions