19070: Still trying to fix test_with_arvbox
[arvados.git] / doc / _includes / _install_rails_command.liquid
1 {% comment %}
2 Copyright (C) The Arvados Authors. All rights reserved.
3
4 SPDX-License-Identifier: CC-BY-SA-3.0
5 {% endcomment %}
6
7 {% comment %}
8 This template recognizes four variables:
9 * railshost: The hostname included in the prompt, to let the user know where to run the command.  If this is the empty string, no hostname will be displayed.  Default "apiserver".
10 * railsdir: The directory included in the prompt, to let the user know where to run the command.  Default "/var/www/arvados-api/current".
11 * railscmd: The full command to run.  Default "bin/rails console".
12 * railsout: The expected output of the command, if any.
13 {% endcomment %} Change *@webserver-user@* to the user that runs your web server process.  If you install Phusion Passenger as we recommend, this is *@www-data@* on Debian-based systems, and *@nginx@* on Red Hat-based systems.
14
15 {% unless railshost %}
16   {% assign railshost = "apiserver" %}
17 {% endunless %}
18
19 {% unless (railshost == "") or (railshost contains ":") %}
20   {% capture railshost %}{{railshost}}:{% endcapture %}
21 {% endunless %}
22
23 {% unless railsdir %}
24   {% assign railsdir = "/var/www/arvados-api/current" %}
25 {% endunless %}
26
27 {% unless railscmd %}
28   {% assign railscmd = "bin/rails console" %}
29 {% endunless %}
30
31 <notextile>
32 <pre><code>{{railshost}}~$ <span class="userinput">cd {{railsdir}}</span>
33 {{railshost}}{{railsdir}}$ <span class="userinput">sudo -u <b>webserver-user</b> RAILS_ENV=production {{railscmd}}</span>
34 {% if railsout %}{{railsout}}
35 {% endif %}</code></pre>
36 </notextile>