Skip to content

Commit

Permalink
Moved migration script to docs/scripts for convenience.
Browse files Browse the repository at this point in the history
Updates proposal: debops/docs#160
  • Loading branch information
ypid committed Jul 14, 2016
1 parent f55f28e commit ebaac31
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
30 changes: 8 additions & 22 deletions UPGRADE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,14 @@ From v0.2.0 to unreleased

All inventory variables have been renamed so you might need to update your
inventory.
This oneliner can come in handy to do this:

.. code:: shell
git ls-files -z | xargs --null -I '{}' find '{}' -type f -print0 \
| xargs --null sed --in-place --regexp-extended '
s/owncloud__?run_occ_global_commands/owncloud__occ_cmd_list/g;
s/owncloud__?run_occ_group_commands/owncloud__group_occ_cmd_list/g;
s/owncloud__?run_occ_host_commands/owncloud__host_occ_cmd_list/g;
s/owncloud__?packages_recommended/owncloud__packages_recommended/g;
s/owncloud__?packages_optional/owncloud__optional_packages/g;
s/owncloud__?packages_group/owncloud__group_packages/g;
s/owncloud__?packages_host/owncloud__host_packages/g;
s/owncloud__?config_group/owncloud__group_config/g;
s/owncloud__?config_host/owncloud__host_config/g;
s/owncloud__?apps_config_group/owncloud__group_apps_config/g;
s/owncloud__?apps_config_host/owncloud__host_apps_config/g;
s/owncloud__?config_role_required/owncloud__role_config/g;
s/owncloud__?config_role_optional/owncloud__role_recommended_config/g;
s/owncloud__?ldap_enable([^d])/owncloud__ldap_enabled\1/g;
s/\<([^.]owncloud)_([^_])/\1__\2/g;
'
This script can come in handy to do this:

.. literalinclude:: scripts/upgrade-from-v0.2.X-to-v0.3.X
:language: shell

The script is bundled with this role under
:file:`docs/scripts/upgrade-from-v0.2.X-to-v0.3.X` and can be invoked from
their.

From v0.1.0 to v0.2.0
---------------------
Expand Down
22 changes: 22 additions & 0 deletions docs/scripts/upgrade-from-v0.2.X-to-v0.3.X
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
## Upgrade inventory variables for migration from debops.owncloud v0.2.X to v0.3.X.
## The script is idempotent.

git ls-files -z | xargs --null -I '{}' find '{}' -type f -print0 \
| xargs --null sed --in-place --regexp-extended '
s/owncloud__?run_occ_global_commands/owncloud__occ_cmd_list/g;
s/owncloud__?run_occ_group_commands/owncloud__group_occ_cmd_list/g;
s/owncloud__?run_occ_host_commands/owncloud__host_occ_cmd_list/g;
s/owncloud__?packages_recommended/owncloud__packages_recommended/g;
s/owncloud__?packages_optional/owncloud__optional_packages/g;
s/owncloud__?packages_group/owncloud__group_packages/g;
s/owncloud__?packages_host/owncloud__host_packages/g;
s/owncloud__?config_group/owncloud__group_config/g;
s/owncloud__?config_host/owncloud__host_config/g;
s/owncloud__?apps_config_group/owncloud__group_apps_config/g;
s/owncloud__?apps_config_host/owncloud__host_apps_config/g;
s/owncloud__?config_role_required/owncloud__role_config/g;
s/owncloud__?config_role_optional/owncloud__role_recommended_config/g;
s/owncloud__?ldap_enable([^d])/owncloud__ldap_enabled\1/g;
s/\<([^.]owncloud)_([^_])/\1__\2/g;
'

0 comments on commit ebaac31

Please sign in to comment.