sum-cli 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. sum/__init__.py +1 -0
  2. sum/boilerplate/.env.example +124 -0
  3. sum/boilerplate/.gitea/workflows/ci.yml +33 -0
  4. sum/boilerplate/.gitea/workflows/deploy-production.yml +98 -0
  5. sum/boilerplate/.gitea/workflows/deploy-staging.yml +113 -0
  6. sum/boilerplate/.github/workflows/ci.yml +36 -0
  7. sum/boilerplate/.github/workflows/deploy-production.yml +102 -0
  8. sum/boilerplate/.github/workflows/deploy-staging.yml +115 -0
  9. sum/boilerplate/.gitignore +45 -0
  10. sum/boilerplate/README.md +259 -0
  11. sum/boilerplate/manage.py +34 -0
  12. sum/boilerplate/project_name/__init__.py +5 -0
  13. sum/boilerplate/project_name/home/__init__.py +5 -0
  14. sum/boilerplate/project_name/home/apps.py +20 -0
  15. sum/boilerplate/project_name/home/management/__init__.py +0 -0
  16. sum/boilerplate/project_name/home/management/commands/__init__.py +0 -0
  17. sum/boilerplate/project_name/home/management/commands/populate_demo_content.py +644 -0
  18. sum/boilerplate/project_name/home/management/commands/seed.py +129 -0
  19. sum/boilerplate/project_name/home/management/commands/seed_showroom.py +1661 -0
  20. sum/boilerplate/project_name/home/migrations/__init__.py +3 -0
  21. sum/boilerplate/project_name/home/models.py +13 -0
  22. sum/boilerplate/project_name/settings/__init__.py +5 -0
  23. sum/boilerplate/project_name/settings/base.py +348 -0
  24. sum/boilerplate/project_name/settings/local.py +78 -0
  25. sum/boilerplate/project_name/settings/production.py +106 -0
  26. sum/boilerplate/project_name/urls.py +33 -0
  27. sum/boilerplate/project_name/wsgi.py +16 -0
  28. sum/boilerplate/pytest.ini +5 -0
  29. sum/boilerplate/requirements.txt +25 -0
  30. sum/boilerplate/static/client/.gitkeep +3 -0
  31. sum/boilerplate/templates/overrides/.gitkeep +3 -0
  32. sum/boilerplate/tests/__init__.py +3 -0
  33. sum/boilerplate/tests/test_health.py +51 -0
  34. sum/cli.py +42 -0
  35. sum/commands/__init__.py +10 -0
  36. sum/commands/backup.py +308 -0
  37. sum/commands/check.py +128 -0
  38. sum/commands/init.py +265 -0
  39. sum/commands/promote.py +758 -0
  40. sum/commands/run.py +96 -0
  41. sum/commands/themes.py +56 -0
  42. sum/commands/update.py +301 -0
  43. sum/config.py +61 -0
  44. sum/docs/USER_GUIDE.md +663 -0
  45. sum/exceptions.py +45 -0
  46. sum/setup/__init__.py +17 -0
  47. sum/setup/auth.py +184 -0
  48. sum/setup/database.py +58 -0
  49. sum/setup/deps.py +73 -0
  50. sum/setup/git_ops.py +463 -0
  51. sum/setup/infrastructure.py +576 -0
  52. sum/setup/orchestrator.py +354 -0
  53. sum/setup/remote_themes.py +371 -0
  54. sum/setup/scaffold.py +500 -0
  55. sum/setup/seed.py +110 -0
  56. sum/setup/site_orchestrator.py +441 -0
  57. sum/setup/venv.py +89 -0
  58. sum/system_config.py +330 -0
  59. sum/themes_registry.py +180 -0
  60. sum/utils/__init__.py +25 -0
  61. sum/utils/django.py +97 -0
  62. sum/utils/environment.py +76 -0
  63. sum/utils/output.py +78 -0
  64. sum/utils/project.py +110 -0
  65. sum/utils/prompts.py +36 -0
  66. sum/utils/validation.py +313 -0
  67. sum_cli-3.0.0.dist-info/METADATA +127 -0
  68. sum_cli-3.0.0.dist-info/RECORD +72 -0
  69. sum_cli-3.0.0.dist-info/WHEEL +5 -0
  70. sum_cli-3.0.0.dist-info/entry_points.txt +2 -0
  71. sum_cli-3.0.0.dist-info/licenses/LICENSE +29 -0
  72. sum_cli-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: sum-cli
3
+ Version: 3.0.0
4
+ Summary: SUM Platform CLI: single control plane for site lifecycle management
5
+ Author: Mark Ashton
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/markashton480/sum-platform
8
+ Project-URL: Repository, https://github.com/markashton480/sum-platform
9
+ Project-URL: Issues, https://github.com/markashton480/sum-platform/issues
10
+ Project-URL: Documentation, https://github.com/markashton480/sum-platform/tree/main/docs/dev/cli.md
11
+ Keywords: sum,cli,django,wagtail
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Classifier: Topic :: Software Development :: Code Generators
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: click>=8.1.7
24
+ Requires-Dist: pyyaml>=6.0
25
+ Provides-Extra: gitea
26
+ Requires-Dist: httpx>=0.27.0; extra == "gitea"
27
+ Dynamic: license-file
28
+
29
+ # SUM CLI (v3)
30
+
31
+ [![PyPI](https://img.shields.io/pypi/v/sum-cli.svg)](https://pypi.org/project/sum-cli/)
32
+
33
+ The SUM CLI is the single control plane for deploying and managing SUM Platform client sites.
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ pip install sum-cli
39
+ sum-platform --version
40
+ ```
41
+
42
+ ### With Gitea Support
43
+
44
+ If using Gitea instead of GitHub for repository hosting:
45
+
46
+ ```bash
47
+ pip install sum-cli[gitea]
48
+ ```
49
+
50
+ ## Quick Usage
51
+
52
+ ```bash
53
+ # Create a new production site (requires sudo)
54
+ sudo sum-platform init acme --theme theme_a
55
+
56
+ # Create site with custom content profile
57
+ sudo sum-platform init acme --content-path /path/to/profiles/acme
58
+
59
+ # Update a deployed site
60
+ sum-platform update acme
61
+
62
+ # Backup a site
63
+ sum-platform backup acme --include-media
64
+
65
+ # Promote staging to production
66
+ sum-platform promote acme --domain acme.example.com
67
+
68
+ # List available themes
69
+ sum-platform themes
70
+
71
+ # Validate a project setup
72
+ sum-platform check acme
73
+ ```
74
+
75
+ ## Commands
76
+
77
+ | Command | Description | Requires Sudo |
78
+ |---------|-------------|---------------|
79
+ | `init` | Create new site at `/srv/sum/<name>/` | Yes |
80
+ | `update` | Pull updates, migrate, restart | No (staging) |
81
+ | `backup` | Database and media backup | No |
82
+ | `promote` | Deploy staging site to production | No |
83
+ | `check` | Validate project setup | No |
84
+ | `themes` | List available themes | No |
85
+ | `run` | Start development server | No |
86
+
87
+ ## Git Provider Support
88
+
89
+ The CLI supports both GitHub and Gitea for repository hosting. Configure your provider in `/etc/sum/config.yml`:
90
+
91
+ **GitHub (default):**
92
+ ```yaml
93
+ agency:
94
+ name: "Your Agency"
95
+ git_provider: "github"
96
+ github_org: "your-org"
97
+ ```
98
+
99
+ **Gitea:**
100
+ ```yaml
101
+ agency:
102
+ name: "Your Agency"
103
+ git_provider: "gitea"
104
+ gitea_url: "https://gitea.example.com"
105
+ gitea_org: "your-org"
106
+ gitea_token_env: "GITEA_TOKEN"
107
+ ```
108
+
109
+ For Gitea, set the `GITEA_TOKEN` environment variable with your API token.
110
+
111
+ ## Development Install (monorepo)
112
+
113
+ ```bash
114
+ pip install -e ./cli
115
+ ```
116
+
117
+ ## Configuration
118
+
119
+ System-wide configuration is read from `/etc/sum/config.yml`. See `config.yml.example` for the full schema.
120
+
121
+ ## Documentation
122
+
123
+ The full User Guide is bundled with the package at `sum/docs/USER_GUIDE.md`.
124
+
125
+ For monorepo development:
126
+ - [User Guide](../docs/dev/cli/USER_GUIDE.md) - Full command reference
127
+ - [Developer Guide](../docs/dev/cli/DEVELOPER_GUIDE.md) - CLI architecture and contribution guide
@@ -0,0 +1,72 @@
1
+ sum/__init__.py,sha256=4Hqvsw_wQrS-HCr8d7k9lsTk-whfS-XuLIja6cwe_K8,27
2
+ sum/cli.py,sha256=NxUiTZMlsfMonKBTXDvZJUISiZ1kZLzBuR_tAoLTc6c,952
3
+ sum/config.py,sha256=LucWpecznyXfYGKFfMzlYc_YGgQz6YYgEYss1ohqtU0,1500
4
+ sum/exceptions.py,sha256=bcTxqy_MXysc3-_CtLITuA0mea3PJv2gSmm6Opdx038,1172
5
+ sum/system_config.py,sha256=9e7qRqqG5qnj-fM7lgiHl4hJ7Rx5ZCCQ5XKFg22l_gM,10358
6
+ sum/themes_registry.py,sha256=86SJjNHne2t24G5x3FQglL2toqo06-WBGujV598d4w4,5565
7
+ sum/boilerplate/.env.example,sha256=Y3GajiSPEQA3_uCFxzUwWwJEataGgZRySktb6UgaQD8,5038
8
+ sum/boilerplate/.gitignore,sha256=ko-akHlkIhaS9vqz78zAlwMfp0W5z1TE52dBmoFdSu8,397
9
+ sum/boilerplate/README.md,sha256=bV33H8y7NeGW8u5BUZx5echN2smt-vYEx5Wr08tzoHQ,7731
10
+ sum/boilerplate/manage.py,sha256=jmp-DtusWuROFtXeC9GlU5OJ8itLm-8CW0Fl2ACMs7I,893
11
+ sum/boilerplate/pytest.ini,sha256=-aNCtGoDziBDjv6zNuIug17PXU3M8kg-xK2FE3oVKEo,137
12
+ sum/boilerplate/requirements.txt,sha256=qozrD_4T7wB-XohEMhFkGzk71hoCE4kFMh8TBzRhJoI,710
13
+ sum/boilerplate/.gitea/workflows/ci.yml,sha256=S_2_Wa3dXqSSlzcfqYRQyFn52vllFICWbZb8ce8d7_E,646
14
+ sum/boilerplate/.gitea/workflows/deploy-production.yml,sha256=lzYgVUzrIXpjVrihuZYRZchGiFzcAnSUzDG5xt99HTw,3205
15
+ sum/boilerplate/.gitea/workflows/deploy-staging.yml,sha256=lgGeDJ4PRI9Qfm1-tkpia5dwSLSYwtQi-UCLcmoawnk,3568
16
+ sum/boilerplate/.github/workflows/ci.yml,sha256=VcjZXSCtoIX7s3xhOI4mfYcAbt57sLz8bHBztBTVab8,677
17
+ sum/boilerplate/.github/workflows/deploy-production.yml,sha256=j7Ru54sLLTKMT5QWK97RyeoBzgd3zIBnLbVRvgDRJ2A,3319
18
+ sum/boilerplate/.github/workflows/deploy-staging.yml,sha256=F2nLzA1kTAgxpJynEKJJ7g1XzKeOMemGwrryUXHvT6Y,3590
19
+ sum/boilerplate/project_name/__init__.py,sha256=Hd058US4IapMQiTrHSE6QNJUQxiFeyuksKbxkGZu2n8,115
20
+ sum/boilerplate/project_name/urls.py,sha256=jl2Q4Yj7K5edinKz5h0FuNcMw0PLcW_Tmat-ETAqP_Y,1139
21
+ sum/boilerplate/project_name/wsgi.py,sha256=WrzSdpwkn20Z8OjrsbZknlf2B1G82kCS07Y3gLxY7N8,400
22
+ sum/boilerplate/project_name/home/__init__.py,sha256=poMAs3mwFD784mzLrbCwQjoVDgaRDehd7TzhAJ733uY,102
23
+ sum/boilerplate/project_name/home/apps.py,sha256=y_NGE1mFBJXKRS2BmgosBJ1OD9yOdJ84afYrXQecK_g,506
24
+ sum/boilerplate/project_name/home/models.py,sha256=GJME69Qa7hADpwDWL53PzuVzDYw1Mx4MkFTj_aIUETA,421
25
+ sum/boilerplate/project_name/home/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ sum/boilerplate/project_name/home/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ sum/boilerplate/project_name/home/management/commands/populate_demo_content.py,sha256=qXt_a8D8fspGxEHUoRnL6OudYVgRru7OpqzSWdfzpgI,22255
28
+ sum/boilerplate/project_name/home/management/commands/seed.py,sha256=3WUsGlZ7avK1iSo43jAehf3tM5lIQQahNGcBp_ugY-8,4896
29
+ sum/boilerplate/project_name/home/management/commands/seed_showroom.py,sha256=PCIQj9ZAs_1nDVeXETLRn52vdkqzcAsb99trcdREY7Y,63499
30
+ sum/boilerplate/project_name/home/migrations/__init__.py,sha256=_mbZaHdFwLE7E8GApBDIGSMiOz9G7RLyReN1lkrvYG0,45
31
+ sum/boilerplate/project_name/settings/__init__.py,sha256=yndELLmd-OQ-wjxYUC1CitmhbzazgOw6NyaRX_E805k,149
32
+ sum/boilerplate/project_name/settings/base.py,sha256=WU62OzS8DlsctNDpFOSOGHpJRnZzkFlT0XewHtcn3FE,12422
33
+ sum/boilerplate/project_name/settings/local.py,sha256=b3Vd21a5adLjKEEmZWLZQFUe_UcKwMmq9YGeJSb-1Zs,2667
34
+ sum/boilerplate/project_name/settings/production.py,sha256=e0iY5vTrIVDcjmz-c9zQwL3Zk_Ap6JkH78xzzTM1MVs,3638
35
+ sum/boilerplate/static/client/.gitkeep,sha256=oljA0ouMsVDR4goUYUlxPrm_uxOCM7fAYof9g0wNWQQ,170
36
+ sum/boilerplate/templates/overrides/.gitkeep,sha256=OsCO3X-nPRZHK3_hxkn8B1KZRVmwaXwUfJbHD8ywk90,174
37
+ sum/boilerplate/tests/__init__.py,sha256=h4W89xW2hAKb5WX3DGURe7gmvJbsv2n2aG5hyYvv07A,46
38
+ sum/boilerplate/tests/test_health.py,sha256=cSptlBMzz8ppTEW0xHSiTGKdZVCHkGI-0HUTj6U0IhA,1794
39
+ sum/commands/__init__.py,sha256=2GDI4K46anO4InrXQwZ5iqmRM3vdhi0SUnSk9b2MQbQ,262
40
+ sum/commands/backup.py,sha256=2_qhP5yHUSXxif0M1MgVn78dHF7T6GDlBmuw07ZtrX0,9071
41
+ sum/commands/check.py,sha256=OQhHMtnF54ojySYeveToIAB-YvpRnAFuHQuCLZRNT-s,4332
42
+ sum/commands/init.py,sha256=LmpfNkN9vWro2-TulLNw_UiX5tcZ1DUfaqRTXbNbMI0,7477
43
+ sum/commands/promote.py,sha256=SCoJgSYe40qJ8CQSymUktNoXHfJXrHeH8EONE9FcNyk,25436
44
+ sum/commands/run.py,sha256=9EwL51_GaIW7Ksy9AxKxjK7fKpJtjjBUop0gpxXHg-U,2953
45
+ sum/commands/themes.py,sha256=DrPD0R9kig9DeyTXFPvsDL12qGhRFs_06N5g0BAPM3k,1307
46
+ sum/commands/update.py,sha256=AXYa0BugWuYWJpj0vx5N5Ni0D0ZS_NsZeUhk3v3HwLc,9157
47
+ sum/docs/USER_GUIDE.md,sha256=nRO1vH6SxhPnpjaUcNxRJvIDIaWWMdyEmiK91WLWVss,14698
48
+ sum/setup/__init__.py,sha256=dm8Qq819REBxcZxOYQ6sjYOGAYdnMyZHMR8PFgMrNu0,457
49
+ sum/setup/auth.py,sha256=kBBLZKZjt8EUgK4_UV2QFmlQ0Z2RbekCQzkSBYxMJVA,5899
50
+ sum/setup/database.py,sha256=gsMa8aqxyfOBcJ1u13hbUPYSVMpFbP-S2gesVOK1UpE,1630
51
+ sum/setup/deps.py,sha256=snciWZg7TtFlullkxZGs2Acjx1jzrbiG8wFy2rb4Vw8,3018
52
+ sum/setup/git_ops.py,sha256=Kqg8DrePhRWfLFWVmvrP_8AP8LulP3ho9CRmrBvt4EM,14482
53
+ sum/setup/infrastructure.py,sha256=lI2kI_odt4JyF6wa0uAmysozGSyDmD6X70rROcNOdJ8,18065
54
+ sum/setup/orchestrator.py,sha256=MThyN6DvXyi-cI6icgeFJ3Plt0AXqOVQ6ECEfpP3ACM,12338
55
+ sum/setup/remote_themes.py,sha256=xc5sY-QwaIiLsP_LqSRE57Kk1hWre1SKxflzhu7cx0c,11685
56
+ sum/setup/scaffold.py,sha256=hp3BzypaBHIGk8zN2STHDZ37BpD283eW0MZc4XnWBsc,17360
57
+ sum/setup/seed.py,sha256=db_5lEVfYbH51h2GuJjWS9lTjUzg88jQF-AodUS-uFQ,3086
58
+ sum/setup/site_orchestrator.py,sha256=iRTkBYdBWJ03DjTXzO0Y6HqHACEry27LP9VR-rpsn8M,16553
59
+ sum/setup/venv.py,sha256=YttFbI-EZY0w5TFCeAwwO-OFQ1ZviWwa5PnWXXP3Q9s,3150
60
+ sum/utils/__init__.py,sha256=acO546Z2ktZ5TuGcPzR7xMwCFUJ7VIOjzuwh5qKqcIA,630
61
+ sum/utils/django.py,sha256=rqQj6Bwcw_8ihm_tPx6U1AcEtp3kXOVtzfLxC2IN_Yg,3280
62
+ sum/utils/environment.py,sha256=ek7dRYJyg0z1dHgbZCiEWh6cKxIKUeIXdoDYxn-shao,2508
63
+ sum/utils/output.py,sha256=jeFHKX1chjJowhNH3NadlNZp8rUvRuuizdwrdDoW49c,2379
64
+ sum/utils/project.py,sha256=27CveU5U0QhgQK_tuI6cGCN9KUskpdwv1_q8t5R_QFY,3375
65
+ sum/utils/prompts.py,sha256=iHDMWpMOj1_xbDE0XB3qF2yw4-EDPG8YbG-uGMXRmnI,1153
66
+ sum/utils/validation.py,sha256=15PNw1lhrRSnyH7BaN_N44qI4rXWx4i-44ps-0fylYU,11533
67
+ sum_cli-3.0.0.dist-info/licenses/LICENSE,sha256=RSHp5Au98mOtEsT8N4WMxqxsa-AtcVQCfr3SqoffQoU,1519
68
+ sum_cli-3.0.0.dist-info/METADATA,sha256=7gtkSOHAUzk7wjxjmcA7d0uIiN0qpOjAlswiuF31wsY,3503
69
+ sum_cli-3.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
70
+ sum_cli-3.0.0.dist-info/entry_points.txt,sha256=cp92-F73mckmgEqj6RKxJ2SII7JfK26A9Kx_LLZElGc,45
71
+ sum_cli-3.0.0.dist-info/top_level.txt,sha256=xfyDwB6SQERSuYZSfSORQMz5pIuI4MJo-_OMLhQp6ck,4
72
+ sum_cli-3.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sum-platform = sum.cli:cli
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Mark Ashton
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ sum