kopia lustrzana https://github.com/piku/piku
Bare bones PHP support.
rodzic
d257fee0c4
commit
c43f1f2f2e
20
piku.py
20
piku.py
|
@ -409,6 +409,9 @@ def do_deploy(app, deltas={}, newrev=None):
|
|||
settings.update(deploy_clojure_cli(app, deltas))
|
||||
elif exists(join(app_path, 'project.clj')) and found_app("Clojure Lein") and check_requirements(['java', 'lein']):
|
||||
settings.update(deploy_clojure_leiningen(app, deltas))
|
||||
elif 'php' in workers:
|
||||
echo("-----> PHP app detected.", fg='green')
|
||||
settings.update(deploy_identity(app, deltas))
|
||||
elif 'release' in workers and 'web' in workers:
|
||||
echo("-----> Generic app detected.", fg='green')
|
||||
settings.update(deploy_identity(app, deltas))
|
||||
|
@ -741,7 +744,7 @@ def spawn_app(app, deltas={}):
|
|||
if exists(settings):
|
||||
env.update(parse_settings(settings, env)) # lgtm [py/modification-of-default-value]
|
||||
|
||||
if 'web' in workers or 'wsgi' in workers or 'jwsgi' in workers or 'static' in workers or 'rwsgi' in workers:
|
||||
if 'web' in workers or 'wsgi' in workers or 'jwsgi' in workers or 'static' in workers or 'rwsgi' in workers or 'php' in workers:
|
||||
# Pick a port if none defined
|
||||
if 'PORT' not in env:
|
||||
env['PORT'] = str(get_free_port())
|
||||
|
@ -948,7 +951,7 @@ def spawn_app(app, deltas={}):
|
|||
|
||||
env['PIKU_INTERNAL_NGINX_CUSTOM_CLAUSES'] = expandvars(open(join(app_path, env["NGINX_INCLUDE_FILE"])).read(), env) if env.get("NGINX_INCLUDE_FILE") else ""
|
||||
env['PIKU_INTERNAL_NGINX_PORTMAP'] = ""
|
||||
if 'web' in workers or 'wsgi' in workers or 'jwsgi' in workers or 'rwsgi' in workers:
|
||||
if 'web' in workers or 'wsgi' in workers or 'jwsgi' in workers or 'rwsgi' in workers or 'php' in workers:
|
||||
env['PIKU_INTERNAL_NGINX_PORTMAP'] = expandvars(NGINX_PORTMAP_FRAGMENT, env)
|
||||
env['PIKU_INTERNAL_NGINX_COMMON'] = expandvars(NGINX_COMMON_FRAGMENT, env)
|
||||
|
||||
|
@ -1158,6 +1161,19 @@ def spawn_worker(app, kind, command, env, ordinal=1):
|
|||
('http-use-socket', '{BIND_ADDRESS:s}:{PORT:s}'.format(**env)),
|
||||
('http-socket', '{BIND_ADDRESS:s}:{PORT:s}'.format(**env)),
|
||||
])
|
||||
elif kind == 'php':
|
||||
settings.extend([
|
||||
('plugin', 'http,0:php'),
|
||||
('http', ':{}'.format(env['PORT'])),
|
||||
('static-skip-ext', '.php'),
|
||||
('static-skip-ext', '.inc'),
|
||||
('static-index', 'index.html'),
|
||||
('php-docroot', join(APP_ROOT, app, command.strip("/").rstrip("/"))),
|
||||
('php-allowed-ext', '.php'),
|
||||
('php-allowed-ext', '.inc'),
|
||||
('php-index', 'index.php'),
|
||||
('php-set', 'date.timezone=America/Chicago'), # TODO
|
||||
])
|
||||
elif kind == 'web':
|
||||
echo("-----> nginx will talk to the 'web' process via {BIND_ADDRESS:s}:{PORT:s}".format(**env), fg='yellow')
|
||||
settings.append(('attach-daemon', command))
|
||||
|
|
Ładowanie…
Reference in New Issue