Skip to content

Instantly share code, notes, and snippets.

@textarcana
Last active December 25, 2015 16:49
Show Gist options
  • Save textarcana/7008761 to your computer and use it in GitHub Desktop.
Save textarcana/7008761 to your computer and use it in GitHub Desktop.
How to run Plato in Bamboo.
#!/usr/bin/env bash
# load history -- necessary because Bamboo runs a "git clean" on the build directory
cp -r /opt/plato-report .
plato -r -d plato-report \
-l .jshintrc \
-t "My Project" \
-x '(jquery|min.js|libs/(backbone|underscore|require))' \
path/to/my_project
# save history
cp -r plato-report /opt/
# deploy build result to the dashboards host
rsync -avh --delete -e "ssh -i $HOME/.ssh/id_rsa" plato-report [email protected]:/var/www/html/

How to run Plato JavaScript static analyzer using Bamboo CI server.

This script can be invoked with a Bamboo Script Task.

The only prerequisites are to make sure the Bamboo user can read/write to /opt/plato-report and that your dashboards host actually exists and is configured to allow the Bamboo user to upload files via rsync.

A NOTE FOR JENKINS USERS

Jenkins lets you turn off "git clean" in the UI (Bamboo does not allow this) so you could do that and then dispense with the copying of plato-reports to /opt/, just keeping all historical assets in the build directory.

CentOS 7 Installation Tips

Installing NPM on CentOS requires subscribing to the EPEL package repository.

yum -y install epel-release
yum -y install nodejs npm

Any problems/thoughts/discoveries find me on twitter @noahsussman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment