shipit-cli 0.17.5__tar.gz → 0.17.7__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.17.5 → shipit_cli-0.17.7}/PKG-INFO +18 -1
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/README.md +17 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/pyproject.toml +35 -3
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/assets/php/php.ini +6 -5
- shipit_cli-0.17.7/src/shipit/assets/wordpress/.htaccess +15 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/assets/wordpress/install.sh +7 -0
- shipit_cli-0.17.7/src/shipit/assets/wordpress/start.sh +23 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/builders/docker.py +1 -1
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/builders/local.py +1 -1
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/php.py +8 -1
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/python.py +8 -8
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/wordpress.py +16 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/runners/local.py +1 -1
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/runners/wasmer.py +29 -17
- shipit_cli-0.17.7/src/shipit/version.py +5 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/tests/test_generate_shipit_examples.py +9 -8
- shipit_cli-0.17.5/src/shipit/version.py +0 -5
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/.gitignore +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/__init__.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/assets/wordpress/wp-config.php +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/builders/__init__.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/builders/base.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/cli.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/generator.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/procfile.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/base.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/go.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/hugo.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/jekyll.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/laravel.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/mkdocs.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/node_static.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/registry.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/providers/staticfile.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/runners/__init__.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/runners/base.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/shipit_types.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/ui.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/src/shipit/utils.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/tests/test_e2e.py +0 -0
- {shipit_cli-0.17.5 → shipit_cli-0.17.7}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shipit-cli
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.7
|
|
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
|
|
@@ -133,3 +133,20 @@ The e2e tests will:
|
|
|
133
133
|
* Build the project (locally, or with docker)
|
|
134
134
|
* Run the project (locally or with Wasmer)
|
|
135
135
|
* Test that the project output (via http requests) is the correct one
|
|
136
|
+
|
|
137
|
+
### Automatic PyPI Publish
|
|
138
|
+
|
|
139
|
+
Publishing to PyPI is automated with GitHub Actions on version tags.
|
|
140
|
+
|
|
141
|
+
Requirements:
|
|
142
|
+
|
|
143
|
+
* Add a repository secret named `PYPI_API_TOKEN` with a PyPI API token.
|
|
144
|
+
* Push tags using the `vX.Y.Z` format (for example: `v0.17.5`).
|
|
145
|
+
|
|
146
|
+
On each `v*` tag push, the workflow:
|
|
147
|
+
|
|
148
|
+
* Runs regular test and e2e workflows.
|
|
149
|
+
* Validates that the tag version without the leading `v` matches:
|
|
150
|
+
* `project.version` in `pyproject.toml`
|
|
151
|
+
* `version` in `src/shipit/version.py`
|
|
152
|
+
* Builds the package and publishes to PyPI only if all checks pass.
|
|
@@ -110,3 +110,20 @@ The e2e tests will:
|
|
|
110
110
|
* Build the project (locally, or with docker)
|
|
111
111
|
* Run the project (locally or with Wasmer)
|
|
112
112
|
* Test that the project output (via http requests) is the correct one
|
|
113
|
+
|
|
114
|
+
### Automatic PyPI Publish
|
|
115
|
+
|
|
116
|
+
Publishing to PyPI is automated with GitHub Actions on version tags.
|
|
117
|
+
|
|
118
|
+
Requirements:
|
|
119
|
+
|
|
120
|
+
* Add a repository secret named `PYPI_API_TOKEN` with a PyPI API token.
|
|
121
|
+
* Push tags using the `vX.Y.Z` format (for example: `v0.17.5`).
|
|
122
|
+
|
|
123
|
+
On each `v*` tag push, the workflow:
|
|
124
|
+
|
|
125
|
+
* Runs regular test and e2e workflows.
|
|
126
|
+
* Validates that the tag version without the leading `v` matches:
|
|
127
|
+
* `project.version` in `pyproject.toml`
|
|
128
|
+
* `version` in `src/shipit/version.py`
|
|
129
|
+
* Builds the package and publishes to PyPI only if all checks pass.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "shipit-cli"
|
|
3
|
-
version = "0.17.
|
|
3
|
+
version = "0.17.7"
|
|
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"
|
|
@@ -38,17 +38,49 @@ packages = ["src/shipit"]
|
|
|
38
38
|
[tool.hatch.build.targets.sdist]
|
|
39
39
|
only-include = ["src/shipit", "tests"]
|
|
40
40
|
|
|
41
|
-
[
|
|
42
|
-
dev
|
|
41
|
+
[dependency-groups]
|
|
42
|
+
dev = [
|
|
43
43
|
"aiohttp>=3.12.15",
|
|
44
|
+
"mypy>=1.18.2",
|
|
44
45
|
"pytest>=8.4.1",
|
|
45
46
|
"pytest-asyncio>=1.2.0",
|
|
46
47
|
"pytest-rerunfailures>=16.0.1",
|
|
47
48
|
"pytest-xdist>=3.8.0",
|
|
49
|
+
"types-pyyaml>=6.0.12.20250915",
|
|
50
|
+
"types-requests>=2.32.4.20250913",
|
|
51
|
+
"types-toml>=0.10.8.20240310",
|
|
48
52
|
]
|
|
49
53
|
|
|
50
54
|
[tool.pytest.ini_options]
|
|
51
55
|
asyncio_mode = "auto"
|
|
56
|
+
markers = [
|
|
57
|
+
"e2e: end-to-end tests that require external runtimes and network access",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.mypy]
|
|
61
|
+
python_version = "3.13"
|
|
62
|
+
files = ["src/shipit"]
|
|
63
|
+
exclude = ["^examples/"]
|
|
64
|
+
show_error_codes = true
|
|
65
|
+
pretty = true
|
|
66
|
+
ignore_missing_imports = true
|
|
67
|
+
warn_redundant_casts = true
|
|
68
|
+
warn_unused_ignores = true
|
|
69
|
+
|
|
70
|
+
[[tool.mypy.overrides]]
|
|
71
|
+
module = [
|
|
72
|
+
"shipit.cli",
|
|
73
|
+
"shipit.generator",
|
|
74
|
+
"shipit.providers.go",
|
|
75
|
+
"shipit.providers.hugo",
|
|
76
|
+
"shipit.providers.jekyll",
|
|
77
|
+
"shipit.providers.node_static",
|
|
78
|
+
"shipit.providers.python",
|
|
79
|
+
"shipit.providers.staticfile",
|
|
80
|
+
"shipit.runners.wasmer",
|
|
81
|
+
"tests.test_e2e",
|
|
82
|
+
]
|
|
83
|
+
ignore_errors = true
|
|
52
84
|
|
|
53
85
|
[tool.uv.workspace]
|
|
54
86
|
exclude = ["examples/*"]
|
|
@@ -15,9 +15,9 @@ zend.enable_gc = On
|
|
|
15
15
|
zend.exception_ignore_args = On
|
|
16
16
|
zend.exception_string_param_max_len = 0
|
|
17
17
|
expose_php = On
|
|
18
|
-
max_execution_time =
|
|
19
|
-
max_input_time =
|
|
20
|
-
memory_limit =
|
|
18
|
+
max_execution_time = 300
|
|
19
|
+
max_input_time = 300
|
|
20
|
+
memory_limit = 512M
|
|
21
21
|
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
|
|
22
22
|
display_errors = Off
|
|
23
23
|
display_startup_errors = Off
|
|
@@ -31,7 +31,7 @@ variables_order = "GPCS"
|
|
|
31
31
|
request_order = "GP"
|
|
32
32
|
register_argc_argv = Off
|
|
33
33
|
auto_globals_jit = On
|
|
34
|
-
post_max_size =
|
|
34
|
+
post_max_size = 64M
|
|
35
35
|
auto_prepend_file =
|
|
36
36
|
auto_append_file =
|
|
37
37
|
default_mimetype = "text/html"
|
|
@@ -40,7 +40,8 @@ doc_root =
|
|
|
40
40
|
user_dir =
|
|
41
41
|
enable_dl = Off
|
|
42
42
|
file_uploads = On
|
|
43
|
-
upload_max_filesize =
|
|
43
|
+
upload_max_filesize = 2G
|
|
44
|
+
max_input_vars = 6144
|
|
44
45
|
max_file_uploads = 20
|
|
45
46
|
allow_url_fopen = On
|
|
46
47
|
allow_url_include = Off
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# BEGIN WordPress
|
|
2
|
+
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
|
|
3
|
+
# dynamically generated, and should only be modified via WordPress filters.
|
|
4
|
+
# Any changes to the directives between these markers will be overwritten.
|
|
5
|
+
<IfModule mod_rewrite.c>
|
|
6
|
+
RewriteEngine On
|
|
7
|
+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
8
|
+
RewriteBase /
|
|
9
|
+
RewriteRule ^index\.php$ - [L]
|
|
10
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
11
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
12
|
+
RewriteRule . /index.php [L]
|
|
13
|
+
</IfModule>
|
|
14
|
+
|
|
15
|
+
# END WordPress
|
|
@@ -100,4 +100,11 @@ if [ -n "${WP_LOCALE:-}" ]; then
|
|
|
100
100
|
wp site switch-language "$WP_LOCALE"
|
|
101
101
|
fi
|
|
102
102
|
|
|
103
|
+
cat > /app/wp-content/wp-config.php <<EOF
|
|
104
|
+
<?php
|
|
105
|
+
// If you need to set custom configuration, you can place it here.
|
|
106
|
+
// This file will be included by the main wp-config.php after
|
|
107
|
+
// loading environment variables.
|
|
108
|
+
EOF
|
|
109
|
+
|
|
103
110
|
echo "✅ WordPress Installation complete"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
ROOT_HTACCESS="/app/wp-content/root-htaccess"
|
|
4
|
+
APP_HTACCESS="/app/.htaccess"
|
|
5
|
+
|
|
6
|
+
if [[ -e "$APP_HTACCESS" ]]; then
|
|
7
|
+
if [[ ! -f "$ROOT_HTACCESS" ]]; then
|
|
8
|
+
echo "Coppying app's .htaccess file into wp-content"
|
|
9
|
+
# Note: doing cp fails, so we resort to this workaround.
|
|
10
|
+
cat "$APP_HTACCESS" > "$ROOT_HTACCESS"
|
|
11
|
+
fi
|
|
12
|
+
rm "$APP_HTACCESS"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# If no base htaccess is found, then we create a symlink to the root htaccess
|
|
16
|
+
if [[ ! -e "$APP_HTACCESS" ]]; then
|
|
17
|
+
if [[ -f "$ROOT_HTACCESS" ]]; then
|
|
18
|
+
echo "Using wp-content .htaccess file as app's htaccess"
|
|
19
|
+
ln -s "$ROOT_HTACCESS" "$APP_HTACCESS"
|
|
20
|
+
fi
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
phpix "$@"
|
|
@@ -29,6 +29,7 @@ class PhpConfig(Config):
|
|
|
29
29
|
composer_build_script: Optional[str] = None
|
|
30
30
|
php_version: Optional[str] = "8.3"
|
|
31
31
|
php_architecture: Optional[Literal["64-bit", "32-bit"]] = None
|
|
32
|
+
phpix_worker_threads: Optional[int] = 4
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
class PhpProvider:
|
|
@@ -141,7 +142,13 @@ class PhpProvider:
|
|
|
141
142
|
return self.base_commands()
|
|
142
143
|
|
|
143
144
|
def base_commands(self) -> Dict[str, str]:
|
|
144
|
-
|
|
145
|
+
if self.config.phpix:
|
|
146
|
+
php_script = "phpix"
|
|
147
|
+
if self.config.phpix_worker_threads:
|
|
148
|
+
php_script += f" --php-threads={self.config.phpix_worker_threads}"
|
|
149
|
+
else:
|
|
150
|
+
php_script = "php"
|
|
151
|
+
|
|
145
152
|
if _exists(self.path, "public/index.php"):
|
|
146
153
|
return {
|
|
147
154
|
"start": f'"{php_script} -S localhost:{{}} -t {{}}/public".format(PORT, app.serve_path)'
|
|
@@ -275,21 +275,21 @@ class PythonProvider:
|
|
|
275
275
|
|
|
276
276
|
@classmethod
|
|
277
277
|
def check_deps(cls, path: Path, *deps: str) -> Set[str]:
|
|
278
|
-
|
|
279
|
-
initial_deps = set(
|
|
278
|
+
pending_deps = {dep.lower() for dep in deps}
|
|
279
|
+
initial_deps = set(pending_deps)
|
|
280
280
|
for file in ["requirements.txt", "pyproject.toml"]:
|
|
281
281
|
if _exists(path, file):
|
|
282
282
|
for line in (path / file).read_text().splitlines():
|
|
283
|
-
for dep in set(
|
|
283
|
+
for dep in set(pending_deps):
|
|
284
284
|
if dep in line.lower():
|
|
285
|
-
|
|
286
|
-
if not
|
|
285
|
+
pending_deps.remove(dep)
|
|
286
|
+
if not pending_deps:
|
|
287
287
|
break
|
|
288
|
-
if not
|
|
288
|
+
if not pending_deps:
|
|
289
289
|
break
|
|
290
|
-
if not
|
|
290
|
+
if not pending_deps:
|
|
291
291
|
break
|
|
292
|
-
return initial_deps -
|
|
292
|
+
return initial_deps - pending_deps
|
|
293
293
|
|
|
294
294
|
@classmethod
|
|
295
295
|
def name(cls) -> str:
|
|
@@ -65,10 +65,20 @@ class WordPressProvider(PhpProvider):
|
|
|
65
65
|
'copy(wp_cli_download_url, "{}/wp-cli.phar".format(assets.path))',
|
|
66
66
|
'copy("wordpress/install.sh", "{}/setup-wp.sh".format(assets.path), base="assets")',
|
|
67
67
|
]
|
|
68
|
+
if self.config.phpix:
|
|
69
|
+
# We create the start script that creates the .htaccess symlink
|
|
70
|
+
# since phpix now supports .htaccess files.
|
|
71
|
+
steps.append(
|
|
72
|
+
'copy("wordpress/start.sh", "{}/start-wp.sh".format(assets.path), base="assets")'
|
|
73
|
+
)
|
|
68
74
|
if not _exists(self.path, "wp-config.php"):
|
|
69
75
|
steps.append(
|
|
70
76
|
'copy("wordpress/wp-config.php", "{}/wp-config.php".format(app.path), base="assets")'
|
|
71
77
|
)
|
|
78
|
+
if not _exists(self.path, ".htaccess"):
|
|
79
|
+
steps.append(
|
|
80
|
+
'copy("wordpress/.htaccess", "{}/.htaccess".format(app.path), base="assets")'
|
|
81
|
+
)
|
|
72
82
|
return steps + super().build_steps()
|
|
73
83
|
|
|
74
84
|
def prepare_steps(self) -> Optional[list[str]]:
|
|
@@ -76,6 +86,12 @@ class WordPressProvider(PhpProvider):
|
|
|
76
86
|
|
|
77
87
|
def commands(self) -> Dict[str, str]:
|
|
78
88
|
commands = super().commands()
|
|
89
|
+
if self.config.phpix:
|
|
90
|
+
if "start" in commands:
|
|
91
|
+
if self.config.phpix_worker_threads:
|
|
92
|
+
commands["start"] = f'"bash {{}}/start-wp.sh --php-threads={self.config.phpix_worker_threads} -S localhost:{{}} -t {{}}".format(assets.serve_path, PORT, app.serve_path)'
|
|
93
|
+
else:
|
|
94
|
+
commands["start"] = '"bash {}/start-wp.sh -S localhost:{} -t {}".format(assets.serve_path, PORT, app.serve_path)'
|
|
79
95
|
return {
|
|
80
96
|
# "wp": '"php {}/wp-cli.phar --allow-root --path={}".format(assets.serve_path, app.serve_path)',
|
|
81
97
|
"after_deploy": '"bash {}/setup-wp.sh".format(assets.serve_path)',
|
|
@@ -105,26 +105,26 @@ class WasmerRunner:
|
|
|
105
105
|
},
|
|
106
106
|
"phpix": {
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"latest": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
109
|
-
"8.3": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
110
|
-
"8.2": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
111
|
-
"8.1": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
112
|
-
"7.4": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
108
|
+
"latest": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
109
|
+
"8.3": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
110
|
+
"8.2": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
111
|
+
"8.1": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
112
|
+
"7.4": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
113
113
|
},
|
|
114
114
|
"architecture_dependencies": {
|
|
115
115
|
"64-bit": {
|
|
116
|
-
"latest": "wasmer/phpix-64@=0.1.1080321-alpha.
|
|
117
|
-
"8.3": "wasmer/phpix-64@=0.1.1080321-alpha.
|
|
118
|
-
"8.2": "wasmer/phpix-64@=0.1.1080321-alpha.
|
|
119
|
-
"8.1": "wasmer/phpix-64@=0.1.1080321-alpha.
|
|
120
|
-
"7.4": "wasmer/phpix-64@=0.1.1080321-alpha.
|
|
116
|
+
"latest": "wasmer/phpix-64@=0.1.1080321-alpha.6",
|
|
117
|
+
"8.3": "wasmer/phpix-64@=0.1.1080321-alpha.6",
|
|
118
|
+
"8.2": "wasmer/phpix-64@=0.1.1080321-alpha.6",
|
|
119
|
+
"8.1": "wasmer/phpix-64@=0.1.1080321-alpha.6",
|
|
120
|
+
"7.4": "wasmer/phpix-64@=0.1.1080321-alpha.6",
|
|
121
121
|
},
|
|
122
122
|
"32-bit": {
|
|
123
|
-
"latest": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
124
|
-
"8.3": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
125
|
-
"8.2": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
126
|
-
"8.1": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
127
|
-
"7.4": "wasmer/phpix-32@=0.1.1080321-alpha.
|
|
123
|
+
"latest": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
124
|
+
"8.3": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
125
|
+
"8.2": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
126
|
+
"8.1": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
127
|
+
"7.4": "wasmer/phpix-32@=0.1.1080321-alpha.6",
|
|
128
128
|
},
|
|
129
129
|
},
|
|
130
130
|
"scripts": {"php", "phpix"},
|
|
@@ -276,7 +276,7 @@ class WasmerRunner:
|
|
|
276
276
|
|
|
277
277
|
def find_file_in_mounts(self, serve: Serve, program: str) -> Optional[Path]:
|
|
278
278
|
program_path = Path(program)
|
|
279
|
-
for mount in serve.mounts:
|
|
279
|
+
for mount in serve.mounts or []:
|
|
280
280
|
if program.startswith(str(mount.serve_path.absolute())):
|
|
281
281
|
module_path = program_path.relative_to(mount.serve_path).as_posix()
|
|
282
282
|
full_module_path = (
|
|
@@ -456,6 +456,7 @@ class WasmerRunner:
|
|
|
456
456
|
yaml_config["package"] = "."
|
|
457
457
|
if serve.services:
|
|
458
458
|
capabilities = yaml_config.get("capabilities", {})
|
|
459
|
+
assert isinstance(capabilities, dict), "capabilities must be a dictionary"
|
|
459
460
|
has_mysql = any(service.provider == "mysql" for service in serve.services)
|
|
460
461
|
if has_mysql:
|
|
461
462
|
capabilities["database"] = {"engine": "mysql"}
|
|
@@ -463,6 +464,7 @@ class WasmerRunner:
|
|
|
463
464
|
|
|
464
465
|
if serve.volumes:
|
|
465
466
|
volumes_yaml = yaml_config.get("volumes", [])
|
|
467
|
+
assert isinstance(volumes_yaml, list), "volumes must be a list"
|
|
466
468
|
for vol in serve.volumes:
|
|
467
469
|
volumes_yaml.append(
|
|
468
470
|
{
|
|
@@ -473,6 +475,7 @@ class WasmerRunner:
|
|
|
473
475
|
yaml_config["volumes"] = volumes_yaml
|
|
474
476
|
|
|
475
477
|
has_php = any(dep.name == "php" for dep in serve.deps)
|
|
478
|
+
has_phpix = any(dep.name == "phpix" for dep in serve.deps)
|
|
476
479
|
build_deps = reduce(
|
|
477
480
|
lambda acc, dep: acc + dep.dependencies,
|
|
478
481
|
[step for step in serve.build if isinstance(step, UseStep)],
|
|
@@ -481,11 +484,20 @@ class WasmerRunner:
|
|
|
481
484
|
is_built_with_go = any(dep.name in ["go", "go-wasix"] for dep in build_deps)
|
|
482
485
|
|
|
483
486
|
# Note: phpix is multi-threaded, so this is only needed for raw php server and go.
|
|
484
|
-
if has_php or is_built_with_go:
|
|
487
|
+
if (has_php and not has_phpix) or is_built_with_go:
|
|
485
488
|
scaling = yaml_config.get("scaling", {})
|
|
489
|
+
assert isinstance(scaling, dict), "scaling must be a dictionary"
|
|
486
490
|
scaling["mode"] = "single_concurrency"
|
|
487
491
|
yaml_config["scaling"] = scaling
|
|
488
492
|
|
|
493
|
+
if has_phpix:
|
|
494
|
+
capabilities = yaml_config.get("capabilities", {})
|
|
495
|
+
assert isinstance(capabilities, dict), "capabilities must be a dictionary"
|
|
496
|
+
memory = capabilities.get("memory", {})
|
|
497
|
+
assert isinstance(memory, dict), "memory must be a dictionary"
|
|
498
|
+
memory["limit"] = "2Gb"
|
|
499
|
+
yaml_config["capabilities"] = capabilities
|
|
500
|
+
|
|
489
501
|
if "after_deploy" in serve.commands:
|
|
490
502
|
jobs = yaml_config.get("jobs", [])
|
|
491
503
|
# Filter out any existing after_deploy job
|
|
@@ -2,9 +2,8 @@ from pathlib import Path
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
|
|
5
|
-
from shipit.generator import generate_shipit
|
|
6
|
-
from shipit.
|
|
7
|
-
from shipit.providers.base import CustomCommands
|
|
5
|
+
from shipit.generator import generate_shipit, load_provider, load_provider_config
|
|
6
|
+
from shipit.providers.base import Config
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def _example_dirs_with_shipit() -> list[Path]:
|
|
@@ -25,12 +24,14 @@ def test_generate_shipit_matches_example(example_dir: Path) -> None:
|
|
|
25
24
|
This validates provider detection and the Shipit generator formatting for
|
|
26
25
|
each example that includes a `Shipit` file.
|
|
27
26
|
"""
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
procfile = Procfile.loads((example_dir / "Procfile").read_text())
|
|
31
|
-
custom_commands.start = procfile.get_start_command()
|
|
27
|
+
base_config = Config()
|
|
28
|
+
base_config.commands.enrich_from_path(example_dir)
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
provider_cls = load_provider(example_dir, base_config)
|
|
31
|
+
provider_config = load_provider_config(provider_cls, example_dir, base_config)
|
|
32
|
+
provider = provider_cls(example_dir, provider_config)
|
|
33
|
+
|
|
34
|
+
generated = generate_shipit(example_dir, provider)
|
|
34
35
|
expected = (example_dir / "Shipit").read_text()
|
|
35
36
|
# Use raw assert to let pytest show a unified diff on mismatch
|
|
36
37
|
assert generated == expected
|
|
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
|
|
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
|