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
bb683838
Commit
bb683838
authored
Jun 17, 2015
by
Daniel Baur
Browse files
Moved access to postgre ip to start action of ghost
parent
05c9fa2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
ghost-openstack/scripts/ghost/ghost.py
ghost-openstack/scripts/ghost/ghost.py
+13
-4
ghost-openstack/types/ghost.yaml
ghost-openstack/types/ghost.yaml
+4
-4
No files found.
ghost-openstack/scripts/ghost/ghost.py
View file @
bb683838
...
...
@@ -30,8 +30,8 @@ CONFIG_PATH = '/opt/ghost/config.js'
TEMPLATE_RESOURCE_NAME
=
'resources/ghost/ghost.default.template'
def
configure
(
subject
=
None
):
subject
=
subject
or
ctx
def
install
(
):
ctx
.
logger
.
info
(
'Configuring ghost.'
)
...
...
@@ -39,6 +39,12 @@ 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'
)
def
writeConfig
(
subject
=
None
):
subject
=
subject
or
ctx
template
=
Template
(
ctx
.
get_resource
(
TEMPLATE_RESOURCE_NAME
))
ctx
.
logger
.
debug
(
'Building a dict object that will contain variables '
...
...
@@ -59,9 +65,12 @@ def configure(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
():
def
start
(
subject
=
None
):
writeConfig
(
subject
)
_run
(
'cd /opt/ghost/ && sudo npm install /opt/ghost/'
,
error_message
=
'Failed running npm install'
)
_run
(
'cd /opt/ghost/ && sudo npm start &'
,
error_message
=
'Failed running npm start'
)
...
...
ghost-openstack/types/ghost.yaml
View file @
bb683838
...
...
@@ -46,12 +46,12 @@ node_types:
derived_from
:
cloudify.nodes.ApplicationModule
interfaces
:
cloudify.interfaces.lifecycle
:
configure
:
install
:
implementation
:
scripts/ghost/ghost.py
inputs
:
invocation
:
default
:
function
:
configure
function
:
install
start
:
implementation
:
scripts/ghost/ghost.py
inputs
:
...
...
@@ -77,10 +77,10 @@ node_types:
relationships
:
###########################################################
# This relationship is responsible for setting the
mongo
# This relationship is responsible for setting the
postgre
# host ip on the source node as a runtime property.
#
# This will enable the source node to locate the
mongo
# This will enable the source node to locate the
postgre
# database.
###########################################################
...
...
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