{"id":21493379,"url":"https://github.com/microdevops-com/accounting","last_synced_at":"2025-07-14T08:05:34.185Z","repository":{"id":37965112,"uuid":"393410724","full_name":"microdevops-com/accounting","owner":"microdevops-com","description":"DevOps Accounting - Servers, Server Jobs, GitLab Projects, Invoices etc","archived":false,"fork":false,"pushed_at":"2025-03-02T14:40:41.000Z","size":448,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T15:31:47.089Z","etag":null,"topics":["devops"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microdevops-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-08-06T14:59:41.000Z","updated_at":"2025-03-02T14:40:44.000Z","dependencies_parsed_at":"2024-08-29T23:25:27.954Z","dependency_job_id":"bd901054-9799-41c4-811b-76402cf071db","html_url":"https://github.com/microdevops-com/accounting","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/microdevops-com%2Faccounting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Faccounting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Faccounting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Faccounting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microdevops-com","download_url":"https://codeload.github.com/microdevops-com/accounting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244029480,"owners_count":20386415,"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"],"created_at":"2024-11-23T15:42:17.475Z","updated_at":"2025-03-17T11:41:35.891Z","avatar_url":"https://github.com/microdevops-com.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# accounting\nDevOps Accounting - Servers, Server Jobs, GitLab Projects, Invoices etc\n\n## Setup\nCreate private project, e.g. `accounting`.\n\nAdd this repo as Git Submodule to a project:\n```\ngit submodule add --name .accounting -b master -- https://github.com/sysadmws/accounting .accounting\n```\n\nAdd `gitlab-server-job` Submodule:\n```\ngit submodule add --name .gitlab-server-job -b master -- https://github.com/sysadmws/gitlab-server-job .gitlab-server-job\n```\n\nAdd `salt-project-template` Submodule:\n```\ngit submodule add --name .salt-project-template -b master -- https://github.com/sysadmws/salt-project-template .salt-project-template\n```\n\nAdd `gsuite-scripts` Submodule:\n```\ngit submodule add --name .gsuite-scripts -b master -- https://github.com/sysadmws/gsuite-scripts .gsuite-scripts\n```\n\nMake links:\n```\nln -s .accounting/Dockerfile\nln -s .accounting/jobs.py\nln -s .accounting/projects.py\nln -s .accounting/accounting.py\nln -s .accounting/services.py\nln -s .accounting/requirements.txt\nln -s .accounting/sysadmws_common.py\nln -s .accounting/accounting_db_structure.sql\nln -s .accounting/.gitignore\nln -s .accounting/gen_minion_pem_pub.sh\nln -s .accounting/gen_ssh_priv_pub.sh\nln -s .gsuite-scripts/gsuite_scripts.py\n```\n\nInstall python3 requirements:\n```\npip3 install -r requirements.txt\n```\n\nAdd `accounting.yaml` based on `accounting.yaml.example`\n\nAdd client yaml based on `clients/example.yaml`.\n\nCopy or symlink `tariffs`.\n\nAdd `.gitlab-ci.yaml` based on `.gitlab-ci.yml.example`.\n\nSubstitute runner tag placeholders `__dev_runner__` and `__prod_runner__` with real runner tags in `.gitlab-ci.yaml`.\n\nAdd those runners to project, both runners should have shell executor with docker command available.\n\nAdd following CI-CD vars to project to access GitLab via API.\n- `GL_ADMIN_PRIVATE_TOKEN` - Needed for tag cleaning - use admin token with full access\n- `GL_USER_PRIVATE_TOKEN` - Pipelines will be run from this user by token, the same as above may be used\n- `GL_URL` like `https://gitlab.example.com`\n\nAdd `GL_URL` CI-CD var to project to access GitLab via API. Pipelines will be run from this user token.\n\nMake empty `.ssh` for later usage in Dockerfile:\n```\nmkdir .ssh\ntouch .ssh/.keep\n```\n\nMake empty `.salt-project-private-template/install.sh` (or fill with private data addons):\n```\nmkdir -p .salt-project-private-template\ncat \u003c\u003c EOF \u003e .salt-project-private-template/install.sh\n#!/bin/bash\ntrue\nEOF\nchmod +x .salt-project-private-template/install.sh\n```\n\nPush project repository to GitLab and make sure pipeline ran, image is built and pushed to registry.\n\nMake `.env` for local tests like:\n```\nexport GL_URL=https://gitlab.example.com\nexport ACC_WORKDIR=/some/path/accounting\nexport ACC_LOGDIR=/some/path/accounting/log\nexport GL_ADMIN_PRIVATE_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx\nexport GL_USER_PRIVATE_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\nMake local test dirs:\n```\nmkdir $ACC_LOGDIR\n```\n\nSetup client project in GitLab:\n```\n./projects.py --setup-projects-for-client example\n```\n\nTemplate client project in GitLab:\n```\n./projects.py --git-push --template-salt-project-for-client example\n```\n\nLocally run test.ping pipeline job via `pipeline_salt_cmd.sh`:\n```\n.gitlab-server-job/pipeline_salt_cmd.sh nowait example/devops/example-salt 60 server1.example.com test.ping\n```\n\nLocally run test.ping pipeline job via `jobs.py`:\n```\n./jobs.py --force-run-job example server1.example.com test_ping\n```\n\nMake dirs on prod runner of project:\n```\nmkdir -p /opt/sysadmws/accounting/log\n```\n\nAdd poject CI-CD/Schedules:\n- run-jobs\n  - Interval Pattern: `*/10 * * * *`\n  - Target Branch: master\n  - Variables: `RUN_CMD`: `/opt/sysadmws/accounting/jobs.py --debug --run-jobs ALL ALL`\n- prune-run-tags\n  - Interval Pattern: `30 14 * * *` - some time at day time as jobs mostly run at night time\n  - Target Branch: master\n  - Variables: `RUN_CMD`: `/opt/sysadmws/accounting/jobs.py --prune-run-tags ALL 30`\n\nTry to run schedules manually. Jobs should run via pipelines by schedule if all good.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrodevops-com%2Faccounting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrodevops-com%2Faccounting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrodevops-com%2Faccounting/lists"}