diff options
author | Patrick Liu <patrick.liu@canonical.com> | 2021-03-08 14:07:19 +0800 |
---|---|---|
committer | Patrick Liu <patrick.liu@canonical.com> | 2021-03-08 14:07:19 +0800 |
commit | 3092808892615db9be6ef5f11fa08cd50fff77fc (patch) | |
tree | 4288721e5dc7ff07f44b01ed0f955a8b4db96034 | |
parent | 2244a6b600fe78709109f3ed4cc10410e5f7588a (diff) |
adopt template w/ lsb to make steps more dynamic
-rw-r--r-- | units/ubuntucore/jobs.pxu | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/units/ubuntucore/jobs.pxu b/units/ubuntucore/jobs.pxu index 27b3dee..8cae699 100644 --- a/units/ubuntucore/jobs.pxu +++ b/units/ubuntucore/jobs.pxu @@ -50,50 +50,66 @@ _verification: plugin: manual category_id: ubuntucore -id: ubuntucore/os-fail-boot +unit: template +template-resource: lsb +template-filter: lsb.distributor_id == 'Ubuntu Core' +template-engine: jinja2 +template-unit: job +id: ubuntucore/os-fail-boot-{{description}} _summary: Automatically rollback after failed boot after upgrade _purpose: Check system will rollback to original core snap if failed to boot the updated one _steps: - 1. Check the current revision of core<version> - $ snap list core<version> + {% if release == '16' -%} + {% set release = '' -%} + {% endif -%} + 1. Check the current revision of core{{release}} + $ snap list core{{release}} 2. Update to edge. Note that system will automatically reboot in 1 minute after doing this command. Please execute the command in step 3 in 1 minute to stop the automatic reboot. - $ sudo snap refresh core<version> --edge + $ sudo snap refresh core{{release}} --edge 3. Cancel the automatic shutdown $ sudo shutdown -c 4. Simulate a failed boot by the following command $ sudo sed -i 's/base_status=try/base_status=trying/' /var/lib/snapd/modeenv 5. Reboot the system and log in $ sudo reboot - 6. Check the revision of core<version> again - $ snap list core<version> + 6. Check the revision of core{{release}} again + $ snap list core{{release}} _verification: Check system is still booting the stable core version (original revision) plugin: manual category_id: ubuntucore estimated_duration: 500 -id: ubuntucore/os-fail-boot-with-refresh-control +unit: template +template-resource: lsb +template-filter: lsb.distributor_id == 'Ubuntu Core' +template-engine: jinja2 +template-unit: job +id: ubuntucore/os-fail-boot-with-refresh-control-{{description}} _summary: Automatically rollback after failed boot after upgrade _purpose: Check system will rollback to original core snap if failed to boot the updated one _steps: - 1. Check the current revision of core<version> - $ snap list core<version> - 2. Update to edge. + {% if release == '16' -%} + {% set release = '' -%} + {% endif -%} + 1. Check the current revision of core{{release}} + $ snap list core{{release}} + 2. Update to edge. Note that system will automatically reboot in 1 minute after doing this command. Please execute the command in step 3 in 1 minute to stop the automatic reboot. - $ sudo snap refresh core<version> --edge --ignore-validation + $ sudo snap refresh core{{release}} --edge --ignore-validation 3. Cancel the automatic shutdown $ sudo shutdown -c 4. Simulate a failed boot by the following command $ sudo sed -i 's/base_status=try/base_status=trying/' /var/lib/snapd/modeenv 5. Reboot the system and log in $ sudo reboot - 6. Check the revision of core<version> again - $ snap list core<version> + 6. Check the revision of core{{release}} again + $ snap list core{{release}} _verification: Check system is still booting the stable core version (original revision) plugin: manual |