{"id":21066436,"url":"https://github.com/tomhuang12/build-controller","last_synced_at":"2025-06-13T09:05:30.296Z","repository":{"id":111335081,"uuid":"462845805","full_name":"tomhuang12/build-controller","owner":"tomhuang12","description":"The build-controller is a Kubernetes operator that experiments turning continuous integration build process from event-driven to GitOps-driven.","archived":false,"fork":false,"pushed_at":"2022-03-01T21:55:38.000Z","size":119,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T21:14:06.473Z","etag":null,"topics":["build","ci","docker","flux","gitops","gitops-toolkit"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tomhuang12.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":"2022-02-23T17:50:03.000Z","updated_at":"2024-07-24T08:58:42.000Z","dependencies_parsed_at":"2023-03-17T02:46:08.803Z","dependency_job_id":null,"html_url":"https://github.com/tomhuang12/build-controller","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/tomhuang12%2Fbuild-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhuang12%2Fbuild-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhuang12%2Fbuild-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhuang12%2Fbuild-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomhuang12","download_url":"https://codeload.github.com/tomhuang12/build-controller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243510121,"owners_count":20302294,"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":["build","ci","docker","flux","gitops","gitops-toolkit"],"created_at":"2024-11-19T17:59:48.758Z","updated_at":"2025-03-14T01:48:57.248Z","avatar_url":"https://github.com/tomhuang12.png","language":"Go","readme":"# build-controller\n\nThe build-controller is a Kubernetes operator that experiments turning continuous integration build process from event-driven to GitOps driven. It integrates with Flux using the GitOps Toolkit and enables building GitOps-based CI pipelines.\n\nCurrently, it supports `DockerBuild` that performs `docker build` and `docker push` on a given repository and path that contains a `Dockerfile`. \n\n## Getting Started\n\nThe build-controller requires that you already have the [GitOps toolkit](https://fluxcd.io/docs/components/)\ncontrollers installed in your cluster. Visit [https://fluxcd.io/docs/get-started/](https://fluxcd.io/docs/get-started/) for information on getting started if you are new to `flux`.\n\n### Installation\n\n**NOTE:** Running the controller locally requires docker to be running.\n\nInstall flux on your test cluster:\n\n```bash\nflux install\n```\n\nPort forward to source-controller artifacts server:\n\n```bash\nkubectl -n flux-system port-forward svc/source-controller 8080:80\n```\n\nExport the local address as `SOURCE_CONTROLLER_LOCALHOST`:\n\n```bash\nexport SOURCE_CONTROLLER_LOCALHOST=localhost:8080\n```\n\nRun the controller locally:\n\n```\nmake install\nmake run\n```\n\n### Quick Start\n#### Create a dockerhub repository\n\nCreate a dockerhub repository `build-controller-example` using your dockerhub account\n\n#### Define a Git repository source\n\nCreate a source object that points to a Git repository containing application and a `Dockerfile`:\n\n```yaml\napiVersion: source.toolkit.fluxcd.io/v1beta1\nkind: GitRepository\nmetadata:\n  name: example\n  namespace: default\nspec:\n  interval: 5m\n  url: https://github.com/tomhuang12/build-controller-example\n  ref:\n    branch: main\n```\n\n#### Create a Docker Hub authentication secret\n\nCreate a docker hub authentication secret containing your dockerhub username, password or access token, and dockerhub server address.\n\n```bash\nkubectl create secret generic docker-auth-config \\\n--from-literal=Username=username \\\n--from-literal=Password=password \\\n--from-literal=ServerAddress=\"https://index.docker.io/v1/\"\n```\n\nOutput:\n```yaml\napiVersion: v1\ndata:\n  Password: cGFzc3dvcmQ=\n  ServerAddress: aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEv\n  Username: dXNlcm5hbWU=\nkind: Secret\nmetadata:\n  name: docker-auth-config\n  namespace: default\n```\n\n#### Define a DockerBuild\n\nCreate a `DockerBuild` resource that references the `GitRepository` source previously defined.\n\n```yaml\napiVersion: build.contrib.flux.io/v1alpha1\nkind: DockerBuild\nmetadata:\n  name: example\n  namespace: default\nspec:\n  interval: 5m\n  buildMode: buildPush\n  sourceRef:\n    kind: GitRepository\n    name: example\n  containerRegistry:\n    repository: \u003cusername\u003e/build-controller-example\n    tagStrategy: commitSHA\n    authConfigRef:\n      name: docker-auth-config\n      namespace: default\n```\n\n### Development\n\n`make test` requires `DOCKERBUILD_USERNAME`, `DOCKERBUILD_PASSWORD`, `DOCKERBUILD_SERVER` to be set as environment variables to actually perform `docker push` to a registry that exists.\n\n```\nmake DOCKERBUILD_USERNAME=\"\u003cyour-username\u003e\" DOCKERBUILD_PASSWORD=\"\u003cyour-token\u003e\" DOCKERBUILD_SERVER=\"\u003cdocker-server-address\u003e\" test\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhuang12%2Fbuild-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomhuang12%2Fbuild-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhuang12%2Fbuild-controller/lists"}