Skip to content

touklab/jenkins-spark-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins Spark.io Plugin

A plugin that triggers your Spark.io device when Jenkins build fails.

Build Status

This plugin adds a post-build action which allows to execute a function on your Spark device. The call is invoked via a REST call to Spark Cloud API so all you need is a Spark core connected to the cloud and a head full of IoT ideas for your build failed notificator ;)

Configuration

Go to Manage Jenkins -> Configure system and setup following Spark notifier propoerties:

  • Spark access token - your Spark API access token
  • Device id - your Spark core id
  • Function - name of a function called by the plugin via Spark API (see sample code below)

Sample Spark.io code

int pin = D0;

int trigger(String command);

void setup() {
    pinMode(pin, OUTPUT);
    Spark.function("trigger", trigger); // this must match the "Function" property in plugin configuration
}

void loop() {
}

int trigger(String command) {
    digitalWrite(pin, HIGH);
    delay(400);
    digitalWrite(pin, LOW);
    return 1;
}

We use async HTTP POST call to execute a function on Spark, so making a 400ms delay won't result in a lag on your Jenkins installation.

See it in action!

This video shows a Spark Core connected to Arduino with Adafruit's Wave Shield, which plays a "siren" sound when a build fails. Enjoy!

ScreenShot

License

This project is licenced under Apache License Version 2.0

About

Trigger a call in your Spark.io device when build in Jenkins fails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages