{"id":13580334,"url":"https://github.com/KarmaComputing/minimalcd","last_synced_at":"2025-04-06T02:31:26.628Z","repository":{"id":40476111,"uuid":"480936444","full_name":"KarmaComputing/minimalcd","owner":"KarmaComputing","description":"Minimal viable Continuous delivery (CD) setup","archived":false,"fork":false,"pushed_at":"2023-05-01T23:41:09.000Z","size":106,"stargazers_count":62,"open_issues_count":5,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T04:29:56.773Z","etag":null,"topics":["devops","dokku","good-first-issue","kubernetes","learn-devops"],"latest_commit_sha":null,"homepage":"","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/KarmaComputing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-12T18:55:44.000Z","updated_at":"2025-03-30T21:55:55.000Z","dependencies_parsed_at":"2024-08-01T15:43:37.345Z","dependency_job_id":null,"html_url":"https://github.com/KarmaComputing/minimalcd","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarmaComputing%2Fminimalcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarmaComputing%2Fminimalcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarmaComputing%2Fminimalcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarmaComputing%2Fminimalcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarmaComputing","download_url":"https://codeload.github.com/KarmaComputing/minimalcd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247425937,"owners_count":20937039,"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":["devops","dokku","good-first-issue","kubernetes","learn-devops"],"created_at":"2024-08-01T15:01:49.950Z","updated_at":"2025-04-06T02:31:26.265Z","avatar_url":"https://github.com/KarmaComputing.png","language":"Python","readme":"# Minimal Viable Continuous delivery (CD)\n\n\u003e Have you ever wanted to learn Devops, asked \"What is Devops\" or wanted to start learning DevOps?\u003cbr /\u003e\u003cbr /\u003e\nThis is a minimal viable example of many of the concepts in DevOps which might help you continue to uncover better ways of doing it and help others learn too. \u003cbr /\u003e\u003cbr /\u003eExplore this repo, [ask questions](https://github.com/KarmaComputing/minimalcd/discussions/20) and learn\n\nThis is a minimal web application with state (database) which:\n\n- [x] ✔️ Automatically generates releases based on semantic version for every merge into the `main` branch (using [intuit/auto](https://github.com/intuit/auto))\n- [x] 🗄️ Database migrations are [version controlled](https://github.com/KarmaComputing/minimalcd/tree/main/src/migrations/versions) and ran upon app startup\n    - This repository uses [alembic](https://alembic.sqlalchemy.org/en/latest/) (python) but you might use [alembic/doctrine](https://github.com/doctrine/migrations) (php), flyway/liquibase (java) - the concept is the same\n- [x] 🔎 When a pull request is opened, a [preview application](https://github.com/KarmaComputing/minimalcd/actions/workflows/pr-preview.yml) is automatically built, with a url so people can view the proposed new version\n- [x] 🔃 When a pull request gets merged into the main branch, the latest application is automatically deployed (using [Dokku](https://dokku.com/)). ([Pipeline Code](https://github.com/KarmaComputing/minimalcd/actions/workflows/deploy.yml) / [UI](https://github.com/KarmaComputing/minimalcd/actions/workflows/deploy.yml))\n    - You might use Kubernetes with ArgoCD (the underlying concepts are the same)\n- [x] 💾 A backup/snapshot of any database is taken pre and post each release\n- [x] 🚨 Codebase is regularly automatically scanned for known security issues\n- [x] ☸️ At each release a container is built and published to a container registry ([Pipeline Code](https://github.com/KarmaComputing/minimalcd/blob/main/.github/workflows/publish-container.yaml) / [UI](https://github.com/KarmaComputing/minimalcd/actions/workflows/publish-container.yaml))\n\n\n\n## Local Development\n```\ncd src\npython3.9 -m venv venv\n. venv/bin/activate\npip install -r requirements.txt\n ```\n\nEnv settings:\n```\ncp .env.example .env\n```\n\n### Run locally\n```\ncd src\n. venv/bin/activate\nexport FLASK_APP=minimalcd\nexport FLASK_DEBUG=1\nflask run\n```\nhttp://127.0.0.1:5000\n\n## Build\n```\npodman build -t minimalcd -f src/Dockerfile\n```\n\n## Run\n```\npodman run -p 8082:80 minimalcd\n```\n\n# Day0\n\n\u003e (almost) Everything below this point are instructions if you wanted to set this up yourself from scratch\n\n### Dokku\n\n```\nAPP_NAME=\u003capp-name\u003e\nDOKKU_SERVER_IP=\u003cdokku-server-ip\u003e\nDOKKU_USERNAME=\u003cusername\u003e\ngit remote add dokku $DOKKU_USERNAME@$DOKKU_SERVER_IP:$APP_NAME\ngit remote -v show\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku apps:create $APP_NAME\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku git:initialize $APP_NAME\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder:set minimalcd build-dir src\ngit push dokku main\n```\n\n### Example:\n```\nAPP_NAME=minimalcd\nDOKKU_SERVER_IP=192.168.1.10\nDOKKU_USERNAME=dokku\ngit remote add dokku $DOKKU_USERNAME@$DOKKU_SERVER_IP:$APP_NAME\ngit remote -v show\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku apps:create $APP_NAME\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku git:initialize $APP_NAME\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder-dockerfile:set $APP_NAME dockerfile-path src/Dockerfile\ngit push dokku main\n```\n\n### Auto release using autoc\n\n```\ncurl -L https://github.com/intuit/auto/releases/download/v10.36.5/auto-linux.gz \u003e auto-linux.gz\ngunzip auto-linux.gz\nchmod +x auto-linux\n./auto-linux init\n# follow on-screen\n./auto-linux create-labels\n```\n\n# Destroy / Teardown everything\n\n```\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku apps:destroy --force $APP_NAME\n```\n\n#### Troubleshooting\n\nDokku by default expects your `Dockerfile` to be in the root directory, **and**\nthe default working directory is the root of the repo.\n\nFor changing the name/location of the Dockerfile, you can use the `builder-dockerfile:set`:\n```\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder-dockerfile:set $APP_NAME dockerfile-path Dockerfile\n```\nFor changing the working directory of the `docker build` context, use:\n```\nssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder:set minimalcd build-dir src\n```\nSee https://github.com/dokku/dokku/pull/4502 for more details.\n\n# Container Hosting Service\n\nContainer hosting service is a (you guessed it!) container hosting service, which automates all the automation above for your own pet projects 🚀\n\nCheckout [Container Hosting Service](https://container-hosting.anotherwebservice.com/?minimalcd)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKarmaComputing%2Fminimalcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKarmaComputing%2Fminimalcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKarmaComputing%2Fminimalcd/lists"}