First, remix the deploy-button project. As we go through the following steps, we will be mostly working with the .env
and aws.js
files.
You are going to need three littleBits modules:
- button
- cloudBit
- one of the power bits, I personally recommend power (USB)
- optionally you can also get a mounting board to keep your bits nicely together
Connect your power source, button, and the littleBits cloudBit:
Once you set up your cloudBit using littleBits Cloud Control, add your Device ID and Access Token to the .env
file in your Glitch app. (You can find these on the "Settings" page under "Advanced".)
This part depends on your particular AWS setup. For example, at my current job, we use Stacks which we deploy through AWS OpsWorks.
You can see inside aws.js
that I'm using following functions:
- describeDeployments to check if there are any deployments running on a specific stack
- createDeployment to deploy a stack
Finding the Stack and Application IDs was a bit tricky for me, I pretty much just went to the deployment page, and copied the IDs from the URL ¯\_(ツ)_/¯
You will need to add your Amazon AWS Access Key Id and Secret Access Key to .env
. You can find them on the Security Credentials page.
You can add a Slack token (see the Slack legacy token generator) and a channel ID (you can use Slack's channels.list API method tester tool to find it) to get notified about deployments in your Slack group.
Note: If you're not able to subscribe to your device, or are getting server errors, be sure to check if the littleBits Cloud Control is working.
- When a button is pressed, start a five second timer. If the button is pressed during these five seconds, cancel timer. When the five seconds are up, then run the deployment.
- Same as above, but use the Slack Dialog API so that you can cancel deployment inside Slack. (You can add Botkit to your project to make working with Slack API easier.)
- Add more littleBits modules.
- This project was remixed from littlebits-api created by Jenn Schiffer and Gareth Wilson.
- Project icon: EmojiOne/JoyPixels