[Koha-devel] Atomicupdates for clunky forked Kohas

Kivilahti Olli-Antti olli-antti.kivilahti at jns.fi
Fri Sep 4 17:46:00 CEST 2015


Hi there!

I heard the community is moving to atomicupdates.
We moved to atomicupdates as well!

To help us better manage atomicupdates, I devised a installer to keep track of which atomicupdates have already been applied so we don't apply the same updates many times.
Also when we deploy/backport more and more feature, it becomes really hard to know which atomicupdates have been installed and which have not.

Check this Bug out if you are putting features in production before they get to master. There is also a nice slide show!
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14698

Here is the --help from atomicupdates.pl, it introduces itself quite nicely!

<<SNIP  atomicupdates.pl
Runs all the not-yet-applied atomicupdate-scripts and sql in the
atomicupdates-directory, in the order specified by the _updateorder-file.

This script uses koha.atomicupdates-table to see if the update has already been
applied.

Also acts as a gateway to CRUD the koha.atomicupdates-table.

    -v --verbose        Integer, 1 is not so verbose, 3 is maximally verbose.
    -h --help           Flag, This nice help!
    -a --apply          Flag, Apply all the pending atomicupdates from the
                        atomicupdates-directory.
    -d --directory      Path, From which directory to look for atomicupdate-scripts.
                        Defaults to '$KOHA_PATH/installer/data/mysql/atomicupdate/'
    -r --remove         String, Remove the upgrade entry from koha.atomicupdates
                        eg. --remove "Bug71337"
    -i --insert         Path, Add an upgrade log entry for the given atomicupdate-file.
                        Useful to revert an accidental --remove -operation or for
                        testing.
                        eg. -i installer/data/mysql/atomicupdate/Bug5453-Example.pl
    -l --list           Flag, List all entries in the koha.atomicupdates-table.
                        This typically means all applied atomicupdates.
    -p --pending        Flag, List all pending atomicupdates from the
                        atomicupdates-directory.
    -g --git            Path, Build the update order from the Git repository given,
                        or default to the Git repository in $KOHA_PATH.
                        Eg. --git 1, to build with default values, or
                            --git /tmp/kohaclone/ to look for another repository

EXAMPLES:

    atomicupdate.pl -g 1 -a

Looks for the Git repository in $KOHA_PATH, parses the issue/commit identifiers
from the top 10000 commits and generates the _updateorder-file to tell in which
order the atomicupdates-scripts are executed.
Then applies all pending atomicupdate-scripts in the order (oldest to newest)
presented in the Git repository.


    atomicupdate --apply -d /home/koha/kohaclone/installer/data/mysql/atomicupdate/

Applies all pending atomicupdate-scripts from the given directory. If the file
'_updateorder' is not present, it must be first generated, for example with the
--git 1 argument.

UPDATEORDER:

When deploying more than one atomicupdate, it is imperative to know in which order
the updates are applied. Atomicupdates can easily depend on each other and fail in
very strange and hard-to-debug -ways if the prerequisite modifications are not
in effect.
The correct update order is defined in the atomicupdates/_updateorder-file. This is
a simple list of issue/commit identifiers, eg.

    Bug5454
    Bug12432
    Bug3218
    #45

This file is most easily generated directly from the original Git repository, since
the order in which the Commits have been introduced most definetely is the order
they should be applied.
When deploying the atomicupdates to production environments without the
Git repository, the _updateorder file must be copied along the atomicupdate-scripts.

P.S. Remember to put atomicupdate/_updateorder to your .gitignore
SNAP>>

--

Olli-Antti Kivilahti
Järjestelmäkeittäjä
vaarakirjastot.fi
+358 50 449 7763
--Powered by Kubuntu Linux!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20150904/ca758d30/attachment-0001.html>


More information about the Koha-devel mailing list