File tree Expand file tree Collapse file tree 6 files changed +17
-6
lines changed
docs/roles/sync/database_sync
config_generate/config_generate-drupal7/tasks
deploy_code/deploy_code-custom/tasks
sync/database_sync/database_sync-mysql Expand file tree Collapse file tree 6 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Sync MySQL databases between environments.
6
6
---
7
7
mysql_sync :
8
8
mysqldump_params : " {{ _mysqldump_params }}" # set in _init but you can override here
9
+ cleanup : true # if false leaves tmp database dump on deploy server for debugging purposes
9
10
databases :
10
11
- source :
11
12
# Name of the database to take a dump from.
Original file line number Diff line number Diff line change 19
19
src : " {{ item }}"
20
20
dest : " {{ deploy_path }}/{{ webroot }}/sites/{{ site.folder }}/settings.php"
21
21
with_first_found :
22
- - " {{ playbook_dir }}/{{ webroot }}/sites/{{ site.folder }}/{{ build_type }}.settings.php.j2"
22
+ - " {{ playbook_dir }}/{{ site.folder }}/{{ build_type }}.settings.php.j2"
23
23
- " {{ _ce_deploy_build_dir }}/{{ webroot }}/sites/{{ site.folder }}/{{ build_type }}.settings.php"
24
24
- " settings.php.j2"
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ # Nothing to do here.
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Sync MySQL databases between environments.
6
6
---
7
7
mysql_sync :
8
8
mysqldump_params : " {{ _mysqldump_params }}" # set in _init but you can override here
9
+ cleanup : true # if false leaves tmp database dump on deploy server for debugging purposes
9
10
databases :
10
11
- source :
11
12
# Name of the database to take a dump from.
Original file line number Diff line number Diff line change @@ -156,9 +156,6 @@ ansible_host_check(){
156
156
if [ -n " $TARGET_DEPLOY_HOST " ]; then
157
157
ANSIBLE_BIN=$( command -v ansible-playbook)
158
158
ANSIBLE_CMD=" $ANSIBLE_BIN $OWN_DIR /scripts/host-check.yml"
159
- if [ " $DRY_RUN " = " yes" ]; then
160
- ANSIBLE_CMD=" $ANSIBLE_CMD --check"
161
- fi
162
159
if [ " $VERBOSE " = " yes" ]; then
163
160
ANSIBLE_CMD=" $ANSIBLE_CMD -vvvv"
164
161
fi
@@ -167,6 +164,9 @@ ansible_host_check(){
167
164
fi
168
165
$ANSIBLE_CMD --extra-vars " {_deploy_host: $TARGET_DEPLOY_HOST }" --extra-vars " $ANSIBLE_DEFAULT_EXTRA_VARS " --extra-vars " $ANSIBLE_EXTRA_VARS "
169
166
return $?
167
+ # No host to check provided, just return a clean exit code.
168
+ else
169
+ return 0
170
170
fi
171
171
}
172
172
Original file line number Diff line number Diff line change 95
95
# Get Ansible defaults.
96
96
get_ansible_defaults_vars
97
97
98
- # Optionally carry out a host check.
98
+ # Optionally carry out a host check if --host is provided .
99
99
ansible_host_check
100
+ ANSIBLE_HOST_CHECK_RESULT=$?
101
+ # Exit early if host not found.
102
+ if [ -n " $ANSIBLE_HOST_CHECK_RESULT " ] && [ " $ANSIBLE_HOST_CHECK_RESULT " != 0 ]; then
103
+ echo " ce-deploy failed to find the host. Aborting."
104
+ exit 1
105
+ fi
100
106
101
107
# From this point on, we want to trigger the "revert" if anything fails.
102
108
ANSIBLE_BUILD_RESULT=1
@@ -113,5 +119,5 @@ if [ -n "$ANSIBLE_BUILD_RESULT" ] && [ "$ANSIBLE_BUILD_RESULT" = 0 ]; then
113
119
exit 0
114
120
fi
115
121
# Failed somehow. Normally unreachable in strict mode.
116
- echo " Something went wrong. Please fill a bug report against ce-deploy. "
122
+ echo " Something went unexpectedly wrong with ce-deploy . Please file a bug report - https://github.com/codeenigma/ ce-deploy/issues/new "
117
123
exit 1
You can’t perform that action at this time.
0 commit comments