Skip to content

Commit 47f79b7

Browse files
Merge pull request #1968 from nextcloud/devel
v1.55.0
2 parents f02a499 + d52b8dc commit 47f79b7

File tree

32 files changed

+727
-402
lines changed

32 files changed

+727
-402
lines changed

.github/actions/create-test-instance-bullseye/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
server_type:
1414
description: Server type to use for hetzner servers
1515
required: true
16-
default: "cx11"
16+
default: "cx22"
1717

1818
outputs:
1919
server_address:

.github/actions/create-test-instance/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
server_type:
1414
description: Server type to use for hetzner servers
1515
required: true
16-
default: "cx11"
16+
default: "cx22"
1717

1818
outputs:
1919
server_address:

.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_new" =~ "$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: 34 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,28 @@ jobs:
6464
# update-binfmts --display qemu-aarch64
6565
# update-binfmts --display qemu-arm
6666
- name: "Build Armbian"
67-
if: ${{ inputs.board_id != 'raspberrypi' }}
6867
id: build-armbian
6968
continue-on-error: true
7069
run: |
7170
set -ex
7271
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
7372
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
74-
73+
7574
./build/build-SD-armbian.sh "${{ inputs.board_id }}" "${{ inputs.board_name }}"
76-
75+
7776
artifacts=("armbian/output/images/Armbian"*.img)
7877
mkdir -p output
7978
mv "${artifacts[0]}" "output/$IMG"
8079
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
8180
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
8281
- name: "Build Armbian (2nd attempt)"
83-
if: ${{ inputs.board_id != 'raspberrypi' && steps.build-armbian.outcome == 'failure' }}
82+
if: ${{ steps.build-armbian.outcome == 'failure' }}
8483
id: build-armbian-2nd
8584
run: |
8685
set -ex
8786
echo -e "${LOG_CICD} Cleanup armbian build leftovers..."
8887
sudo rm -rf armbian/ tmp/ output/
89-
88+
9089
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
9190
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
9291
@@ -98,34 +97,11 @@ jobs:
9897
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
9998
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
10099
- name: "Upload Armbian logs"
101-
if: ${{ inputs.board_id != 'raspberrypi' && failure() }}
100+
if: ${{ failure() }}
102101
uses: actions/upload-artifact@v3
103102
with:
104103
name: ${{ github.run_id }}-${{ inputs.board_id }}-logs
105104
path: armbian/output
106-
- name: Build RPI SD Image
107-
if: ${{ inputs.board_id == 'raspberrypi' }}
108-
id: build-rpi
109-
run: |
110-
set -ex
111-
echo -e "${LOG_CICD} Protected? ${{ github.ref_protected }}"
112-
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
113-
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
114-
wget -q https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O ./qemu-aarch64-static
115-
./build/build-SD-rpi.sh
116-
mkdir -p output
117-
mv "tmp/$IMG" ./output/
118-
119-
for i in {1..10}
120-
do
121-
sudo losetup | grep "${IMG}" || break;
122-
[[ "$i" -lt 10 ]] || { echo -e "${LOG_CICD} Timeout while waiting for image to unmount"; exit 1; }
123-
sleep 6
124-
echo -e "${LOG_CICD} Retrying ($i out of 10)"
125-
done
126-
127-
echo "artifact_file=${IMG}" >> $GITHUB_OUTPUT
128-
echo "ARTIFACT_FILE=${IMG}" >> $GITHUB_ENV
129105
- name: upload image to artifact store
130106
uses: actions/upload-artifact@v3
131107
with:
@@ -135,7 +111,7 @@ jobs:
135111

136112
test:
137113
needs: build
138-
runs-on: ubuntu-20.04
114+
runs-on: ubuntu-22.04
139115
env:
140116
VERSION: "${{ inputs.git_ref }}"
141117
ARTIFACT_ID: ${{ needs.build.outputs.artifact_name }}
@@ -151,18 +127,9 @@ jobs:
151127
steps:
152128
- name: Set up QEMU
153129
uses: docker/setup-qemu-action@v3
154-
# - name: Set up QEMU
155-
# run: |
156-
# sudo apt-get update
157-
# sudo apt-get install -y binfmt-support
158-
# docker run --rm --privileged tonistiigi/binfmt:latest --install all
159-
# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes
160-
# sudo systemctl disable apparmor
161-
# sudo mkdir -p /etc/binfmt
162-
# for conf in qemu-{aarch64,arm}-static.conf
163-
# do
164-
# sed 's/:F$/:OC/' /usr/lib/binfmt.d/$conf | sudo tee /etc/binfmt/$conf
165-
# done
130+
- name: Disable apparmor
131+
run: |
132+
sudo systemctl disable apparmor
166133
- name: Checkout code
167134
uses: actions/checkout@v3
168135
with:
@@ -191,9 +158,9 @@ jobs:
191158
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
192159
echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf
193160
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
161+
sudo mkdir -p raspbian_root/etc/systemd/system/php8.3-fpm.service.d
162+
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf
163+
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf
197164
- name: Test image
198165
id: test
199166
run: |
@@ -208,13 +175,13 @@ jobs:
208175
sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
209176
sleep 60
210177
211-
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
178+
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
212179
213180
success=false
214181
for attempt in {1..30}
215182
do
216183
echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) =="
217-
ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
184+
ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')"
218185
[[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; }
219186
success=true
220187
break
@@ -249,12 +216,14 @@ jobs:
249216
done
250217
251218
[[ "$success" == "true" ]] || {
252-
echo -e "${LOG_CICD} Timeout reached."
253-
"${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }"
254-
"${CONTAINER_CMD[@]}" -q systemctl status redis |& awk "{ print \"${LOG_DIAG} \" \$0 }"
255-
"${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }"
256-
"${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }"
257-
"${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
219+
echo -e "${LOG_CICD} ERR: Timeout reached."
220+
"${CONTAINER_CMD[@]}" -q systemctl status mysql |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
221+
"${CONTAINER_CMD[@]}" -q systemctl status redis-server |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
222+
sudo journalctl --file ./raspbian_root/var/log/journal/"$(sudo cat ./raspbian_root/etc/machine-id)"/system.journal --no-pager -eu redis-server ||:
223+
"${CONTAINER_CMD[@]}" -q journalctl --no-pager -eu redis-server
224+
"${CONTAINER_CMD[@]}" -q systemctl status 'php*-fpm' |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
225+
"${CONTAINER_CMD[@]}" -q systemctl status apache2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
226+
"${CONTAINER_CMD[@]}" -q ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" ||:
258227
exit 1
259228
}
260229
@@ -310,15 +279,24 @@ jobs:
310279
python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
311280
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
312281
echo -e "${LOG_CICD} Nextcloud test failed!"
282+
echo -e "${LOG_DIAG} /etc/os-release:"
283+
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /etc/os-release'
284+
echo -e "${LOG_DIAG} /usr/local/etc/ncp.cfg:"
285+
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'cat /usr/local/etc/ncp.cfg'
286+
cat ./raspbian_root/usr/local/etc/ncp.cfg
287+
echo -e "${LOG_DIAG} /home/ncp-app-bridge config ncp"
288+
sudo ls -l ./raspbian_root/home/www/ncp-app-bridge.sh
289+
"${CONTAINER_CMD[@]}" --pipe --uid=33 ncp /bin/bash -c 'sudo /home/www/ncp-app-bridge.sh config ncp'
313290
echo -e "{$LOG_DIAG} Geckodriver logs:"
314291
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
315292
echo -e "${LOG_CICD} ================"
316293
echo -e "${LOG_DIAG} ncp.log: "
317-
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
294+
"${CONTAINER_CMD[@]}" --pipe ncp /bin/bash -c "tail -n20 /var/log/ncp.log" |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
318295
echo "================"
319296
echo "${LOG_DIAG} Nextcloud log: "
320-
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
321-
"${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
297+
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
298+
"${CONTAINER_CMD[@]}" --pipe -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
299+
sudo cat ./raspbian_root/opt/ncdata/data/nextcloud.log |& awk "{ print \"${LOG_DIAG} \" \$0 }"
322300
sleep 12
323301
continue
324302
}

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,22 @@ jobs:
136136
board_id: odroidc2
137137
board_name: OdroidC2
138138
secrets: inherit
139+
orangepi5:
140+
if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
141+
uses: ./.github/workflows/build-sd-images.yml
142+
with:
143+
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
144+
board_id: orangepi5
145+
board_name: OrangePi5
146+
secrets: inherit
147+
orangepi5plus:
148+
if: ${{ inputs.sd-images || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
149+
uses: ./.github/workflows/build-sd-images.yml
150+
with:
151+
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
152+
board_id: orangepi5-plus
153+
board_name: OrangePi5Plus
154+
secrets: inherit
139155

140156
lxd-x86-release:
141157
needs:
@@ -294,6 +310,30 @@ jobs:
294310
artifact_file: "${{ needs.odroidc2.outputs.artifact_file }}"
295311
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
296312
secrets: inherit
313+
orangepi5-release:
314+
needs:
315+
- orangepi5
316+
- github-release
317+
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
318+
uses: ./.github/workflows/publish-image.yml
319+
with:
320+
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
321+
artifact_id: "${{ needs.orangepi5.outputs.artifact_name }}"
322+
artifact_file: "${{ needs.orangepi5.outputs.artifact_file }}"
323+
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
324+
secrets: inherit
325+
orangepi5plus-release:
326+
needs:
327+
- orangepi5plus
328+
- github-release
329+
if: ${{ inputs.sd-images || github.event_name != 'workflow_dispatch' }}
330+
uses: ./.github/workflows/publish-image.yml
331+
with:
332+
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
333+
artifact_id: "${{ needs.orangepi5plus.outputs.artifact_name }}"
334+
artifact_file: "${{ needs.orangepi5plus.outputs.artifact_file }}"
335+
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
336+
secrets: inherit
297337

298338
github-release:
299339
if: ${{ github.event_name == 'workflow_dispatch' || !startsWith(github.ref_name, 'docker-') }}
@@ -324,6 +364,12 @@ jobs:
324364
env:
325365
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
326366
run: |
367+
368+
NC_VERSION="$(jq -r '.nextcloud_version' < etc/ncp.cfg)"
369+
PHP_VERSION="$(jq -r '.php_version' < etc/ncp.cfg)"
370+
DEBIAN_VERSION="$(jq -r '.release' < etc/ncp.cfg)"
371+
ARMBIAN_VERSIOn="$(cat build/armbian/armbian_version)"
372+
327373
subject="$(git tag -n10 --format="%(contents:subject)" "${{ env.VERSION }}")"
328374
body="$(git tag -n30 --format="%(contents:body)" "${{ env.VERSION }}")"
329375
separator="
@@ -334,6 +380,12 @@ jobs:
334380
335381
gh release create --draft -F - "${{ env.VERSION }}" <<EOF
336382
${subject:-No message found}
383+
384+
### Included Software
385+
Nextcloud ${NC_VERSION} (can be automatically updated to latest minor version)
386+
PHP ${PHP_VERSION}
387+
Debian ${DEBIAN_VERSION}
388+
Armbian ${ARMBIAN_VERSION}
337389
338390
${body:+${body}${separator}}
339391

0 commit comments

Comments
 (0)