Skip to content

Commit 41a0af6

Browse files
Merge pull request #1961 from nextcloud/fix/nc-update-allow-custom-version-request
allow custom version request in ncp-update-nc && php 8.3 support
2 parents fc0b75b + 3b65ecf commit 41a0af6

File tree

24 files changed

+535
-331
lines changed

24 files changed

+535
-331
lines changed

.github/workflows/build-lxd.yml

Lines changed: 43 additions & 6 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
@@ -362,7 +362,7 @@ jobs:
362362
- name: Checkout code
363363
uses: actions/checkout@v3
364364
with:
365-
ref: "${{ env.VERSION }}"
365+
ref: "v1.54.3"
366366
- name: Setup Firefox
367367
continue-on-error: true
368368
id: setup-firefox-browser-action
@@ -422,7 +422,7 @@ jobs:
422422
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
423423
exit 1
424424
}
425-
python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
425+
python nextcloud_tests.py --skip-release-check --no-gui "nextcloudpi.local" 443 4443 || {
426426
echo "Nextcloud test failed!"
427427
echo "Geckodriver logs:"
428428
tail -n 20 geckodriver.log >&2 || true
@@ -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="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
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
@@ -467,6 +471,7 @@ jobs:
467471
echo "Nextcloud is up to date - skipping NC update test."
468472
else
469473
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
474+
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
470475
fi
471476
472477
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
@@ -506,6 +511,10 @@ jobs:
506511
echo "System test failed!"
507512
exit 1
508513
}
514+
- name: Checkout current version
515+
run: |
516+
git fetch origin
517+
git checkout "${{ env.VERSION }}"
509518
- name: NCP distupgrade
510519
id: distupgrade
511520
run: |
@@ -514,10 +523,38 @@ jobs:
514523
echo "can't upgrade from Debian $(sudo "$LXC" exec ncp -- cat /etc/os-release | grep VERSION_ID=)"
515524
exit 1
516525
}
526+
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
527+
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
528+
517529
sudo "$LXC" exec ncp -- bash -c "DEBIAN_FRONTEND=noninteractive ncp-dist-upgrade"
530+
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
518531
519-
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
532+
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
533+
then
534+
echo "Nextcloud is up to date - skipping NC update test."
535+
else
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
555+
fi
520556
557+
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
521558
sudo "$LXC" stop ncp
522559
- name: Relaunch container
523560
run: |

.github/workflows/build-sd-images.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ jobs:
191191
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
192192
echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
193193
194-
sudo mkdir -p raspbian_root/etc/systemd/system/php8.1-fpm.service.d
195-
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.1-fpm.service.d/ncp.conf
196-
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.1-fpm.service.d/ncp.conf
194+
sudo mkdir -p raspbian_root/etc/systemd/system/php8.2-fpm.service.d
195+
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.2-fpm.service.d/ncp.conf
196+
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.2-fpm.service.d/ncp.conf
197197
- name: Test image
198198
id: test
199199
run: |

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ jobs:
324324
env:
325325
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
326326
run: |
327+
328+
NC_VERSION="$(jq -r '.nextcloud_version' < etc/ncp.cfg)"
329+
PHP_VERSION="$(jq -r '.php_version' < etc/ncp.cfg)"
330+
DEBIAN_VERSION="$(jq -r '.release' < etc/ncp.cfg)"
331+
ARMBIAN_VERSIOn="$(cat build/armbian/armbian_version)"
332+
327333
subject="$(git tag -n10 --format="%(contents:subject)" "${{ env.VERSION }}")"
328334
body="$(git tag -n30 --format="%(contents:body)" "${{ env.VERSION }}")"
329335
separator="
@@ -334,6 +340,12 @@ jobs:
334340
335341
gh release create --draft -F - "${{ env.VERSION }}" <<EOF
336342
${subject:-No message found}
343+
344+
### Included Software
345+
Nextcloud ${NC_VERSION} (can be automatically updated to latest minor version)
346+
PHP ${PHP_VERSION}
347+
Debian ${DEBIAN_VERSION}
348+
Armbian ${ARMBIAN_VERSION}
337349
338350
${body:+${body}${separator}}
339351

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Please reach out in the [Matrix][chat-matrix-wiki] or [Telegram][chat-telegram-w
4343

4444
## Features
4545

46-
* Raspberry Pi OS/Debian 11 _(Bullseye)_
46+
* Raspberry Pi OS/Debian 12 _(Bookworm)_
4747
* Nextcloud
4848
* Apache, with HTTP2 enabled
4949
* PHP 8.1

bin/ncp-check-nc-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
source /usr/local/etc/library.sh # sets NCLATESTVER
88

99
CURRENT="$(nc_version)"
10-
NEXT_VERSION="$(determine_nc_upgrade_version "${CURRENT}" "${NCLATESTVER?}")"
10+
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
1111
[[ -n "$NEXT_VERSION" ]] || exit 0
1212

1313
NOTIFIED=/var/run/.nc-version-notified

0 commit comments

Comments
 (0)