of_badge_gen is a faas function to generate status badge for function deployed in opendfaas-cloud
badge | status |
---|---|
Successfully Deployed | |
Pending at Build | |
Failed to Build | |
Pending at Deploy | |
Failed to Deploy | |
Internal Issue / Unknown |
- Fork this repo
- Install your openfaas-cloud github app on the forked repo
- Change the
customer_url
, it should be same that is used for openfaas-cloud.
of_badge_gen use it to validate userenvironment: content_type: "image/svg+xml" validate_customers: "true" customers_url: "https://raw.githubusercontent.com/openfaas/openfaas-cloud/master/CUSTOMERS"
- 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)
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
- Clone the repo
git clone https://github.com/s8sg/of_badge_gen.git
- 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
- 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)
- Repo must be public
- Currently only
failure deploy
,deployed
andunknown
is supported. Other will be available onceopenfaas-cloud
support the status