{"id":13450592,"url":"https://github.com/techknowlogick/gitea-buildkite-connector","last_synced_at":"2025-04-11T01:53:12.381Z","repository":{"id":56346921,"uuid":"137418438","full_name":"techknowlogick/gitea-buildkite-connector","owner":"techknowlogick","description":"Connect Gitea \u0026 Buildkite","archived":false,"fork":false,"pushed_at":"2023-06-19T13:54:42.000Z","size":13,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T01:53:07.005Z","etag":null,"topics":["buildkite","ci","continuous-integration","git","gitea"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techknowlogick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["techknowlogick"]}},"created_at":"2018-06-14T23:16:55.000Z","updated_at":"2023-06-19T13:54:01.000Z","dependencies_parsed_at":"2024-01-15T05:09:43.488Z","dependency_job_id":"b57caf61-1d19-46af-9f52-69e09a4a8c84","html_url":"https://github.com/techknowlogick/gitea-buildkite-connector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fgitea-buildkite-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fgitea-buildkite-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fgitea-buildkite-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fgitea-buildkite-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techknowlogick","download_url":"https://codeload.github.com/techknowlogick/gitea-buildkite-connector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328108,"owners_count":21085258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buildkite","ci","continuous-integration","git","gitea"],"created_at":"2024-07-31T07:00:36.466Z","updated_at":"2025-04-11T01:53:12.362Z","avatar_url":"https://github.com/techknowlogick.png","language":"Go","funding_links":["https://github.com/sponsors/techknowlogick"],"categories":["Applications","Unmaintained"],"sub_categories":["DevOps","Applications"],"readme":"# Gitea/Buildkite Connector\n\n[OpenFaaS](https://www.openfaas.com/) functions that connect Gitea and Bulidkite to trigger builds and report build statuses back\n\n## Getting started\n\n### Create Secrets\n\nFirst you'll need to create the secrets that that once deployed the functions can start to work\n\n* Buildkite API Key\n\nGo to [Bulidkite Settings](https://buildkite.com/user/api-access-tokens) and create an API key that has `write_builds` REST scope\n\n`faas secret create buildkite-token --from-literal \"BUILDKITE_API_KEY\"`\n\n* Buildkite Webhook Secret\n\nThis is a shared secret that'll verify data sent to function. You can choose what to make this string, just make sure to make it secure\n\n`faas secret create buildkite-secret --from-literal \"BUILDKITE_WEBHOOK_SECRET\"`\n\n* Gitea API Key\n\nGo to Gitea user application settings https://gitea.example.com/user/settings/applications and create an API token\n\n`faas secret create gitea-token --from-literal \"GITEA_API_KEY\"`\n\n* Gitea Webhook Secret\n\nThis is a shared secret that'll verify data sent to function. You can choose what to make this string, just make sure to make it secure\n\n`faas secret create gitea-secret --from-literal \"GITEA_WEBHOOK_SECRET\"`\n\n* Gitea API Base\n\nThis is the URL to the Gitea install so that API calls know where to call\n\n`faas secret create gitea-api-base --from-literal \"https://gitea.example.com\"`\n\n\n### Deploy your function\n\nJust like any OpenFaaS function, just deploy the function using `faas deploy -f stack.yml`\n\n### Setup Webhooks\n\nNow that secrets have been made, you'll need to create webhooks in both Gitea and Buildkite\n\n#### Create Buildkite Webhook\n\nFirst go to the \"Notification Services\" page of your Org settings, create a \"Webhook\" with all of the \"Build\" events checked, and select the specific pipeline that is connected to your repo.\n\nAdd two querystring params to your function URL `org_slug=username_or_org_slug_from_gitea` and `repo=repo_slug_from_gitea`, and then use that as URL for webhook. It'll end up looking something like: `https://openfaas.example.com/function/buildkitehook?org_slug=repo_slug_from_gitea\u0026repo=repo_slug_from_gitea`\n\nFinally, add the secret you created above as the webhook token.\n\nNow that the Buildkite webhook has been created, the status of your builds will be reported back to Gitea.\n\n#### Create Buildkite Webhook\n\nGo to the webhook settings section of repo settings and create a new \"Gitea\" webhook. Only select \"Push Events\" to trigger on.\n\nJust like with the buildkite webhook, you'll need to add several querystring params to the function URL. `secret=GITEA_WEBHOOK_SECRET`, `org_slug=buildkite_org_slug`, and `pipeline=buildkite_pipeline_slug`, so it'll end up looking like `https://openfaas.example.com/function/giteahook?secret=GITEA_WEBHOOK_SECRET\u0026org_slug=buildkite_org_slug\u0026pipeline=buildkite_pipeline_slug`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechknowlogick%2Fgitea-buildkite-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechknowlogick%2Fgitea-buildkite-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechknowlogick%2Fgitea-buildkite-connector/lists"}