Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Baur
cloudify3
Commits
9cdca8bf
Commit
9cdca8bf
authored
Jun 18, 2015
by
Daniel Baur
Browse files
Looks like the python scripts dont like this, so we use the shell....
parent
370be08e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
ghost-openstack/scripts/ghost/ghost.py
ghost-openstack/scripts/ghost/ghost.py
+1
-12
ghost-openstack/scripts/ghost/start-ubuntu.sh
ghost-openstack/scripts/ghost/start-ubuntu.sh
+12
-0
ghost-openstack/types/ghost.yaml
ghost-openstack/types/ghost.yaml
+1
-6
No files found.
ghost-openstack/scripts/ghost/ghost.py
View file @
9cdca8bf
...
...
@@ -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 unzip -uo /opt/ghost.zip -d /opt/ghost'
,
error_message
=
'Failed unzipping ghost'
)
writeConfig
(
subject
)
def
writeConfig
(
subject
=
None
):
...
...
@@ -66,17 +66,6 @@ def writeConfig(subject=None):
_run
(
'sudo mv {0} {1}'
.
format
(
temp_config
.
name
,
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
():
_run
(
'sudo killall node'
,
error_message
=
'Failed killing nodejs'
)
...
...
ghost-openstack/scripts/ghost/start-ubuntu.sh
0 → 100755
View file @
9cdca8bf
#!/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
ghost-openstack/types/ghost.yaml
View file @
9cdca8bf
...
...
@@ -52,12 +52,7 @@ node_types:
invocation
:
default
:
function
:
configure
start
:
implementation
:
scripts/ghost/ghost.py
inputs
:
invocation
:
default
:
function
:
start
start
:
scripts/ghost/start-ubuntu.sh
stop
:
implementation
:
scripts/ghost/ghost.py
inputs
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment