ryosms / glo-pixela-gcf

Update Pixela graph with google cloud functions, if glo boards is updated.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glo-pixela-gcf

Update Pixela graph with google cloud functions, if glo boards is updated.

Prepare

  1. Setup GCP account to use cloud functions.
  2. Setup GCloud commandline tool (should be enable beta).
    • If you don't setup gcloud, you can deploy function with gcp web console.

Getting Started

  1. Clone this repository

    $ git clone https://github.com/ryosms/glo-pixela-gcf.git
  2. Setup a graph on Pixela

    1. If you don't have a pixela account, create an account.
    2. Create a graph with int type and none selfSufficient.
    3. Create both webhooks increment and decrement
    • If you use JetBrains' IDE, you can create a graph on your IDE. See pixela/README
  3. Setup your environment variables

    1. Copy the file sample.env.yml to .env.yml
    2. Edit .env.yml for your environment
  4. Deploy function

    $ cd cloudfunctions
    $ gcloud functions deploy glo-to-pixela \
        --runtime go111 \
        --entry-point GloToPixela \
        --trigger-http \
        --region <YOUR-REGION-HERE> \
        --env-vars-file ../.env.yml
    • After deploy success, the function has endpoint. ex: https://-.cloudfunctions.net/glo-to-pixela
  5. Setup Glo Board webhook.

    1. Create a board if you have no boards.
    2. Add a webhook on Board Settings.
      • Name: any
      • Payload URL: the function's endpoint
      • Content Type: application/json
      • Trigger Event: only Card
  6. Use Glo Board

    • Add Cards
    • Delete Cards
    • Archive Cards
    • and more...
  7. Pixela Graph is updated!

    • Example

About

Update Pixela graph with google cloud functions, if glo boards is updated.

License:MIT License


Languages

Language:Go 100.0%