{"id":17982963,"url":"https://github.com/minghsu0107/cicd-demo","last_synced_at":"2025-08-28T23:43:12.278Z","repository":{"id":64302279,"uuid":"337950214","full_name":"minghsu0107/cicd-demo","owner":"minghsu0107","description":"Cloud-native CI/CD with DroneCI + ArgoCD + Kubernetes.","archived":false,"fork":false,"pushed_at":"2022-11-29T05:43:54.000Z","size":20,"stargazers_count":62,"open_issues_count":0,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T14:25:47.917Z","etag":null,"topics":["argocd","droneci","gitops","golang","k8s"],"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/minghsu0107.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}},"created_at":"2021-02-11T06:42:08.000Z","updated_at":"2025-02-09T21:40:42.000Z","dependencies_parsed_at":"2023-01-15T09:45:43.125Z","dependency_job_id":null,"html_url":"https://github.com/minghsu0107/cicd-demo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/minghsu0107/cicd-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minghsu0107%2Fcicd-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minghsu0107%2Fcicd-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minghsu0107%2Fcicd-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minghsu0107%2Fcicd-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minghsu0107","download_url":"https://codeload.github.com/minghsu0107/cicd-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minghsu0107%2Fcicd-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272582157,"owners_count":24959415,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["argocd","droneci","gitops","golang","k8s"],"created_at":"2024-10-29T18:15:42.062Z","updated_at":"2025-08-28T23:43:12.261Z","avatar_url":"https://github.com/minghsu0107.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI/CD Demo\n\n\nThis tutorial shows how to build CI/CD pipeline with DroneCI and ArgoCD. In this demo, we use DroneCI for running tests, publishing new images, and update image tags in the manifest repository. We then use ArgoCD for continuous delivery, synchronizing application states in the Kubernetes cluster with manifests maintained in the Git repository. \n\nThis way of doing Kubernetes cluster management and application delivery is kown as GitOps. By applying GitOps, we can maintain a 'source of truth' for both the application code and infrastructure, improving system reliability and efficiency for your team.\n\nArchitecture overview:\n\n![](https://i.imgur.com/FygPEyK.png)\n## Prerequisites\n1. A Drone server\n    - [Github installation](https://docs.drone.io/server/provider/github/)\n2. A K8s cluster\n    - [K3d](https://k3d.io)\n    - [minikube](https://minikube.sigs.k8s.io/docs/start/)\n    - [K0s](https://github.com/k0sproject/k0s)\n3. ArgoCD deployment\n    - [All-in-one installation](https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd)\n4. A Github account and a Dockerhub account\n\n## DroneCI\n### Setup\nAfter you have connected your Github account with Drone, you can browse all your repositories on Drone dashboard. Next, clone this repo, activate it and navigate to `Repositories -\u003e cicd-demo -\u003e settings` to add the following secrets:\n\n\u003cimg width=\"1041\" alt=\"image\" src=\"https://user-images.githubusercontent.com/50090692/111301242-f04c2e80-868c-11eb-9945-c2de30b0ee92.png\"\u003e\n\n- `docker_username`: your Dockerhub account\n- `docker_password`: your Dockerhub password\n- `ssh_key`: base64-encoded RSA private key for accessing Github\n\nTo access Github using SSH, you should first upload a RSA public key, such as `~/.ssh/id_rsa.pub`, to Github. Then, you could generate base64-encoded RSA private key by running `cat ~/.ssh/id_rsa | base64`.\n\nFinally, replace `minghsu0107` with your Github and Dockerhub account in `.drone.yml`. Now any push or pull request will trigger a Drone pipeline. You can check details via `your repo -\u003e setting -\u003e webhook` on Github.\n\n### Local Development\nFor local development, you will not want to push every change to your repo just for testing whether `.drone.yml` works. Instead, you can use [Drone CLI](https://docs.drone.io/cli/install/) to execute pipeline locally.\n\nLogin to Drone:\n```bash\nexport DRONE_SERVER=\u003cdrone-server-url\u003e\nexport DRONE_TOKEN=\u003cdrone-token\u003e # check token under dashboard -\u003e user setting\ndrone info\n```\nFor example, you can run step `test` only by executing the following script under the project root:\n```\ndrone exec --include=\u003cpipline-step-name\u003e\n```\n## ArgoCD\nPlease clone [the application manifest repository](https://github.com/minghsu0107/cicd-demo-manifests) first. This repo holds the application manifests and will be synced with ArgoCD later. The manifests are maintained by [Kustomize](https://github.com/kubernetes-sigs/kustomize), which is supported by ArgoCD out-of-the-box. \n\nIf your repository is set to private, you need to configure access credentials on ArgoCD. Otherwise you can skip this step and create new app directly.\n\nCredentials can be configured using Argo CD CLI:\n```bash\nargocd repo add \u003crepo-url\u003e --username \u003cusername\u003e --password \u003cpassword\u003e\n```\nOr you can configure via UI. Navigate to `Settings/Repositories`; click `Connect Repo using HTTPS` and enter credentials:\n\n![](https://i.imgur.com/UAyNkte.png)\n\nYou will see something like:\n\n![](https://i.imgur.com/XaMezBA.png)\n\nCreate new app:\n\n![](https://i.imgur.com/gOD9h1b.png)\n\n![](https://i.imgur.com/8XlNtDL.png)\n\n![](https://i.imgur.com/JK76lnT.png)\n\nRemember to place the repository with your own repo.\n\nNow we have finish all preparations, and it's time to let the magic happen. Navigate to `/applications` and click SYNC button on your app in order to synchronize the cluster state:\n\n![](https://i.imgur.com/RVH5QtL.png)\n\nYou can click your app to view details:\n\n![](https://i.imgur.com/pconXQR.png)\n\nAs we can see, ArgoCD automatically sync the application to our desired state specified in `production` base. It also shows how all resources roll out in the cluster. With ArgoCD, we can not only have complete control over the entire application deployment but also track updates to branches, tags, or pinned to a specific version of manifests at a Git commit.\n## Reference\n- https://www.weave.works/technologies/gitops/\n- https://argo-cd.readthedocs.io/en/stable/\n- https://docs.drone.io\n- https://hub.docker.com/r/line/kubectl-kustomize\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminghsu0107%2Fcicd-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminghsu0107%2Fcicd-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminghsu0107%2Fcicd-demo/lists"}