When running ./occ upgrade
and the installation is already at the latest version, we get green output of Nextcloud is already latest version
which indicates that everything is OK.
However, as we develop Ansible roles for automatic deployment and upgrades, we also run this command at the end of the role and Ansible treats the above scenario as an error. Digging into the code, the reason for this is that the upgrade return with return self::ERROR_UP_TO_DATE;
when the instance is already the latest version. The value of the return code is 3 and everything above 0 (zero) is treated as an error.
Does it make sense to either also return ERROR_SUCCESS (=0) in this case or should there be another command line option for this? Something like --upgrade-if-necessary