shipit-cli 0.11.3__tar.gz → 0.13.0__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_cli-0.11.3 → shipit_cli-0.13.0}/PKG-INFO +1 -1
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/pyproject.toml +4 -1
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/assets/wordpress/install.sh +7 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/cli.py +168 -24
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/generator.py +1 -1
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/base.py +0 -1
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/hugo.py +0 -3
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/laravel.py +0 -3
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/mkdocs.py +1 -4
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/node_static.py +0 -3
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/php.py +0 -3
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/python.py +3 -6
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/staticfile.py +0 -3
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/wordpress.py +1 -4
- shipit_cli-0.13.0/src/shipit/version.py +5 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/tests/test_e2e.py +1 -1
- shipit_cli-0.11.3/src/shipit/version.py +0 -5
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/.gitignore +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/README.md +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/__init__.py +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/assets/php/php.ini +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/assets/wordpress/wp-config.php +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/procfile.py +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/src/shipit/providers/registry.py +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/tests/test_generate_shipit_examples.py +0 -0
- {shipit_cli-0.11.3 → shipit_cli-0.13.0}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shipit-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: Shipit CLI is the best way to build, serve and deploy your projects anywhere.
|
|
5
5
|
Project-URL: homepage, https://wasmer.io
|
|
6
6
|
Project-URL: repository, https://github.com/wasmerio/shipit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "shipit-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.13.0"
|
|
4
4
|
description = "Shipit CLI is the best way to build, serve and deploy your projects anywhere."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -45,3 +45,6 @@ dev-dependencies = [
|
|
|
45
45
|
|
|
46
46
|
[tool.pytest.ini_options]
|
|
47
47
|
asyncio_mode = "auto"
|
|
48
|
+
|
|
49
|
+
[tool.uv.workspace]
|
|
50
|
+
exclude = ["examples/*"]
|
|
@@ -4,6 +4,13 @@ IFS=$'\n\t'
|
|
|
4
4
|
export COLUMNS=80 # Prevent WP-CLI from asking for TTY size
|
|
5
5
|
export PAGER="cat"
|
|
6
6
|
|
|
7
|
+
WP_ADMIN_EMAIL=${WP_ADMIN_EMAIL:-"admin@example.com"}
|
|
8
|
+
WP_ADMIN_USERNAME=${WP_ADMIN_USERNAME:-"admin"}
|
|
9
|
+
WP_ADMIN_PASSWORD=${WP_ADMIN_PASSWORD:-"admin"}
|
|
10
|
+
WP_LOCALE=${WP_LOCALE:-"en_US"}
|
|
11
|
+
WP_SITEURL=${WP_SITEURL:-"http://localhost"}
|
|
12
|
+
WP_SITE_TITLE=${WP_SITE_TITLE:-"WordPress"}
|
|
13
|
+
|
|
7
14
|
wp() {
|
|
8
15
|
php /opt/assets/wp-cli.phar --allow-root --path=/app "$@"
|
|
9
16
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import tempfile
|
|
2
|
+
import hashlib
|
|
2
3
|
import requests
|
|
3
4
|
import os
|
|
4
5
|
import shlex
|
|
@@ -1138,6 +1139,28 @@ class WasmerBuilder:
|
|
|
1138
1139
|
*(extra_args or []), _out=write_stdout, _err=write_stderr, _env=os.environ
|
|
1139
1140
|
)
|
|
1140
1141
|
|
|
1142
|
+
def deploy_config(self, config_path: Path) -> None:
|
|
1143
|
+
package_webc_path = self.wasmer_dir_path / "package.webc"
|
|
1144
|
+
app_yaml_path = self.wasmer_dir_path / "app.yaml"
|
|
1145
|
+
package_webc_path.parent.mkdir(parents=True, exist_ok=True)
|
|
1146
|
+
self.run_command(
|
|
1147
|
+
self.bin,
|
|
1148
|
+
["package", "build", self.wasmer_dir_path, "--out", package_webc_path],
|
|
1149
|
+
)
|
|
1150
|
+
config_path.write_text(
|
|
1151
|
+
json.dumps(
|
|
1152
|
+
{
|
|
1153
|
+
"app_yaml_path": str(app_yaml_path.absolute()),
|
|
1154
|
+
"package_webc_path": str(package_webc_path.absolute()),
|
|
1155
|
+
"package_webc_size": package_webc_path.stat().st_size,
|
|
1156
|
+
"package_webc_sha256": hashlib.sha256(
|
|
1157
|
+
package_webc_path.read_bytes()
|
|
1158
|
+
).hexdigest(),
|
|
1159
|
+
}
|
|
1160
|
+
)
|
|
1161
|
+
)
|
|
1162
|
+
console.print(f"\n[bold]Saved deploy config to {config_path}[/bold]")
|
|
1163
|
+
|
|
1141
1164
|
def deploy(
|
|
1142
1165
|
self, app_owner: Optional[str] = None, app_name: Optional[str] = None
|
|
1143
1166
|
) -> str:
|
|
@@ -1354,12 +1377,7 @@ class Ctx:
|
|
|
1354
1377
|
}
|
|
1355
1378
|
|
|
1356
1379
|
|
|
1357
|
-
def evaluate_shipit(
|
|
1358
|
-
shipit_file = path / "Shipit"
|
|
1359
|
-
if not shipit_file.exists():
|
|
1360
|
-
raise FileNotFoundError(
|
|
1361
|
-
f"Shipit file not found at {shipit_file}. Run `shipit generate {path}` to create it."
|
|
1362
|
-
)
|
|
1380
|
+
def evaluate_shipit(shipit_file: Path, builder: Builder) -> Tuple[Ctx, Serve]:
|
|
1363
1381
|
source = shipit_file.read_text()
|
|
1364
1382
|
ctx = Ctx(builder)
|
|
1365
1383
|
glb = sl.Globals.standard()
|
|
@@ -1447,14 +1465,22 @@ def auto(
|
|
|
1447
1465
|
None,
|
|
1448
1466
|
help="Regenerate the Shipit file.",
|
|
1449
1467
|
),
|
|
1450
|
-
|
|
1468
|
+
shipit_path: Optional[Path] = typer.Option(
|
|
1451
1469
|
None,
|
|
1452
|
-
help="
|
|
1470
|
+
help="The path to the Shipit file (defaults to Shipit in the provided path).",
|
|
1471
|
+
),
|
|
1472
|
+
temp_shipit: bool = typer.Option(
|
|
1473
|
+
False,
|
|
1474
|
+
help="Use a temporary Shipit file in the system temporary directory.",
|
|
1453
1475
|
),
|
|
1454
1476
|
wasmer_deploy: Optional[bool] = typer.Option(
|
|
1455
1477
|
False,
|
|
1456
1478
|
help="Deploy the project to Wasmer.",
|
|
1457
1479
|
),
|
|
1480
|
+
wasmer_deploy_config: Optional[Path] = typer.Option(
|
|
1481
|
+
None,
|
|
1482
|
+
help="Save the output of the Wasmer build to a json file",
|
|
1483
|
+
),
|
|
1458
1484
|
wasmer_token: Optional[str] = typer.Option(
|
|
1459
1485
|
None,
|
|
1460
1486
|
help="Wasmer token.",
|
|
@@ -1499,10 +1525,24 @@ def auto(
|
|
|
1499
1525
|
if not path.exists():
|
|
1500
1526
|
raise Exception(f"The path {path} does not exist")
|
|
1501
1527
|
|
|
1502
|
-
if
|
|
1528
|
+
if temp_shipit:
|
|
1529
|
+
if shipit_path:
|
|
1530
|
+
raise Exception("Cannot use both --temp-shipit and --shipit-path")
|
|
1531
|
+
temp_shipit = tempfile.NamedTemporaryFile(
|
|
1532
|
+
delete=False, delete_on_close=False, prefix="Shipit"
|
|
1533
|
+
)
|
|
1534
|
+
shipit_path = Path(temp_shipit.name)
|
|
1535
|
+
|
|
1536
|
+
if not regenerate:
|
|
1537
|
+
if shipit_path and not shipit_path.exists():
|
|
1538
|
+
regenerate = True
|
|
1539
|
+
elif not (path / "Shipit").exists():
|
|
1540
|
+
regenerate = True
|
|
1541
|
+
|
|
1542
|
+
if regenerate:
|
|
1503
1543
|
generate(
|
|
1504
1544
|
path,
|
|
1505
|
-
out=
|
|
1545
|
+
out=shipit_path,
|
|
1506
1546
|
use_procfile=use_procfile,
|
|
1507
1547
|
install_command=install_command,
|
|
1508
1548
|
build_command=build_command,
|
|
@@ -1512,6 +1552,7 @@ def auto(
|
|
|
1512
1552
|
|
|
1513
1553
|
build(
|
|
1514
1554
|
path,
|
|
1555
|
+
shipit_path=shipit_path,
|
|
1515
1556
|
wasmer=(wasmer or wasmer_deploy),
|
|
1516
1557
|
docker=docker,
|
|
1517
1558
|
docker_client=docker_client,
|
|
@@ -1522,7 +1563,7 @@ def auto(
|
|
|
1522
1563
|
skip_prepare=skip_prepare,
|
|
1523
1564
|
env_name=env_name,
|
|
1524
1565
|
)
|
|
1525
|
-
if start or wasmer_deploy:
|
|
1566
|
+
if start or wasmer_deploy or wasmer_deploy_config:
|
|
1526
1567
|
serve(
|
|
1527
1568
|
path,
|
|
1528
1569
|
wasmer=wasmer,
|
|
@@ -1535,6 +1576,7 @@ def auto(
|
|
|
1535
1576
|
wasmer_deploy=wasmer_deploy,
|
|
1536
1577
|
wasmer_app_owner=wasmer_app_owner,
|
|
1537
1578
|
wasmer_app_name=wasmer_app_name,
|
|
1579
|
+
wasmer_deploy_config=wasmer_deploy_config,
|
|
1538
1580
|
)
|
|
1539
1581
|
# deploy(path)
|
|
1540
1582
|
|
|
@@ -1548,6 +1590,10 @@ def generate(
|
|
|
1548
1590
|
),
|
|
1549
1591
|
out: Optional[Path] = typer.Option(
|
|
1550
1592
|
None,
|
|
1593
|
+
"-o",
|
|
1594
|
+
"--out",
|
|
1595
|
+
"--output",
|
|
1596
|
+
"--shipit-path",
|
|
1551
1597
|
help="Output path (defaults to the Shipit file in the provided path).",
|
|
1552
1598
|
),
|
|
1553
1599
|
use_procfile: bool = typer.Option(
|
|
@@ -1672,6 +1718,10 @@ def serve(
|
|
|
1672
1718
|
None,
|
|
1673
1719
|
help="Name of the Wasmer app.",
|
|
1674
1720
|
),
|
|
1721
|
+
wasmer_deploy_config: Optional[Path] = typer.Option(
|
|
1722
|
+
None,
|
|
1723
|
+
help="Save the output of the Wasmer build to a json file",
|
|
1724
|
+
),
|
|
1675
1725
|
) -> None:
|
|
1676
1726
|
if not path.exists():
|
|
1677
1727
|
raise Exception(f"The path {path} does not exist")
|
|
@@ -1681,18 +1731,17 @@ def serve(
|
|
|
1681
1731
|
builder = DockerBuilder(path, docker_client)
|
|
1682
1732
|
else:
|
|
1683
1733
|
builder = LocalBuilder(path)
|
|
1684
|
-
if wasmer or wasmer_deploy:
|
|
1734
|
+
if wasmer or wasmer_deploy or wasmer_deploy_config:
|
|
1685
1735
|
builder = WasmerBuilder(
|
|
1686
1736
|
builder, path, registry=wasmer_registry, token=wasmer_token, bin=wasmer_bin
|
|
1687
1737
|
)
|
|
1688
|
-
if start:
|
|
1689
|
-
builder.run_serve_command("start")
|
|
1690
1738
|
|
|
1691
|
-
if
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1739
|
+
if wasmer_deploy_config:
|
|
1740
|
+
builder.deploy_config(wasmer_deploy_config)
|
|
1741
|
+
elif wasmer_deploy:
|
|
1742
|
+
builder.deploy(app_owner=wasmer_app_owner, app_name=wasmer_app_name)
|
|
1743
|
+
elif start:
|
|
1744
|
+
builder.run_serve_command("start")
|
|
1696
1745
|
|
|
1697
1746
|
|
|
1698
1747
|
@app.command(name="plan")
|
|
@@ -1702,6 +1751,25 @@ def plan(
|
|
|
1702
1751
|
help="Project path (defaults to current directory).",
|
|
1703
1752
|
show_default=False,
|
|
1704
1753
|
),
|
|
1754
|
+
out: Optional[Path] = typer.Option(
|
|
1755
|
+
None,
|
|
1756
|
+
"-o",
|
|
1757
|
+
"--out",
|
|
1758
|
+
"--output",
|
|
1759
|
+
help="Output path of the plan (defaults to stdout).",
|
|
1760
|
+
),
|
|
1761
|
+
temp_shipit: bool = typer.Option(
|
|
1762
|
+
False,
|
|
1763
|
+
help="Use a temporary Shipit file in the system temporary directory.",
|
|
1764
|
+
),
|
|
1765
|
+
regenerate: bool = typer.Option(
|
|
1766
|
+
False,
|
|
1767
|
+
help="Regenerate the Shipit file.",
|
|
1768
|
+
),
|
|
1769
|
+
shipit_path: Optional[Path] = typer.Option(
|
|
1770
|
+
None,
|
|
1771
|
+
help="The path to the Shipit file (defaults to Shipit in the provided path).",
|
|
1772
|
+
),
|
|
1705
1773
|
wasmer: bool = typer.Option(
|
|
1706
1774
|
False,
|
|
1707
1775
|
help="Use Wasmer to evaluate the project.",
|
|
@@ -1726,10 +1794,55 @@ def plan(
|
|
|
1726
1794
|
None,
|
|
1727
1795
|
help="Use a specific Docker client (such as depot, podman, etc.)",
|
|
1728
1796
|
),
|
|
1797
|
+
use_procfile: bool = typer.Option(
|
|
1798
|
+
True,
|
|
1799
|
+
help="Use the Procfile to generate the default custom commands (install, build, start, after_deploy).",
|
|
1800
|
+
),
|
|
1801
|
+
install_command: Optional[str] = typer.Option(
|
|
1802
|
+
None,
|
|
1803
|
+
help="The install command to use (overwrites the default)",
|
|
1804
|
+
),
|
|
1805
|
+
build_command: Optional[str] = typer.Option(
|
|
1806
|
+
None,
|
|
1807
|
+
help="The build command to use (overwrites the default)",
|
|
1808
|
+
),
|
|
1809
|
+
start_command: Optional[str] = typer.Option(
|
|
1810
|
+
None,
|
|
1811
|
+
help="The start command to use (overwrites the default)",
|
|
1812
|
+
),
|
|
1813
|
+
use_provider: Optional[str] = typer.Option(
|
|
1814
|
+
None,
|
|
1815
|
+
help="Use a specific provider to build the project.",
|
|
1816
|
+
),
|
|
1729
1817
|
) -> None:
|
|
1730
1818
|
if not path.exists():
|
|
1731
1819
|
raise Exception(f"The path {path} does not exist")
|
|
1732
1820
|
|
|
1821
|
+
if temp_shipit:
|
|
1822
|
+
if shipit_path:
|
|
1823
|
+
raise Exception("Cannot use both --temp-shipit and --shipit-path")
|
|
1824
|
+
temp_shipit = tempfile.NamedTemporaryFile(
|
|
1825
|
+
delete=False, delete_on_close=False, prefix="Shipit"
|
|
1826
|
+
)
|
|
1827
|
+
shipit_path = Path(temp_shipit.name)
|
|
1828
|
+
|
|
1829
|
+
if not regenerate:
|
|
1830
|
+
if shipit_path and not shipit_path.exists():
|
|
1831
|
+
regenerate = True
|
|
1832
|
+
elif not (path / "Shipit").exists():
|
|
1833
|
+
regenerate = True
|
|
1834
|
+
|
|
1835
|
+
if regenerate:
|
|
1836
|
+
generate(
|
|
1837
|
+
path,
|
|
1838
|
+
out=shipit_path,
|
|
1839
|
+
use_procfile=use_procfile,
|
|
1840
|
+
install_command=install_command,
|
|
1841
|
+
build_command=build_command,
|
|
1842
|
+
start_command=start_command,
|
|
1843
|
+
use_provider=use_provider,
|
|
1844
|
+
)
|
|
1845
|
+
|
|
1733
1846
|
custom_commands = CustomCommands()
|
|
1734
1847
|
procfile_path = path / "Procfile"
|
|
1735
1848
|
if procfile_path.exists():
|
|
@@ -1739,6 +1852,8 @@ def plan(
|
|
|
1739
1852
|
except Exception:
|
|
1740
1853
|
pass
|
|
1741
1854
|
|
|
1855
|
+
shipit_file = get_shipit_path(path, shipit_path)
|
|
1856
|
+
|
|
1742
1857
|
builder: Builder
|
|
1743
1858
|
if docker or docker_client:
|
|
1744
1859
|
builder = DockerBuilder(path, docker_client)
|
|
@@ -1749,7 +1864,7 @@ def plan(
|
|
|
1749
1864
|
builder, path, registry=wasmer_registry, token=wasmer_token, bin=wasmer_bin
|
|
1750
1865
|
)
|
|
1751
1866
|
|
|
1752
|
-
ctx, serve = evaluate_shipit(
|
|
1867
|
+
ctx, serve = evaluate_shipit(shipit_file, builder)
|
|
1753
1868
|
metadata_commands: Dict[str, Optional[str]] = {
|
|
1754
1869
|
"start": serve.commands.get("start"),
|
|
1755
1870
|
"after_deploy": serve.commands.get("after_deploy"),
|
|
@@ -1789,7 +1904,14 @@ def plan(
|
|
|
1789
1904
|
for svc in (serve.services or [])
|
|
1790
1905
|
],
|
|
1791
1906
|
}
|
|
1792
|
-
|
|
1907
|
+
json_output = json.dumps(plan_output, indent=4)
|
|
1908
|
+
if out:
|
|
1909
|
+
out.parent.mkdir(parents=True, exist_ok=True)
|
|
1910
|
+
out.write_text(json_output)
|
|
1911
|
+
console.print(f"[bold]Plan saved to {out.absolute()}[/bold]")
|
|
1912
|
+
else:
|
|
1913
|
+
sys.stdout.write(json_output + "\n")
|
|
1914
|
+
sys.stdout.flush()
|
|
1793
1915
|
|
|
1794
1916
|
|
|
1795
1917
|
@app.command(name="build")
|
|
@@ -1799,6 +1921,10 @@ def build(
|
|
|
1799
1921
|
help="Project path (defaults to current directory).",
|
|
1800
1922
|
show_default=False,
|
|
1801
1923
|
),
|
|
1924
|
+
shipit_path: Optional[Path] = typer.Option(
|
|
1925
|
+
None,
|
|
1926
|
+
help="The path to the Shipit file (defaults to Shipit in the provided path).",
|
|
1927
|
+
),
|
|
1802
1928
|
wasmer: bool = typer.Option(
|
|
1803
1929
|
False,
|
|
1804
1930
|
help="Use Wasmer to build and serve the project.",
|
|
@@ -1839,6 +1965,8 @@ def build(
|
|
|
1839
1965
|
if not path.exists():
|
|
1840
1966
|
raise Exception(f"The path {path} does not exist")
|
|
1841
1967
|
|
|
1968
|
+
shipit_file = get_shipit_path(path, shipit_path)
|
|
1969
|
+
|
|
1842
1970
|
builder: Builder
|
|
1843
1971
|
if docker or docker_client:
|
|
1844
1972
|
builder = DockerBuilder(path, docker_client)
|
|
@@ -1849,7 +1977,7 @@ def build(
|
|
|
1849
1977
|
builder, path, registry=wasmer_registry, token=wasmer_token, bin=wasmer_bin
|
|
1850
1978
|
)
|
|
1851
1979
|
|
|
1852
|
-
ctx, serve = evaluate_shipit(
|
|
1980
|
+
ctx, serve = evaluate_shipit(shipit_file, builder)
|
|
1853
1981
|
env = {
|
|
1854
1982
|
"PATH": "",
|
|
1855
1983
|
"COLORTERM": os.environ.get("COLORTERM", ""),
|
|
@@ -1868,6 +1996,7 @@ def build(
|
|
|
1868
1996
|
)
|
|
1869
1997
|
return build(
|
|
1870
1998
|
path,
|
|
1999
|
+
shipit_path=shipit_path,
|
|
1871
2000
|
wasmer=wasmer,
|
|
1872
2001
|
skip_prepare=skip_prepare,
|
|
1873
2002
|
wasmer_bin=wasmer_bin,
|
|
@@ -1898,6 +2027,20 @@ def build(
|
|
|
1898
2027
|
builder.prepare(env, serve.prepare)
|
|
1899
2028
|
|
|
1900
2029
|
|
|
2030
|
+
def get_shipit_path(path: Path, shipit_path: Optional[Path] = None) -> Path:
|
|
2031
|
+
if shipit_path is None:
|
|
2032
|
+
shipit_path = path / "Shipit"
|
|
2033
|
+
if not shipit_path.exists():
|
|
2034
|
+
raise Exception(
|
|
2035
|
+
f"Shipit file not found at {shipit_path}. Run `shipit generate {path}` to create it."
|
|
2036
|
+
)
|
|
2037
|
+
elif not shipit_path.exists():
|
|
2038
|
+
raise Exception(
|
|
2039
|
+
f"Shipit file not found at {shipit_path}. Run `shipit generate {path} -o {shipit_path}` to create it."
|
|
2040
|
+
)
|
|
2041
|
+
return shipit_path
|
|
2042
|
+
|
|
2043
|
+
|
|
1901
2044
|
def main() -> None:
|
|
1902
2045
|
args = sys.argv[1:]
|
|
1903
2046
|
# If no subcommand or first token looks like option/path → default to "build"
|
|
@@ -1909,7 +2052,8 @@ def main() -> None:
|
|
|
1909
2052
|
app()
|
|
1910
2053
|
except Exception as e:
|
|
1911
2054
|
console.print(f"[bold red]{type(e).__name__}[/bold red]: {e}")
|
|
1912
|
-
|
|
2055
|
+
if os.environ.get("SHIPIT_DEBUG", "false").lower() in ["1", "true", "yes", "y"]:
|
|
2056
|
+
raise e
|
|
1913
2057
|
|
|
1914
2058
|
|
|
1915
2059
|
if __name__ == "__main__":
|
|
@@ -95,7 +95,7 @@ def generate_shipit(path: Path, custom_commands: CustomCommands, use_provider: O
|
|
|
95
95
|
# Collect parts
|
|
96
96
|
plan = ProviderPlan(
|
|
97
97
|
serve_name=provider.serve_name(),
|
|
98
|
-
provider=provider.
|
|
98
|
+
provider=provider.name(),
|
|
99
99
|
platform=provider.platform(),
|
|
100
100
|
mounts=provider.mounts(),
|
|
101
101
|
volumes=provider.volumes(),
|
|
@@ -28,7 +28,6 @@ class Provider(Protocol):
|
|
|
28
28
|
def initialize(self) -> None: ...
|
|
29
29
|
# Structured plan steps (no path args; use self.path)
|
|
30
30
|
def serve_name(self) -> str: ...
|
|
31
|
-
def provider_kind(self) -> str: ...
|
|
32
31
|
def platform(self) -> Optional[str]: ...
|
|
33
32
|
def dependencies(self) -> list["DependencySpec"]: ...
|
|
34
33
|
def declarations(self) -> Optional[str]: ...
|
|
@@ -40,11 +40,8 @@ class MkdocsProvider(StaticFileProvider):
|
|
|
40
40
|
def serve_name(self) -> str:
|
|
41
41
|
return self.path.name
|
|
42
42
|
|
|
43
|
-
def provider_kind(self) -> str:
|
|
44
|
-
return "mkdocs-site"
|
|
45
|
-
|
|
46
43
|
def platform(self) -> Optional[str]:
|
|
47
|
-
return
|
|
44
|
+
return None
|
|
48
45
|
|
|
49
46
|
def dependencies(self) -> list[DependencySpec]:
|
|
50
47
|
return [
|
|
@@ -231,9 +231,6 @@ class NodeStaticProvider(StaticFileProvider):
|
|
|
231
231
|
def serve_name(self) -> str:
|
|
232
232
|
return self.path.name
|
|
233
233
|
|
|
234
|
-
def provider_kind(self) -> str:
|
|
235
|
-
return "staticsite"
|
|
236
|
-
|
|
237
234
|
def platform(self) -> Optional[str]:
|
|
238
235
|
return self.static_generator.value if self.static_generator else None
|
|
239
236
|
|
|
@@ -226,9 +226,6 @@ class PythonProvider:
|
|
|
226
226
|
def serve_name(self) -> str:
|
|
227
227
|
return self.path.name
|
|
228
228
|
|
|
229
|
-
def provider_kind(self) -> str:
|
|
230
|
-
return "python"
|
|
231
|
-
|
|
232
229
|
def platform(self) -> Optional[str]:
|
|
233
230
|
return self.framework.value if self.framework else None
|
|
234
231
|
|
|
@@ -327,8 +324,8 @@ class PythonProvider:
|
|
|
327
324
|
elif has_requirements or extra_deps:
|
|
328
325
|
steps += [
|
|
329
326
|
'env(UV_PROJECT_ENVIRONMENT=local_venv["build"] if cross_platform else venv["build"])',
|
|
330
|
-
'run(f"uv init
|
|
331
|
-
'copy(".", ".")' if self.install_requires_all_files else None,
|
|
327
|
+
'run(f"uv init", inputs=[], outputs=["uv.lock"], group="install")',
|
|
328
|
+
'copy(".", ".", ignore=[".venv", ".git", "__pycache__"])' if self.install_requires_all_files else None,
|
|
332
329
|
]
|
|
333
330
|
if has_requirements:
|
|
334
331
|
steps += [
|
|
@@ -347,7 +344,7 @@ class PythonProvider:
|
|
|
347
344
|
|
|
348
345
|
steps += [
|
|
349
346
|
'path((local_venv["build"] if cross_platform else venv["build"]) + "/bin")',
|
|
350
|
-
'copy(".", ".", ignore=[".venv", ".git", "__pycache__"])',
|
|
347
|
+
'copy(".", ".", ignore=[".venv", ".git", "__pycache__"])' if not self.install_requires_all_files else None,
|
|
351
348
|
]
|
|
352
349
|
if self.framework == PythonFramework.MCP:
|
|
353
350
|
steps += [
|
|
@@ -43,11 +43,8 @@ class WordPressProvider(PhpProvider):
|
|
|
43
43
|
def serve_name(self) -> str:
|
|
44
44
|
return self.path.name
|
|
45
45
|
|
|
46
|
-
def provider_kind(self) -> str:
|
|
47
|
-
return "php"
|
|
48
|
-
|
|
49
46
|
def platform(self) -> Optional[str]:
|
|
50
|
-
return
|
|
47
|
+
return None
|
|
51
48
|
|
|
52
49
|
def dependencies(self) -> list[DependencySpec]:
|
|
53
50
|
return [
|
|
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
|