Public Repository

Last pushed: a year ago
Short Description
Drone plug-in for sending notifications through Cisco Spark.
Full Description

drone-spark

GitHub Link - hpreston/drone-spark

This is a plugin for drone.io, a Continuous Integration and Deployment server.

This plugin will allow you to send notifications using Cisco Spark.

Example notification


Build for {{ repo.full_name }} is Successful

Build author: {{ build.author }}

Build Details

  • Build Log
  • Commit Log
  • Branch: {{ build.branch }}
  • Commit Message: {{ bulid.message }}

You can also specify a message in the plugin configuraiton to send an additional custom notification.

Usage Examples

.drone.yml

The following is a sample Spark configuration in your .drone.yml file:

notify:
  spark:
    image: hpreston/drone-spark
    auth_token: XXXXXXX
    roomName: "Drone Build Notifications"
    message: "Great job on your new build!!"

You will need to provide the following details to the plug-in

  • auth_token - A Spark Token for API access
  • One of the following to identify the destination room
    • roomId - The Spark Room Id for a room
    • roomName - The Room Name or Title
    • personEmail - An email address for a Spark User

Python

python send_message.py <<EOF
{
    "system": {
        "link": "http://drone.mycompany.com"
    },
    "repo": {
        "owner": "octocat",
        "name": "hello-world",
        "full_name": "octocat/hello-world",
        "link_url": "https://github.com/octocat/hello-world",
        "clone_url": "https://github.com/octocat/hello-world.git"
    },
    "build": {
        "number": 1,
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master",
        "author": "octocat",
        "author_email": "octocat@github.com"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/github.com/octocat/hello-world",
        "keys": {
            "private": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQC..."
        }
    },
    "vargs": {
        "auth_token": "ZmRmY2..",
        "roomId": "Y2lzY...",
        "message": "# Sending Spark Message \n Using Markdown!!!"
    }
}
EOF

Docker

docker run -i hpreston/drone-spark <<EOF
{
    "system": {
        "link": "http://drone.mycompany.com"
    },
    "repo": {
        "owner": "octocat",
        "name": "hello-world",
        "full_name": "octocat/hello-world",
        "link_url": "https://github.com/octocat/hello-world",
        "clone_url": "https://github.com/octocat/hello-world.git"
    },
    "build": {
        "number": 1,
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master",
        "author": "octocat",
        "author_email": "octocat@github.com"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/github.com/octocat/hello-world",
        "keys": {
            "private": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQC..."
        }
    },
    "vargs": {
        "auth_token": "ZmRmY2..",
        "roomId": "Y2lzY...",
        "message": "# Sending Spark Message \n Using Markdown!!!"
    }
}
EOF

Roadmap and Plans

This plugin is in active development and has the following features planned

  • Support for handlebar templating like other notification templates
  • Support for referencing the environment variables used by Drone
Docker Pull Command
Owner
hpreston

Comments (0)