diff options
author | Micah Anderson <micah@riseup.net> | 2017-11-07 11:54:19 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2017-11-09 10:31:13 -0500 |
commit | a0eea43cbb93665d9d1ac96765d1abdf2a665d15 (patch) | |
tree | e04fb8eaf58b782b0a40e3aadebac55436ec4057 /tests/platform-ci/ci-build.sh | |
parent | 57faf66d7b82cc1ce67cf2e39ba7293c5a9d4bfa (diff) |
CI: do soledad migration during upgrade test
Updating platfrom 0.9 (soledad 0.8.0) to 0.10 (soledad 0.10.3) requires a
soledad-server migration. This integrates the migration in the CI
upgrade_test. Fixes #8881
Diffstat (limited to 'tests/platform-ci/ci-build.sh')
-rwxr-xr-x | tests/platform-ci/ci-build.sh | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/tests/platform-ci/ci-build.sh b/tests/platform-ci/ci-build.sh index 843642a4..4c9a516c 100755 --- a/tests/platform-ci/ci-build.sh +++ b/tests/platform-ci/ci-build.sh @@ -191,8 +191,32 @@ run() { test } +soledad_migration() { + # check the version of soledad installed + # if the version is not greater than 0.9, we need to do the migration + if ! LEAP_CMD run "dpkg --compare-versions \$(dpkg -l |grep soledad-server|grep ^ii|awk '{ print \$3}') gt 0.9" vm |grep -q oops + then + echo "Need to migrate from soledad 0.9!" + if ! LEAP_CMD run 'systemctl stop leap-mx' vm + then fail + fi + if ! LEAP_CMD run 'systemctl stop soledad-server' vm + then fail + fi + if ! LEAP_CMD run --stream '/usr/share/soledad-server/migration/0.9/migrate.py --verbose --log-file /var/log/leap/soledad_migration.log --do-migrate' vm + then fail + fi + if ! LEAP_CMD run 'systemctl start leap-mx' vm + then fail + fi + if ! LEAP_CMD run 'systemctl start soledad-server' vm + then fail + fi + fi +} + upgrade_test() { - # Checkout stable branch containing last release + # Checkout stable branch containing previous stable release # and deploy this cd "$PLATFORMDIR" # due to cache, this remote is sometimes already added @@ -208,7 +232,7 @@ upgrade_test() { /usr/local/bin/bundle install cd "$PROVIDERDIR" - + LEAP_CMD --version build_from_scratch 'couchdb,soledad,mx,webapp,tor,monitor' deploy test @@ -225,12 +249,17 @@ upgrade_test() { /usr/local/bin/bundle install cd "$PROVIDERDIR" - + LEAP_CMD --version + # due to the 'tor' service no longer being valid in 0.10, we need to change # that service to 'tor_relay'. This is done by changing the services array # with jq to be set to the full correct list of services jq '.services = ["couchdb","soledad","mx","webapp","tor_relay","monitor"]' < nodes/${NAME}.json deploy + + # check for soledad migration, and run it if necessary + soledad_migration + test cleanup |