build-lxd.yml: Skip NC update test if NC is already up to date

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
thecalcaholic 2022-09-27 11:44:54 +02:00
parent b990f91bb6
commit 2032e570b5
No known key found for this signature in database
GPG Key ID: 3510056072886A8F

View File

@ -161,10 +161,20 @@ jobs:
fi
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
echo "Running update ${{ needs.build-previous.outputs.previous_version }} -> ${VERSION}"
current_nc_version="$(lxc exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
lxc exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
lxc exec ncp -- /usr/local/bin/ncc status
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
then
echo "Nextcloud is up to date - skipping NC update test."
else
lxc exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
fi
lxc stop ncp
- name: Pack LXD image
id: pack-lxd