Commit 9cdca8bf authored by Daniel Baur's avatar Daniel Baur

Looks like the python scripts dont like this, so we use the shell....

parent 370be08e
...@@ -39,7 +39,7 @@ def configure(subject=None): ...@@ -39,7 +39,7 @@ def configure(subject=None):
_run('sudo curl -L https://ghost.org/zip/ghost-latest.zip -o /opt/ghost.zip',error_message='Failed downloading ghost') _run('sudo curl -L https://ghost.org/zip/ghost-latest.zip -o /opt/ghost.zip',error_message='Failed downloading ghost')
_run('sudo unzip -uo /opt/ghost.zip -d /opt/ghost',error_message='Failed unzipping ghost') _run('sudo unzip -uo /opt/ghost.zip -d /opt/ghost',error_message='Failed unzipping ghost')
writeConfig(subject)
def writeConfig(subject=None): def writeConfig(subject=None):
...@@ -66,17 +66,6 @@ def writeConfig(subject=None): ...@@ -66,17 +66,6 @@ def writeConfig(subject=None):
_run('sudo mv {0} {1}'.format(temp_config.name, CONFIG_PATH), _run('sudo mv {0} {1}'.format(temp_config.name, CONFIG_PATH),
error_message='Failed to write to {0}.'.format(CONFIG_PATH)) error_message='Failed to write to {0}.'.format(CONFIG_PATH))
def start(subject=None):
writeConfig(subject)
pwd = os.getcwd()
os.chdir('/opt/ghost')
_run('sudo /usr/bin/npm install',error_message='Failed running npm install')
_run('sudo nohup /usr/bin/npm start > /dev/null 2>&1 &',error_message='Failed running npm start')
os.chdir(pwd)
def stop(): def stop():
_run('sudo killall node',error_message='Failed killing nodejs') _run('sudo killall node',error_message='Failed killing nodejs')
......
#!/bin/bash -e
ctx logger info "Starting ghost"
ctx logger debug "${COMMAND}"
cwd=$(pwd)
cd /opt/ghost
sudo /usr/bin/npm install
sudo nohup /usr/bin/npm start > /dev/null 2>&1 &
cd $cwd
ctx logger info "Started ghost"
\ No newline at end of file
...@@ -52,12 +52,7 @@ node_types: ...@@ -52,12 +52,7 @@ node_types:
invocation: invocation:
default: default:
function: configure function: configure
start: start: scripts/ghost/start-ubuntu.sh
implementation: scripts/ghost/ghost.py
inputs:
invocation:
default:
function: start
stop: stop:
implementation: scripts/ghost/ghost.py implementation: scripts/ghost/ghost.py
inputs: inputs:
......
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