mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-15 02:27:18 +00:00
Symlink webservice server.py to webide workdir
This commit is contained in:
parent
b897ec449c
commit
1f1a1149c6
@ -2,7 +2,7 @@ FROM eu.gcr.io/avatao-challengestore/tutorial-framework
|
|||||||
|
|
||||||
# Define variables to use later
|
# Define variables to use later
|
||||||
ENV TFW_SERVER_DIR="/srv/.tfw" \
|
ENV TFW_SERVER_DIR="/srv/.tfw" \
|
||||||
TFW_LOGIN_SERVICE_DIR="/srv/login_service" \
|
TFW_WEBSERVICE_DIR="/srv/login_service" \
|
||||||
TFW_IDE_WD="/home/${AVATAO_USER}/workdir" \
|
TFW_IDE_WD="/home/${AVATAO_USER}/workdir" \
|
||||||
TFW_TERMINADO_WD="/home/${AVATAO_USER}/workdir"
|
TFW_TERMINADO_WD="/home/${AVATAO_USER}/workdir"
|
||||||
|
|
||||||
@ -10,12 +10,12 @@ ENV TFW_SERVER_DIR="/srv/.tfw" \
|
|||||||
COPY solvable/src ${TFW_SERVER_DIR}/
|
COPY solvable/src ${TFW_SERVER_DIR}/
|
||||||
|
|
||||||
# Copy webservice to a dedicated directory
|
# Copy webservice to a dedicated directory
|
||||||
COPY solvable/src/webservice/ ${TFW_LOGIN_SERVICE_DIR}/
|
COPY solvable/src/webservice/ ${TFW_WEBSERVICE_DIR}/
|
||||||
ADD solvable/src/webservice/frontend-deps.tar ${TFW_LOGIN_SERVICE_DIR}/static
|
ADD solvable/src/webservice/frontend-deps.tar ${TFW_WEBSERVICE_DIR}/static
|
||||||
|
|
||||||
# Create IDE directory, add a file to it and give proper permissions to AVATAO_USER
|
# Create IDE directory, symlink server source and give proper permissions to AVATAO_USER
|
||||||
RUN mkdir -p ${TFW_IDE_WD} &&\
|
RUN mkdir -p ${TFW_IDE_WD} &&\
|
||||||
echo "This is a file in ${TFW_IDE_WD}" > ${TFW_IDE_WD}/text.txt &&\
|
ln -s ${TFW_WEBSERVICE_DIR}/server.py ${TFW_IDE_WD} &&\
|
||||||
chown -R ${AVATAO_USER}: ${TFW_IDE_WD} && chmod -R 755 ${TFW_IDE_WD}
|
chown -R ${AVATAO_USER}: ${TFW_IDE_WD} && chmod -R 755 ${TFW_IDE_WD}
|
||||||
|
|
||||||
# Hide TFW related code from user
|
# Hide TFW related code from user
|
||||||
|
@ -55,7 +55,7 @@ class TestCommands(TerminalCommands):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# pylint: disable=invalid-name
|
# pylint: disable=invalid-name
|
||||||
ide = IdeEventHandler(key='ide', allowed_directories=[TFWENV.IDE_WD],
|
ide = IdeEventHandler(key='ide', allowed_directories=[TFWENV.IDE_WD, TFWENV.WEBSERVICE_DIR],
|
||||||
directory=TFWENV.IDE_WD, exclude=['*.pyc'])
|
directory=TFWENV.IDE_WD, exclude=['*.pyc'])
|
||||||
terminado = TerminalEventHandler(key='shell', monitor=BashMonitor(TFWENV.HISTFILE))
|
terminado = TerminalEventHandler(key='shell', monitor=BashMonitor(TFWENV.HISTFILE))
|
||||||
terminado.historymonitor.subscribe_callback(cenator)
|
terminado.historymonitor.subscribe_callback(cenator)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[program:webservice]
|
[program:webservice]
|
||||||
directory=%(ENV_TFW_LOGIN_SERVICE_DIR)s
|
directory=%(ENV_TFW_WEBSERVICE_DIR)s
|
||||||
environment=BASEURL="/webservice"
|
environment=BASEURL="/webservice"
|
||||||
command=python3 server.py
|
command=python3 server.py
|
||||||
autostart=true
|
autostart=true
|
||||||
|
Loading…
Reference in New Issue
Block a user