Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.
/ slashiez Public archive

A mini-framework for running simple Slack slash commands on Azure Functions.

License

Notifications You must be signed in to change notification settings

tdmalone/slashiez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slashiez

Slashiez is a mini-framework, written in PHP, for running simple Slack slash commands on Azure Functions. It comes pre-packaged with several ready-to-go functions for retrieving and managing data in some online tools I use regularly.

This project is currently under construction, and is not yet ready for production.

Commands

  • /dropbox (Coming soon)
  • /evernote (Coming soon)
  • /lastpass (Coming soon)
  • /pocket (Currently under construction)
  • /pokedex (Coming soon)
  • /ptv (Coming soon)
  • /slack (Coming soon)

Installation

Full instructions coming soon.

There's a few steps, including setting up the infrastructure with Terraform and the Azure CLI, and setting up a Slack app.

Some short notes follow for now, but remember these instructions are under construction.

Infrastructure setup

You'll need to download Terraform and install the Azure CLI before continuing.

  1. Clone this repository to your local machine.
  2. Adjust any desired values in config.tf, such as naming or state management options.
    • If you're new to Terraform, managing state locally is the easiest way to get started, so you'll want to remove the terraform {} block and probably the "aws" provider block as well.
  3. Ensure you're logged in to the Azure CLI (run az login), OR have exported the neccessary environment variables for Terraform use.
  4. Run terraform init then terraform apply, and follow the prompts.
  5. There are some features of Function Apps that Terraform doesn't configure, so next run ./setup.sh.
    • This script doesn't pull anything from the Terraform config yet, so you'll need to update any naming in the script's variables.
    • You'll be prompted to enter a password to use for pushing to Azure's local git for function deployment.
  6. Run export AZURE_GIT_REMOTE=https://USERNAME:PASSWORD@FUNCTIONAPP.scm.azurewebsites.net/FUNCTIONAPP.git, replacing the relevant values with those you got (or set) in the last step.
  7. Run ./deploy.sh.

If everything went well, you should now have an instance of Slashiez running in Azure!

Slack app set up

Coming soon...

History

Slashies with an S is a mini-framework I created at Chromatix, for linking together data and powering minor automations between various online tools we use in the office, utilising Slack slash commands. It's written in PHP, and runs on an Intel NUC I have sitting on my desk as my WordPress development server.

As well as commands which the team use every day, I wrote additional commands to help me automate common tasks on services such as Dropbox, Evernote and Pocket. Although the original Slashies hosting arrangement suits fine for use at Chromatix - particularly since some of the commands access data physically stored in the office - to adapt it to my personal needs I needed to separate it, and rewrite the functionality for use in the cloud.

I knew I wanted to go serverless to save on costs and maintenance burden. Lambda is usually my tool of choice here, but I'd already written the commands in PHP; Lambda doesn't (natively) support PHP; and I didn't want to have to bundle PHP itself, or rewrite the code entirely. Fortunately, Azure Functions supports PHP (albeit in 'preview', but it seems to work ok). So Slashiez with a Z is Slashies... rewritten for running on Azure! (IBM's Cloud Functions would be an alternative choice).

License

MIT.

About

A mini-framework for running simple Slack slash commands on Azure Functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published