Skip to content

stefanbohacek/deploy-button

Repository files navigation

View of the littleBits cloudBit with a notification showing server deployment in progress

Proof of concept: Physical AWS deployment button

Made with littleBits cloudBit, AWS, and Glitch

Getting Started

1. Glitch

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.

2. littleBits cloudBit

You are going to need three littleBits modules:

Connect your power source, button, and the littleBits cloudBit:

littleBits CloudBits setup

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".)

3. AWS

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:

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.

4. Slack (optional)

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.

Running deployment

Suggestions and improvements

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.

Attributions

About

Proof of concept: Physical AWS deployment button.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published