shipit-deploy 0.2.0__tar.gz → 0.2.2__tar.gz
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.
- {shipit_deploy-0.2.0/shipit_deploy.egg-info → shipit_deploy-0.2.2}/PKG-INFO +15 -1
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/README.md +14 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/pyproject.toml +1 -1
- shipit_deploy-0.2.2/shipit/__init__.py +1 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/cli.py +4 -4
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/config.py +7 -2
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/doctor.py +2 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2/shipit_deploy.egg-info}/PKG-INFO +15 -1
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/tests/test_shipit.py +27 -0
- shipit_deploy-0.2.0/shipit/__init__.py +0 -1
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/LICENSE +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/setup.cfg +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/__main__.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/deploy.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/detect.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/easy.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/hooks.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/proxy.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit/webhook.py +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit_deploy.egg-info/SOURCES.txt +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit_deploy.egg-info/dependency_links.txt +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit_deploy.egg-info/entry_points.txt +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/shipit_deploy.egg-info/top_level.txt +0 -0
- {shipit_deploy-0.2.0 → shipit_deploy-0.2.2}/tests/test_e2e.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shipit-deploy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Self-hosted, language-agnostic auto deploy: git push -> build -> health check -> rollback
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/desnarong/shipit
|
|
@@ -171,4 +171,18 @@ End-to-end tests deploy real sample apps with Docker (needs Docker + git, takes
|
|
|
171
171
|
SHIPIT_E2E=1 python -m unittest tests.test_e2e -v
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
+
## ☕ Buy me a coffee
|
|
175
|
+
|
|
176
|
+
shipit is free and open source. If it saves you time, you can support it with a coffee - thank you!
|
|
177
|
+
|
|
178
|
+
<img src="docs/donate-usdt-trc20.png" alt="Deposit USDT (TRC20) QR code" width="260">
|
|
179
|
+
|
|
180
|
+
| | |
|
|
181
|
+
|---|---|
|
|
182
|
+
| **Coin** | USDT |
|
|
183
|
+
| **Network** | TRX - Tron (TRC20) |
|
|
184
|
+
| **Address** | `TPqzFLc4VhmbSh52G68JVL6rNLWUNMc8Nx` |
|
|
185
|
+
|
|
186
|
+
Send USDT on the **Tron (TRC20)** network only. Double-check the address before sending - crypto transfers can't be reversed.
|
|
187
|
+
|
|
174
188
|
Contributions welcome - see [CONTRIBUTING.md](CONTRIBUTING.md). Security issues: [SECURITY.md](SECURITY.md). MIT licensed.
|
|
@@ -147,4 +147,18 @@ End-to-end tests deploy real sample apps with Docker (needs Docker + git, takes
|
|
|
147
147
|
SHIPIT_E2E=1 python -m unittest tests.test_e2e -v
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
## ☕ Buy me a coffee
|
|
151
|
+
|
|
152
|
+
shipit is free and open source. If it saves you time, you can support it with a coffee - thank you!
|
|
153
|
+
|
|
154
|
+
<img src="docs/donate-usdt-trc20.png" alt="Deposit USDT (TRC20) QR code" width="260">
|
|
155
|
+
|
|
156
|
+
| | |
|
|
157
|
+
|---|---|
|
|
158
|
+
| **Coin** | USDT |
|
|
159
|
+
| **Network** | TRX - Tron (TRC20) |
|
|
160
|
+
| **Address** | `TPqzFLc4VhmbSh52G68JVL6rNLWUNMc8Nx` |
|
|
161
|
+
|
|
162
|
+
Send USDT on the **Tron (TRC20)** network only. Double-check the address before sending - crypto transfers can't be reversed.
|
|
163
|
+
|
|
150
164
|
Contributions welcome - see [CONTRIBUTING.md](CONTRIBUTING.md). Security issues: [SECURITY.md](SECURITY.md). MIT licensed.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "shipit-deploy"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Self-hosted, language-agnostic auto deploy: git push -> build -> health check -> rollback"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.2"
|
|
@@ -7,7 +7,7 @@ import tomllib
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
|
|
9
9
|
from . import __version__
|
|
10
|
-
from .config import LiveConfig, load
|
|
10
|
+
from .config import LiveConfig, empty, load
|
|
11
11
|
from .deploy import Deployer
|
|
12
12
|
from .detect import detect
|
|
13
13
|
from .easy import app_name_from_repo, append_app, default_branch, free_port, get_secret, webhook_secret
|
|
@@ -147,6 +147,9 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
147
147
|
r = detect(a.path, a.port)
|
|
148
148
|
print(f"# language: {r.lang}\n{r.dockerfile}")
|
|
149
149
|
return 0
|
|
150
|
+
if a.cmd == "doctor":
|
|
151
|
+
from . import doctor
|
|
152
|
+
return doctor.run(load(a.config, allow_empty=True) if Path(a.config).exists() else empty(a.config))
|
|
150
153
|
cfg = load(a.config)
|
|
151
154
|
if a.cmd == "hook":
|
|
152
155
|
if a.app not in cfg.apps:
|
|
@@ -155,9 +158,6 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
155
158
|
return cmd_hook(a, cfg)
|
|
156
159
|
if a.cmd == "list":
|
|
157
160
|
return cmd_list(cfg)
|
|
158
|
-
if a.cmd == "doctor":
|
|
159
|
-
from . import doctor
|
|
160
|
-
return doctor.run(cfg)
|
|
161
161
|
if a.cmd == "serve":
|
|
162
162
|
from .webhook import make_server
|
|
163
163
|
resync_proxy(cfg)
|
|
@@ -42,7 +42,12 @@ class Config:
|
|
|
42
42
|
apps: dict[str, App]
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
def
|
|
45
|
+
def empty(path: str | Path) -> Config:
|
|
46
|
+
"""A config with no apps (used by `shipit doctor` before the first `shipit up`)."""
|
|
47
|
+
return Config((Path(path).resolve().parent / ".shipit").resolve(), "0.0.0.0", 9000, "http://127.0.0.1:2019", {})
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def load(path: str | Path, allow_empty: bool = False) -> Config:
|
|
46
51
|
data = tomllib.loads(Path(path).read_text(encoding="utf-8"))
|
|
47
52
|
server = data.get("server", {})
|
|
48
53
|
apps: dict[str, App] = {}
|
|
@@ -55,7 +60,7 @@ def load(path: str | Path) -> Config:
|
|
|
55
60
|
if app.name in apps:
|
|
56
61
|
raise ValueError(f"duplicate app {app.name!r}")
|
|
57
62
|
apps[app.name] = app
|
|
58
|
-
if not apps:
|
|
63
|
+
if not apps and not allow_empty:
|
|
59
64
|
raise ValueError("no [[app]] entries in config")
|
|
60
65
|
return Config(
|
|
61
66
|
# relative state_dir is relative to the config file, not the current directory
|
|
@@ -51,6 +51,8 @@ def checks(cfg) -> list[tuple[str, bool, str]]:
|
|
|
51
51
|
|
|
52
52
|
def run(cfg) -> int:
|
|
53
53
|
bad = 0
|
|
54
|
+
if not cfg.apps:
|
|
55
|
+
print(" (no apps configured yet - checking the machine only; add one with: shipit up <git-url>)")
|
|
54
56
|
for name, ok, detail in checks(cfg):
|
|
55
57
|
print(f" [{'ok' if ok else 'FAIL'}] {name}: {detail}")
|
|
56
58
|
bad += not ok
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shipit-deploy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Self-hosted, language-agnostic auto deploy: git push -> build -> health check -> rollback
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/desnarong/shipit
|
|
@@ -171,4 +171,18 @@ End-to-end tests deploy real sample apps with Docker (needs Docker + git, takes
|
|
|
171
171
|
SHIPIT_E2E=1 python -m unittest tests.test_e2e -v
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
+
## ☕ Buy me a coffee
|
|
175
|
+
|
|
176
|
+
shipit is free and open source. If it saves you time, you can support it with a coffee - thank you!
|
|
177
|
+
|
|
178
|
+
<img src="docs/donate-usdt-trc20.png" alt="Deposit USDT (TRC20) QR code" width="260">
|
|
179
|
+
|
|
180
|
+
| | |
|
|
181
|
+
|---|---|
|
|
182
|
+
| **Coin** | USDT |
|
|
183
|
+
| **Network** | TRX - Tron (TRC20) |
|
|
184
|
+
| **Address** | `TPqzFLc4VhmbSh52G68JVL6rNLWUNMc8Nx` |
|
|
185
|
+
|
|
186
|
+
Send USDT on the **Tron (TRC20)** network only. Double-check the address before sending - crypto transfers can't be reversed.
|
|
187
|
+
|
|
174
188
|
Contributions welcome - see [CONTRIBUTING.md](CONTRIBUTING.md). Security issues: [SECURITY.md](SECURITY.md). MIT licensed.
|
|
@@ -389,5 +389,32 @@ class LiveConfigTests(unittest.TestCase):
|
|
|
389
389
|
self.assertEqual(load(f).state_dir, (Path(t) / "data").resolve())
|
|
390
390
|
|
|
391
391
|
|
|
392
|
+
class DoctorWithoutAppsTests(unittest.TestCase):
|
|
393
|
+
def test_doctor_works_without_config_file_or_apps(self):
|
|
394
|
+
import contextlib
|
|
395
|
+
import io
|
|
396
|
+
from unittest import mock
|
|
397
|
+
from shipit.cli import main
|
|
398
|
+
with tempfile.TemporaryDirectory() as t, mock.patch("shipit.doctor._docker_ok", return_value=(True, "ok")):
|
|
399
|
+
missing = str(Path(t) / "nope.toml")
|
|
400
|
+
buf = io.StringIO()
|
|
401
|
+
with contextlib.redirect_stdout(buf):
|
|
402
|
+
rc = main(["-c", missing, "doctor"])
|
|
403
|
+
self.assertIn("no apps configured yet", buf.getvalue())
|
|
404
|
+
self.assertIn("docker", buf.getvalue())
|
|
405
|
+
self.assertIn(rc, (0, 1)) # 1 only if git/python are missing on this machine, never a crash
|
|
406
|
+
empty_cfg = Path(t) / "empty.toml"
|
|
407
|
+
empty_cfg.write_text("[server]\nport = 9000\n")
|
|
408
|
+
with contextlib.redirect_stdout(io.StringIO()):
|
|
409
|
+
self.assertIn(main(["-c", str(empty_cfg), "doctor"]), (0, 1))
|
|
410
|
+
|
|
411
|
+
def test_other_commands_still_require_an_app(self):
|
|
412
|
+
from shipit.cli import main
|
|
413
|
+
with tempfile.TemporaryDirectory() as t:
|
|
414
|
+
f = Path(t) / "empty.toml"
|
|
415
|
+
f.write_text("[server]\nport = 9000\n")
|
|
416
|
+
self.assertEqual(main(["-c", str(f), "list"]), 2)
|
|
417
|
+
|
|
418
|
+
|
|
392
419
|
if __name__ == "__main__":
|
|
393
420
|
unittest.main()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|