{"id":22615635,"url":"https://github.com/marcellodesales/gitops-committer-docker","last_synced_at":"2025-03-29T00:42:45.107Z","repository":{"id":43357686,"uuid":"341628167","full_name":"marcellodesales/gitops-committer-docker","owner":"marcellodesales","description":"Creates a gitops commit based on properties and user-provided metadata","archived":false,"fork":false,"pushed_at":"2022-03-06T01:03:29.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T10:46:23.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/marcellodesales.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-23T17:05:46.000Z","updated_at":"2022-03-06T01:03:29.000Z","dependencies_parsed_at":"2022-07-22T11:17:37.610Z","dependency_job_id":null,"html_url":"https://github.com/marcellodesales/gitops-committer-docker","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/marcellodesales%2Fgitops-committer-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgitops-committer-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgitops-committer-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgitops-committer-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcellodesales","download_url":"https://codeload.github.com/marcellodesales/gitops-committer-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246122247,"owners_count":20726822,"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":[],"created_at":"2024-12-08T19:08:41.962Z","updated_at":"2025-03-29T00:42:45.077Z","avatar_url":"https://github.com/marcellodesales.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitOps Committer\n\nCreates a commit in a github repo for CI/CD using a docker container that knows what to commit. The contract the access to the repo and the gitops metadata is created. Extra metadata can be provided by the user via volumes+env vars. That is, the `gitops` object is generated with the trigger information and addition metadata provided.\n\n* It generates a commit with the file `.gitops-committer.yaml` with the object `gitops`\n  * You can provide extra metadata, here appended as `deployer.yaml`\n* It will create a commit and push to the repo you select\n  * Provided you also mount the `.ssh` dir with the pem with access to the git repo.\n\n```yaml\n# Generated by Gitops-Committer\ngitops:\n  trigger:\n    pipeline: https://gitlab.com/supercash/services/reverse-proxy-resource/-/pipelines/256841576\n    repo: git@github.com:marcellodesales/iot-observability.git\n    branch: main\n    version: 101020304\n\n# User-provided metadata via volumes\ndeployer:\n  compose:\n    service: orchestrator-service\n```\n\n# Setup\n\n* Just create a `gitops.yaml` with a docker-compose structure and provide the parameters\n  * All parameters are env vars\n  * If providing extra metadata, you need to provide it via volume mount and indicate the path for it to be merged.\n* `supercash-deployer.yaml` is the metadata stored in the trigger repo.\n  * It can be static or generated, but it needs to exist and provided as volume to `/metadata`\n\n```yaml\nversion: \"3.8\"\n\nservices:\n\n  gitops-committer:\n    image: supercash/resources/gitops-committer\n    volumes:\n      - ${HOME}/.ssh:/root/.ssh\n      - ./gitops:/metadata\n    environment:\n      - GITOPS_TRIGGER_REPO=git@github.com:marcellodesales/iot-observability.git\n      - GITOPS_TRIGGER_PIPELINE_URL=https://gitlab.com/supercash/services/reverse-proxy-resource/-/pipelines/256841576\n      - GITOPS_TRIGGER_BRANCH=main\n      - GITOPS_TRIGGER_SHA=101020304\n      - GITOPS_EXECUTOR_SCRIPT=/gitops/executor.sh\n      - GITOPS_EXECUTOR_COMMIT_MSG=\"Supercash GitOps\"\n      - GITOPS_EXECUTOR_COMMIT_AUTHOR_NAME=\"Marcello de Sales\"\n      - GITOPS_EXECUTOR_COMMIT_AUTHOR_EMAIL=marcello.desales@gmail.com\n      - GITOPS_METADATA_VALUES_FILE=/metadata/supercash-deployer.yaml\n```\n\n# Run\n\n* Just run with the parameters and a GitOps commit will run the provided executor.\n\n```console\n$ docker-compose -f gitops.yaml up\nCreating iot-observability_gitops-committer_1 ... done\nAttaching to iot-observability_gitops-committer_1\ngitops-committer_1  |\ngitops-committer_1  |   __   _   _____       __    ___    __\ngitops-committer_1  |  / _] | | |_   _|     /__\\  | _,\\ /' _/\ngitops-committer_1  | | [/\\ | |   | |   __ | \\/ | | v_/ `._`.    @marcellodesales\ngitops-committer_1  |  \\__/ |_|   |_|   \\/  \\__/  |_|   |___/\ngitops-committer_1  |   ___   __    __ __   __ __   _   _____   _____   ___   ___\ngitops-committer_1  |  / _/  /__\\  |  V  | |  V  | | | |_   _| |_   _| | __| | _ \\\ngitops-committer_1  | | \\__ | \\/ | | \\_/ | | \\_/ | | |   | |     | |   | _|  | v /\ngitops-committer_1  |  \\__/  \\__/  |_| |_| |_| |_| |_|   |_|     |_|   |___| |_|_\\\ngitops-committer_1  |\ngitops-committer_1  |\ngitops-committer_1  | ###############################\ngitops-committer_1  | ######## Starting CI/CD in Repo...\ngitops-committer_1  | ###############################\ngitops-committer_1  |\ngitops-committer_1  | * Local commit for CI/CD\ngitops-committer_1  | * Triggered by https://gitlab.com/supercash/services/reverse-proxy-resource/-/pipelines/256841576\ngitops-committer_1  |\ngitops-committer_1  | #################\ngitops-committer_1  | #### Current env\ngitops-committer_1  | #################\ngitops-committer_1  |\ngitops-committer_1  | GITOPS_EXECUTOR_COMMIT_AUTHOR_NAME=\"Marcello de Sales\"\ngitops-committer_1  | GITOPS_EXECUTOR_SCRIPT=/gitops/executor.sh\ngitops-committer_1  | HOSTNAME=704bdc28fa75\ngitops-committer_1  | GITOPS_EXECUTOR_COMMIT_MSG=\"Supercash GitOps\"\ngitops-committer_1  | SHLVL=1\ngitops-committer_1  | HOME=/root\ngitops-committer_1  | GITOPS_TRIGGER_SHA=101020304\ngitops-committer_1  | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\ngitops-committer_1  | GITOPS_METADATA_VALUES_FILE=/metadata/supercash-deployer.yaml\ngitops-committer_1  | GITOPS_TRIGGER_REPO=git@github.com:marcellodesales/iot-observability.git\ngitops-committer_1  | GITOPS_TRIGGER_PIPELINE_URL=https://gitlab.com/supercash/services/reverse-proxy-resource/-/pipelines/256841576\ngitops-committer_1  | GITOPS_TRIGGER_BRANCH=main\ngitops-committer_1  | GITOPS_EXECUTOR_COMMIT_AUTHOR_EMAIL=marcello.desales@gmail.com\ngitops-committer_1  | PWD=/gitops\ngitops-committer_1  |\ngitops-committer_1  | ###############################\ngitops-committer_1  | ######## GitOps Update\ngitops-committer_1  | ###############################\ngitops-committer_1  |\ngitops-committer_1  | * Git clone the repo git@github.com:marcellodesales/iot-observability.git@main\ngitops-committer_1  |\ngitops-committer_1  | Cloning into '/gitops/workspace'...\ngitops-committer_1  | commit a94da457e82cd4d73dccd87fa33976c379902837\ngitops-committer_1  | Author: Jairo Barros \u003cjbarros@platformscience.com\u003e\ngitops-committer_1  | Date:   Wed Feb 17 22:52:35 2021 -0800\ngitops-committer_1  |\ngitops-committer_1  |     :tada: Adding initial files\ngitops-committer_1  |\ngitops-committer_1  | * Current state of the repo\ngitops-committer_1  |\ngitops-committer_1  | total 32\ngitops-committer_1  | drwxr-xr-x    6 root     root          4096 Feb 23 16:55 .\ngitops-committer_1  | drwxr-xr-x    1 root     root          4096 Feb 23 16:55 ..\ngitops-committer_1  | drwxr-xr-x    8 root     root          4096 Feb 23 16:55 .git\ngitops-committer_1  | -rw-r--r--    1 root     root             4 Feb 23 16:55 .gitignore\ngitops-committer_1  | drwxr-xr-x    2 root     root          4096 Feb 23 16:55 config\ngitops-committer_1  | drwxr-xr-x    2 root     root          4096 Feb 23 16:55 dashboard\ngitops-committer_1  | -rw-r--r--    1 root     root           784 Feb 23 16:55 docker-compose.yaml\ngitops-committer_1  | drwxr-xr-x    2 root     root          4096 Feb 23 16:55 host\ngitops-committer_1  |\ngitops-committer_1  | * remote origin\ngitops-committer_1  |   Fetch URL: git@github.com:marcellodesales/iot-observability.git\ngitops-committer_1  |   Push  URL: git@github.com:marcellodesales/iot-observability.git\ngitops-committer_1  |   HEAD branch: main\ngitops-committer_1  |   Remote branch:\ngitops-committer_1  |     main tracked\ngitops-committer_1  |   Local branch configured for 'git pull':\ngitops-committer_1  |     main merges with remote main\ngitops-committer_1  |   Local ref configured for 'git push':\ngitops-committer_1  |     main pushes to main (up to date)\ngitops-committer_1  |\ngitops-committer_1  | * Writing the gitops file .gitops-committer.yaml\ngitops-committer_1  | * Appending the metadata values file provided '/metadata/supercash-deployer.yaml'\ngitops-committer_1  |\ngitops-committer_1  | -----------\ngitops-committer_1  | # User-provided metadata via volumes\ngitops-committer_1  | deployer:\ngitops-committer_1  |   compose:\ngitops-committer_1  |     service: orchestrator-service\ngitops-committer_1  | -----------\ngitops-committer_1  |\ngitops-committer_1  | Verifying the status of the repo...\ngitops-committer_1  |\ngitops-committer_1  |\ngitops-committer_1  | ###############################\ngitops-committer_1  | ######## GitOps Update\ngitops-committer_1  | ###############################\ngitops-committer_1  |\ngitops-committer_1  | * Setting the committer...\ngitops-committer_1  | - Name: \"Marcello de Sales\"\ngitops-committer_1  | - Email: marcello.desales@gmail.com\ngitops-committer_1  |\ngitops-committer_1  | * Writing the GITOPS commit '\"Supercash GitOps\"'\ngitops-committer_1  |\ngitops-committer_1  | [main 7a8ffcc] :building_construction: GitOps git@github.com:marcellodesales/iot-observability.git@101020304\ngitops-committer_1  |  1 file changed, 4 insertions(+)\ngitops-committer_1  |  create mode 100644 .gitops-committer.yaml\ngitops-committer_1  | commit 7a8ffcc72de058cf232b3498eaf8601cebf0d905\ngitops-committer_1  | Author: Marcello de Sales \u003cmarcello.desales@gmail.com\u003e\ngitops-committer_1  | Date:   Tue Feb 23 16:55:54 2021 +0000\ngitops-committer_1  |\ngitops-committer_1  |     :building_construction: GitOps git@github.com:marcellodesales/iot-observability.git@101020304\ngitops-committer_1  |\ngitops-committer_1  |     \"Supercash GitOps\"\ngitops-committer_1  |\ngitops-committer_1  | diff --git a/.gitops-committer.yaml b/.gitops-committer.yaml\ngitops-committer_1  | new file mode 100644\ngitops-committer_1  | index 0000000..b10afac\ngitops-committer_1  | --- /dev/null\ngitops-committer_1  | +++ b/.gitops-committer.yaml\ngitops-committer_1  | @@ -0,0 +1,4 @@\ngitops-committer_1  | +# User-provided metadata via volumes\ngitops-committer_1  | +deployer:\ngitops-committer_1  | +  compose:\ngitops-committer_1  | +    service: orchestrator-service\ngitops-committer_1  |\ngitops-committer_1  | * Pushing the GITOPS commit '\"Supercash GitOps\" with branch main'\ngitops-committer_1  |\ngitops-committer_1  | To github.com:marcellodesales/iot-observability.git\ngitops-committer_1  |    a94da45..7a8ffcc  main -\u003e main\ngitops-committer_1  |\ngitops-committer_1  | DONE!\ngitops-committer_1  |\niot-observability_gitops-committer_1 exited with code 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellodesales%2Fgitops-committer-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcellodesales%2Fgitops-committer-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellodesales%2Fgitops-committer-docker/lists"}