Skip to content

Commit ac8b114

Browse files
authored
Bug fixes pr 1.x (#278)
* Fixing linting so CI can work. * More linting fixes. * Downgrading Ubuntu due to Docker issues with ce-dev and latest. * Making pipefail shell commands use /bin/bash. * Adding pipefail code to cachetool installer block. * Adding executable for drush install checker. * Fixing D7 ctools behaviour to match features handling. * Jinja2 template looking for settings.php using wrong path. * Fixing config_generate for Drupal. * Making host checking more robust. * Removing variable declaration that will break host check. * Allow us to use deploy_code with a completely custom build and do nothing.
1 parent fd7c17d commit ac8b114

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

docs/roles/sync/database_sync/database_sync-mysql.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Sync MySQL databases between environments.
66
---
77
mysql_sync:
88
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
910
databases:
1011
- source:
1112
# Name of the database to take a dump from.

roles/config_generate/config_generate-drupal7/tasks/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
src: "{{ item }}"
2020
dest: "{{ deploy_path }}/{{ webroot }}/sites/{{ site.folder }}/settings.php"
2121
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"
2323
- "{{ _ce_deploy_build_dir }}/{{ webroot }}/sites/{{ site.folder }}/{{ build_type }}.settings.php"
2424
- "settings.php.j2"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
# Nothing to do here.

roles/sync/database_sync/database_sync-mysql/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Sync MySQL databases between environments.
66
---
77
mysql_sync:
88
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
910
databases:
1011
- source:
1112
# Name of the database to take a dump from.

scripts/_common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ ansible_host_check(){
156156
if [ -n "$TARGET_DEPLOY_HOST" ]; then
157157
ANSIBLE_BIN=$(command -v ansible-playbook)
158158
ANSIBLE_CMD="$ANSIBLE_BIN $OWN_DIR/scripts/host-check.yml"
159-
if [ "$DRY_RUN" = "yes" ]; then
160-
ANSIBLE_CMD="$ANSIBLE_CMD --check"
161-
fi
162159
if [ "$VERBOSE" = "yes" ]; then
163160
ANSIBLE_CMD="$ANSIBLE_CMD -vvvv"
164161
fi
@@ -167,6 +164,9 @@ ansible_host_check(){
167164
fi
168165
$ANSIBLE_CMD --extra-vars "{_deploy_host: $TARGET_DEPLOY_HOST}" --extra-vars "$ANSIBLE_DEFAULT_EXTRA_VARS" --extra-vars "$ANSIBLE_EXTRA_VARS"
169166
return $?
167+
# No host to check provided, just return a clean exit code.
168+
else
169+
return 0
170170
fi
171171
}
172172

scripts/build.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ fi
9595
# Get Ansible defaults.
9696
get_ansible_defaults_vars
9797

98-
# Optionally carry out a host check.
98+
# Optionally carry out a host check if --host is provided.
9999
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
100106

101107
# From this point on, we want to trigger the "revert" if anything fails.
102108
ANSIBLE_BUILD_RESULT=1
@@ -113,5 +119,5 @@ if [ -n "$ANSIBLE_BUILD_RESULT" ] && [ "$ANSIBLE_BUILD_RESULT" = 0 ]; then
113119
exit 0
114120
fi
115121
# 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"
117123
exit 1

0 commit comments

Comments
 (0)