Skip to content
Snippets Groups Projects
Commit ac7a4dcb authored by Thomas Schneider's avatar Thomas Schneider Committed by Lars Beckers
Browse files

Add ruby support to uwsgi-python

parent e1335e67
No related branches found
No related tags found
1 merge request!4WIP: add acmebot role
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
......@@ -27,7 +27,9 @@
- uwsgi-plugin-python
- virtualenv
state: present
when: app_python_version == 2
when:
- app_python_version == 2
- app_lang == "python"
tags:
- uwsgi-app
- "{{ app.app }}"
......@@ -42,7 +44,22 @@
- uwsgi-plugin-python3
- virtualenv
state: present
when: app_python_version == 3
when:
- app_python_version == 3
- app_lang == "python"
tags:
- uwsgi-app
- "{{ app.app }}"
- "{{ app.instance }}"
- name: Install Ruby packages
apt:
name:
- "ruby{{ app_ruby_version }}"
- "uwsgi-plugin-rack-ruby{{ app_ruby_version }}"
- ruby-bundler
state: present
when: app_lang == "ruby"
tags:
- uwsgi-app
- "{{ app.app }}"
......@@ -194,6 +211,7 @@
- app_requirements_file is defined
- app_requirements_file|string != '' # noqa 602
- (app_git_pip is not defined) or (not app_git_pip)
- app_lang == "python"
tags:
- uwsgi-app
- "{{ app.app }}"
......@@ -211,6 +229,22 @@
when:
- app_git_pip is defined
- app_git_pip
- app_lang == "python"
tags:
- uwsgi-app
- "{{ app.app }}"
- "{{ app.instance }}"
- name: Install gems
bundler:
deployment_mode: true
exclude_groups:
- development
gemfile: "{{ app_gemfile }}"
when:
- app_gemfile is defined
- app_gemfile|string != ''
- app_lang == "ruby"
tags:
- uwsgi-app
- "{{ app.app }}"
......@@ -250,6 +284,7 @@
when:
- app_secret_config is defined
- app_secret_config
- app_lang == "python"
- name: ensure the secret config is not part of the git repository
lineinfile:
......@@ -263,6 +298,7 @@
when:
- app_secret_config is defined
- app_secret_config
- app_lang == "python"
- include_tasks: "{{ item }}"
with_first_found:
......
......@@ -39,6 +39,7 @@ log-date =
log-4xx =
log-5xx =
log-x-forwarded-for =
{% if app_lang == "python" %}
{% if app_python_version == 2 %}
plugin = python27
{% elif app_python_version == 3 %}
......@@ -65,4 +66,12 @@ callable = {{app_callable}}
pyargv = {{app_program}} {{app_command}}
mount={{app_mountpoint}}={{app_path}}/{{app_program}}
{% endif %}
{% elif app_lang == "ruby" %}
plugin = rack-ruby{{app_ruby_version|replace(".", "")}}
rack = {{app_rack}}
{% if app_gemfile is defined and app_gemfile != '' %}
env = BUNDLE_GEMFILE={{app_gemfile}}
rbrequire = bundler/setup
{% endif %}
{% endif %}
manage-script-name =
......@@ -6,12 +6,21 @@ app_group: "{{ app.app }}"
app_home: "/var/www/{{ app.app }}"
app_path: "/var/www/{{ app.app }}"
app_chdir: "{{ app_path }}"
app_lang: python
# Python specifics
app_python_version: 3
app_venv: "/var/www/{{ app.app }}/venv/"
app_program: "{{ app.app }}.py"
app_callable: app
app_command: ""
app_module: ''
# Ruby specifics
app_ruby_version: "2.5"
app_rack: "{{ app_path }}/config.ru"
app_gemfile: "{{ app_path }}/Gemfile"
app_mountpoint: /
app_service_env: []
app_mules: 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment