s8sg / faas-cloud-badge

Openfaas function to generate status badge for git repository integrated with opendfaas-cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

of_badge_gen - status badge for opendfaas-cloud

OpenFaaS

About

of_badge_gen is a faas function to generate status badge for function deployed in opendfaas-cloud

badge status
success Successfully Deployed
pending Pending to Deploy
failure Failed to Deploy
Unknown Internal Issue / Unknown

Quick start

./deploy.sh

faas-cli need to be installed

Deploying in your openfaas-cloud

  1. Fork this repo
  2. Install your openfaas-cloud github app on the forked repo
  3. Change the customer_url, it should be same that is used for openfaas-cloud.
      of_badge_gen use it to validate user
    environment:
       validate_customers: "true"
       customers_url: "https://raw.githubusercontent.com/openfaas/openfaas-cloud/master/CUSTOMERS"
    
  4. Use the badge for a repo as:
    [![Status](http://your.openfaas.cloud/function/of_badge_gen?user=<repo_user_or_org>&repo=<repo_name>&branch=master)](repo_url)
    

Deploy as a FaaS anywhere

of_badge_gen is not necessarily need to run with openfaas-cloud or need to query openfaas-cloud gateway. It fetch the build status from repo itself using:

https://api.github.com/repos/?user/?repo/commits/?branch/status

and verify if the status generated by an openfaas-cloud

  1. Clone the repo
    git clone https://github.com/s8sg/of_badge_gen.git
  2. Build and deploy using faas-cli
    $ cd faas-cli
    $ faas-cli build -f stack.yml
    $ faas-cli deploy -f stack.yml --gateway http://your.openfaas.gateway
  3. Use the badge in a repo as:
    [![Status](http://your.openfaas.gateway/function/of_badge_gen?user=<repo_user_or_org>&repo=<repo_name>&branch=master)](repo_url)
    

Constraint

  • Repo must be public

About

Openfaas function to generate status badge for git repository integrated with opendfaas-cloud


Languages

Language:Go 91.9%Language:Shell 8.1%