{"id":17290990,"url":"https://github.com/jchristgit/fling","last_synced_at":"2025-07-28T23:35:57.190Z","repository":{"id":97512114,"uuid":"207118968","full_name":"jchristgit/fling","owner":"jchristgit","description":"simple, lightweight CI service for use with gitea","archived":false,"fork":false,"pushed_at":"2020-11-27T21:12:52.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T00:24:46.652Z","etag":null,"topics":["ci","continuous-disintegration","continuous-integration","gitea"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchristgit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-09-08T13:45:28.000Z","updated_at":"2022-03-12T06:18:00.000Z","dependencies_parsed_at":"2024-03-15T08:16:01.091Z","dependency_job_id":null,"html_url":"https://github.com/jchristgit/fling","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/jchristgit%2Ffling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Ffling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Ffling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristgit%2Ffling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchristgit","download_url":"https://codeload.github.com/jchristgit/fling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245717766,"owners_count":20661149,"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":["ci","continuous-disintegration","continuous-integration","gitea"],"created_at":"2024-10-15T10:39:34.644Z","updated_at":"2025-03-26T18:45:39.852Z","avatar_url":"https://github.com/jchristgit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fling\n\nA wrapper around `systemd-nspawn` and `debootstrap` for running isolated tests.\nCan be run for local builds, and also ships a web server for usage with `gitea`.\n\nA sample configuration file for testing [`bolt`](https://github.com/jchristgit/bolt)\n```dosini\n[fling]\ncommands =\n  service postgresql start\n  su postgres -s /bin/sh -c 'psql -c \"CREATE USER bolt PASSWORD '\"'\"'bolt'\"'\"' SUPERUSER\" -d postgres'\n  su postgres -s /bin/sh -c 'psql -c \"CREATE DATABASE bolt_test OWNER bolt\" -d postgres'\n\n  export MIX_ENV=test\n  export PGSQL_TEST_URL=postgres://bolt:bolt@/bolt_test\n\n  mix local.hex --force\n  mix local.rebar --force\n  mix deps.get\n  mix deps.compile\n  mix compile\npackages = ca-certificates,elixir,erlang,git,postgresql-11\n```\n\nThe packages specified in `packages` will be cached across invocations.\n`commands` are simply run via shell.\n\n## Local usage\n\nHead to your project directory and execute `python3 -m fling build` as root.\n\n## Usage with Gitea\n\n- Create a token in Gitea's \"Application\" settings\n  (`user/settings/applications`)\n- Start `fling` with the generated `--gitea-token`, ensure it is reachable to\n  Gitea\n- Configure a webhook in your repository to point to\n  `http://\u003cFLING_ADDR\u003e/hook/gitea`\n- Configure fling in your repository. See the configuration example above.\n\n\nConfigure root to have SSH keys to clone repositories you want to use it on.\n\nThen, see `python3 -m fling server --help` for usage. Do not bind fling on a public IP\naddress.\n\nOnce the server is running, add a webhook on your repositories to test, pointing\nto the address of the fling server, path `/hook/gitea`.\n\n\n## Execution\n\nWhen `fling` receives a build via its webhook route `/hook/gitea`, it performs\nthe following:\n\n- prepare a workspace (checkout the commit to build locally)\n- load build configuration (from the default branch or the commit to build, see\n  `--trust`)\n- prepares Debian Stable in a chroot if the current one is outdated [1], this is\n  called the *template machine*\n- runs build commands in an ephemeral snapshot of the template machine\n\nThe commit status is updated on Gitea along the way.\n\n[1] these are determined outdated in two cases: if the directory does not exist\nat all, it is always considered outdated and recreated. Otherwise, fling\ncompares a hashsum of the configuration the image was built with with the\nconfiguration that is desired, and if they mismatch, recreates the image\n\n\n## Dependencies\n\n- Python 3\n- `debootstrap`\n- `systemd-nspawn`\n- `git`\n- `root` access\n\n## Setup\n\n\n\n\u003c!-- vim: set tw=80: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristgit%2Ffling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchristgit%2Ffling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristgit%2Ffling/lists"}