{"id":15869990,"url":"https://github.com/michaelbeaumont/properator","last_synced_at":"2025-04-01T21:41:33.246Z","repository":{"id":70831756,"uuid":"259444673","full_name":"michaelbeaumont/properator","owner":"michaelbeaumont","description":"PRs + K8s + GH deployments","archived":false,"fork":false,"pushed_at":"2023-02-25T01:37:17.000Z","size":252,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T14:17:22.266Z","etag":null,"topics":["kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelbeaumont.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-27T20:30:50.000Z","updated_at":"2020-06-20T21:18:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ed5ea7c-615b-4ec4-be59-2599823dc0ae","html_url":"https://github.com/michaelbeaumont/properator","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/michaelbeaumont%2Fproperator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbeaumont%2Fproperator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbeaumont%2Fproperator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbeaumont%2Fproperator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelbeaumont","download_url":"https://codeload.github.com/michaelbeaumont/properator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246716422,"owners_count":20822464,"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":["kubernetes"],"created_at":"2024-10-06T00:03:00.893Z","updated_at":"2025-04-01T21:41:33.224Z","avatar_url":"https://github.com/michaelbeaumont.png","language":"Go","readme":"# properator\n\nproperator manages launching _in progress_ versions of your application using [`flux`](https://github.com/fluxcd/flux),\npull requests and the Github deployments API.\n\n## Usage\n\nWe'll assume `properator` is [setup as a Github app](#setup) and running as `@properator-bot`.\nComments are used to control `properator`.\nFor example, `@properator-bot deploy` on a PR, will launch an instance of `flux`\npointed to that PR's branch and create a GH deployment to track it.\n\n\u003cimg src=\"docs/usage.png\" width=\"600\" alt=\"Usage\"\u003e\n\nWhen the PR is closed, that instance of `flux` and the launched manifests will be\nremoved.\n\n\u003cimg src=\"docs/closed.png\" width=\"600\" alt=\"Drop\"\u003e\n\nNote: As more commits are pushed, github will say the deployment is \"outdated\".\nThis is a drawback of the deployments API; it doesn't let us update the commit\nfor a deployment, we can only create new ones.\nHowever, the deployed version of the app really does track the PR branch because\n`flux` is now watching that branch and will apply any changes.\n\n### URL annotations\n\nInclude annotations like the following on an `Ingress` resource:\n\n```\nmetadata:\n  annotations:\n    deploy.properator.io/deployment: github-webhook # This should always be `github-webhook`\n    deploy.properator.io/url: https://2.pr.app.test # This should point to your deployment\n```\n\nto have the GH deployment point to `https://2.pr.app.test`.\n\n### Generation\n\nNote: `properator` gives you access to the PR number\nwhen manifests are generated on the file system at `/etc/properator`.\n\nAs a primitive example:\n\n###### ingress.yaml\n\n```\napiVersion: extensions/v1beta1\nkind: Ingress\nmetadata:\n  name: my-app\n  annotations:\n    deploy.properator.io/deployment: github-webhook\n    deploy.properator.io/url: http://${PR}.pr.app.test\n```\n\n###### .flux.yaml\n\n```\nversion: 1\npatchUpdated:\n  generators:\n  - command: sed -e \"s/\\${PR}/$(cat /etc/properator/pr)/g\" ingress.yaml\n```\n\n## Setup\n\nWe'll cover initializing a Github App for `properator` and then launching it\nlocally in `minikube`.\n\nNote: requires kubernetes 1.16.\n\n### Initialization\n\n`properator` is meant to be run as a GitHub app. To make setup easier, execute:\n\n```\ngo run ./cmd/init\n```\n\nThis will setup the app in your account or organization and write\nthe configuration and key to `.env`/`id_rsa`, which are later used to deploy `properator`.\n\n#### Webhook\n\n`properator` needs to listen to github webhook events. Visit\n[smee.io](https://smee.io/) to get a publicly accessible webhook URL.\nEnter this URL when initializing the app as above.\n\n### Launch\n\nInstall the manifests to the cluster with:\n\n```\nmake deploy\n```\n\nAt the moment, the images track the `latest` tag.\n\n#### Testing\n\nUsing `minikube`, you can use `make listen-webhook` to use `smee.io`\nto proxy events from the URL you created earlier to your local machine.\n\n```\n$ WEBHOOK_URL=https://smee.io/code make listen-github-webhook\n./hack/listen.sh\nForwarding from 127.0.0.1:8080 -\u003e 8080\nnpx: installed 40 in 4.406s\nForwarding https://smee.io/code to http://localhost:8080/webhook\nConnected https://smee.io/code\nHandling connection for 8080\nPOST http://localhost:8080/webhook - 200\n```\n\n#### Building\n\nThe images can also be built manually but remember they need to end up\naccessible by the cluster.\n\nFor example with `minikube`:\n\n```\neval $(minikube docker-env)\nexport TAG=dev # it's only important it's not latest so that the images aren't pulled\nmake docker-build \u0026\u0026 make deploy\n```\n\n## How it works\n\nSee below for some information about how properator functions internally.\n\n### Deploy keys\n\nFor every repo, `properator` will create an SSH key and add it to the\nrepository. Every instance of `flux` started by `properator` will use this same key\nto synchronize with that repo.\n\n## TODO\n\n1. Add configuration to repositories\n   - `--git-path` for `flux`\n   - registry scanning\n1. How to measure \"successful\" deployment?\n   Right now it's just whether an `Ingress` resource appears with a link to the\n   deployment.\n   - If we're not using `Ingress`?\n   - Check responsiveness of ingress/service and set the deployment when it's\n     ready\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelbeaumont%2Fproperator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelbeaumont%2Fproperator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelbeaumont%2Fproperator/lists"}