Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Drupal
drupalizer
Commits
8a5cf317
Commit
8a5cf317
authored
Mar 25, 2016
by
Ernesto Rodriguez Ortiz
Browse files
Run drush archive_dump in the docker container localhost may not have mysql installed.
parent
2370ba5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
docker.py
View file @
8a5cf317
...
...
@@ -141,17 +141,16 @@ def container_start(role='local'):
'-d -p {}:80'
.
format
(
env
.
bind_port
),
mounts
=
[(
env
.
workspace
,
env
.
docker_workspace
,
True
)]):
# If container was successful build, get the IP address and show it to the user.
global
CONTAINER_IP
CONTAINER_IP
=
h
.
fab_run
(
role
,
'docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" '
env
.
container_ip
=
h
.
fab_run
(
role
,
'docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" '
'{}_container'
.
format
(
env
.
project_name
),
capture
=
True
)
if
env
.
interactive_mode
:
h
.
fab_update_hosts
(
CONTAINER_IP
,
env
.
site_hostname
)
h
.
fab_update_hosts
(
env
.
container_ip
,
env
.
site_hostname
)
print
(
green
(
'Docker container {}_container was build successful. '
'To visit the Website open a web browser in http://{} or '
'http://localhost:{}.'
.
format
(
env
.
project_name
,
env
.
site_hostname
,
env
.
bind_port
)))
h
.
fab_update_container_ip
()
h
.
fab_update_container_ip
(
env
.
container_ip
)
else
:
print
(
red
(
'Docker image {}/drupal not found and is a requirement to run the {}_container.'
...
...
drush.py
View file @
8a5cf317
...
...
@@ -130,8 +130,8 @@ def site_install():
@
task
@
roles
(
'
l
oc
al
'
)
def
archive_dump
(
role
=
'
l
oc
al
'
):
@
roles
(
'
d
oc
ker
'
)
def
archive_dump
(
role
=
'
d
oc
ker
'
):
"""
Archive the platform for release or deployment.
:param role Default 'role' where to run the task
...
...
helpers.py
View file @
8a5cf317
...
...
@@ -123,13 +123,10 @@ def fab_remove_from_hosts(site_hostname):
local
(
'sudo sed -i "/{}/d" /etc/hosts'
.
format
(
site_hostname
))
def
fab_update_container_ip
():
container_ip
=
fab_run
(
'local'
,
'docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" '
'{}_container'
.
format
(
env
.
project_name
),
capture
=
True
)
env
.
container_ip
=
container_ip
def
fab_update_container_ip
(
container_ip
):
local
(
'sed -i "/env.container_ip/d" {}/local_vars.py'
.
format
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
local
(
'sed -i "/# Docker auto-added container IP/a env.container_ip =
\'
{}
\'
" {}/local_vars.py'
.
format
(
''
.
join
(
container_ip
),
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
local
(
'sed -i "/# Docker auto-added container IP/a env.container_ip =
\'
{}
\'
" '
'{}/local_vars.py'
.
format
(
''
.
join
(
container_ip
),
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
def
fab_update_hosts
(
ip
,
site_hostname
):
...
...
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