Commit b2f3dc78 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Fix slapos environment discrepancy

Before this commit, running
  'slapos node software'
and
  'supervisorctl start slapos-node-software'
behaved differently because the PATH and other environment variables
where different in the interactive theia shell and in supervisord.
parent d4e33851
......@@ -15,7 +15,7 @@
[instance]
filename = instance.cfg.in
md5sum = e56a6722e4f0bc958f6b61f13174e852
md5sum = ab61eeb45300a91c0c4fb42bd5c52c9f
[yarn.lock]
filename = yarn.lock
......
......@@ -279,6 +279,23 @@ location = $${directory:frontend-static}/$${:filename}
filename = $${:_buildout_section_name_}
# Common Environment
# ------------------
[common-environment]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0777
template =
inline:
#!/bin/sh
. ${gowork:env.sh}
# reset PS1 from gowork
export PS1='$ '
export HOME=$${buildout:directory}
export PATH=${python-language-server:location}/bin:${java-jdk:location}/bin:${cli-utilities:PATH}:$HOME/.cargo/bin:$PATH
# Theia Backend
# -------------
......@@ -300,12 +317,13 @@ template =
export THEIA_OPEN_EDITOR_TOKEN=$(${openssl:location}/bin/openssl rand -hex 32)
export THEIA_URL=$${:base-url}
export THEIA_SHELL=$${theia-shell:rendered}
export HOME=$${buildout:directory}
export TMP=$${directory:tmp}
export TEMP=$TMP
export LC_ALL=C.UTF-8
export TERMINFO=${ncurses:location}/lib/terminfo/
export EDITOR="${python-language-server:location}/bin/python -m theia_open --wait"
export THEIA_DEFAULT_PLUGINS="local-dir:${theia-plugins:location}"
. $${common-environment:rendered}
exec ${theia-wrapper:rendered} $@
ip = $${theia-service-port:ip}
port = $${theia-service-port:port}
......@@ -392,7 +410,9 @@ rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template =
inline:#!/bin/sh
export PATH=${buildout:bin-directory}:$PATH
. $${common-environment:rendered}
export PATH=${nodejs:location}/bin/:$PATH
. $${slapos-standalone-activate:rendered}
exec ${slapos-standalone:script-path} \
$${directory:runner} \
$${slapos-standalone-config:ipv4} \
......
......@@ -299,7 +299,8 @@ install +=
[cli-utilities]
PATH = ${nodejs:location}/bin/:${bash:location}/bin/:${fish-shell:location}/bin/:${tig:location}/bin/:${vim:location}/bin/:${tmux:location}/bin/:${git:location}/bin/:${curl:location}/bin:${python2.7:location}/bin/:${buildout:bin-directory}
PATH = ${nodejs:location}/bin:${bash:location}/bin:${fish-shell:location}/bin:${tig:location}/bin:${vim:location}/bin:${tmux:location}/bin:${git:location}/bin:${curl:location}/bin:${python2.7:location}/bin:${buildout:bin-directory}
[theia-wrapper]
recipe = slapos.recipe.template:jinja2
......@@ -307,12 +308,7 @@ rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0777
template =
inline:
#!/bin/bash
. ${gowork:env.sh}
export PATH=${python-language-server:location}/bin/:${java-jdk:location}/bin/:${cli-utilities:PATH}:$HOME/.cargo/bin:$PATH
export THEIA_DEFAULT_PLUGINS="local-dir:${theia-plugins:location}"
# reset PS1 from gowork
export PS1='$ '
#!/bin/sh
cd ${theia:location}
exec ${yarn:location}/bin/yarn theia start $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment