Skip to content

Commit e21a027

Browse files
committed
build-lxd.yml: Use older nextcloud version for upgrade test
Signed-off-by: Tobias Knöppler <[email protected]>
1 parent e5113f4 commit e21a027

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

.github/workflows/build-lxd.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ jobs:
348348
VERSION: "${{ inputs.git_ref || github.ref }}"
349349
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
350350
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
351-
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_arm64_v1.53.2.tar.gz"
352-
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_x86_v1.53.2.tar.gz"
351+
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.0/NextcloudPi_LXD_arm64_v1.53.0.tar.gz"
352+
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.0/NextCloudPi_LXD_x86_v1.53.0.tar.gz"
353353
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
354354
steps:
355355
- name: Setup incus
@@ -457,7 +457,11 @@ jobs:
457457
echo "Running update to ${VERSION}"
458458
459459
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
460-
latest_nc_version="27.0.1"
460+
latest_nc_version="27.1.6"
461+
462+
sudo "$LXC" exec ncp -- apt-get update ||:
463+
sudo "$LXC" exec ncp -- apt-get install --no-install-recommends -y gnupg2
464+
sudo "$LXC" exec ncp -- apt-key adv --fetch-keys https://packages.sury.org/php/apt.gpg
461465
462466
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
463467
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
@@ -529,14 +533,28 @@ jobs:
529533
then
530534
echo "Nextcloud is up to date - skipping NC update test."
531535
else
532-
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
533-
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
536+
537+
for i in {1..10};
538+
do
539+
echo "running nc update ($i/10)..."
540+
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
541+
542+
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
543+
current_nc_version_new="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
544+
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
545+
then
546+
break
547+
fi
548+
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
549+
then
550+
echo "failed to update to $latest_nc_version"
551+
exit 1
552+
fi
553+
current_nc_version="$current_nc_version_new"
554+
done
534555
fi
535556
536557
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
537-
538-
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
539-
540558
sudo "$LXC" stop ncp
541559
- name: Relaunch container
542560
run: |

bin/ncp-update-nc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ VER="$1"
2424
[[ "$VER" == "" ]] && { echo "Usage ${BIN} <version>"; exit 1; }
2525

2626
connect_to_nc_update() {
27-
tail -f "/var/log/ncp-update-nc.log" &
27+
tail -n 100 -f "/var/log/ncp-update-nc.log" &
2828
tail_pid=$!
2929
while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
3030
do

etc/library.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ function determine_nc_update_version() {
528528
#CURRENT="$(ncc status | grep "versionstring:" | awk '{ print $3 }')"
529529
current_maj="${current%%.*}"
530530
requested_maj="${requested%%.*}"
531+
supported_maj="${supported%%.*}"
531532

532533
# If valid version is requested -> direct update, don't consider anything else
533534
if [[ "$requested" =~ ^[0-9.]*$ ]] && [[ "$requested_maj" -le "$((current_maj + 1))" ]]

0 commit comments

Comments
 (0)