Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.51.0 #1708

Merged
merged 54 commits into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2c94c42
nc-snapshot-auto.sh: Ad quotes to allow datadirectory paths with spaces
theCalcaholic Jan 8, 2023
a09ddbe
020nextcloud: Fix NC logfile path
theCalcaholic Jan 9, 2023
ba4bb1d
Add support for Nextcloud 25.0.2
theCalcaholic Jan 7, 2023
127c9bd
build-{docker,lxd}: Also run on PRs against release branches
theCalcaholic Jan 10, 2023
7420097
build-docker.yml: Only allow tags as previous version
theCalcaholic Jan 10, 2023
bc0abc6
ncp-diag, web-ui: Integrate new port check backend
victor-rays Jan 10, 2023
c23abe7
࿓❯ Added array declarations so mapfile works properly
victor-rays Jan 11, 2023
9afbf0b
Implement clear-php-opcache.sh
theCalcaholic Jan 12, 2023
04cf271
Clear php opcache on ncp update
theCalcaholic Jan 12, 2023
f763e79
build-docker.yml: Include nextcloud update in update test
theCalcaholic Jan 12, 2023
52f6454
build-SD-armbian.sh: Update to latest raspios version
theCalcaholic Jan 13, 2023
9e95cbb
build-{docker,sd-images}.yml: Improve CICD robustness and output
theCalcaholic Jan 13, 2023
b65bcff
࿓❯ Removed the extra forward slash in the config directory variable
victor-rays Jan 13, 2023
1934fd2
build-sd-images.yml: Fix permissions when accessing container logs
theCalcaholic Jan 14, 2023
3298b95
ncp-update-nc, 1.51.0.sh: Remove deprecated package php-json
theCalcaholic Jan 14, 2023
b631366
build-docker.yml: Improve detecting of successful container startup
theCalcaholic Jan 17, 2023
4f2d615
࿓❯ Update README
victor-rays Jan 14, 2023
1c5bc66
࿓❯ Updated the README
victor-rays Jan 16, 2023
2e6c8d5
࿓❯ Updated the README
victor-rays Jan 16, 2023
f80c3a6
࿓❯ Updated the README a little bit more
victor-rays Jan 16, 2023
09508fa
࿓❯ Added a badge for the devel branch tests
victor-rays Jan 16, 2023
b21a2cd
࿓❯ Fixed a typo I had missed
victor-rays Jan 16, 2023
a873d61
࿓❯ Added an example of running the install script with sudo
victor-rays Jan 16, 2023
b10868f
࿓❯ Fixed a comma (,) that should've been a period (.) and docker to D…
victor-rays Jan 17, 2023
ab67e98
build-sd-images.yml: Improve debug output for container status check
theCalcaholic Jan 18, 2023
92698aa
build-sd-images.yml: Increase number of retries when waiting for cont…
theCalcaholic Jan 18, 2023
f09ccf2
library.sh: Have notify_admin notify *all* admins, not just the first
theCalcaholic Jan 18, 2023
8a824db
ncp-update-nc: Ensure recovery directory exists before attempting res…
theCalcaholic Jan 18, 2023
7a9a2ea
build-sd-images.yml: Remove '-e' shell option for the test step
theCalcaholic Jan 18, 2023
07fd406
opcache.ini.sh: Ensure opcache temp dir exists
theCalcaholic Jan 18, 2023
87e3fc8
opcache.ini.sh: include potential fix for opcache jit segfaults
theCalcaholic Jan 18, 2023
bdf7c11
build-docker.yml: Allow 10 attempts for activation tests
theCalcaholic Jan 18, 2023
8cfc779
build-docker.yml: Increase attempts for container startup check
theCalcaholic Jan 18, 2023
6fad75e
build-sd-images.yml: Disable container shutdown on exit
theCalcaholic Jan 18, 2023
262e4b1
library.sh: Increase retries for setting up notify_push to 5
theCalcaholic Jan 18, 2023
56e1ff4
opcache.ini.sh: Increase interned_strings_buffer as recommended by NC
theCalcaholic Jan 18, 2023
41a7b6b
010lamp: clear opcache on container startup
theCalcaholic Jan 20, 2023
615b6f1
build-docker.yml: Disable update test for armhf
theCalcaholic Jan 20, 2023
624b560
release.yml: Disable 32bit armbian images
theCalcaholic Jan 20, 2023
30fe8c7
000ncp: Copy new config files to persistent config
theCalcaholic Jan 20, 2023
dea9d5d
ncp.cfg, nc-nextcloud.cfg: Update NC to 25.0.3
theCalcaholic Jan 20, 2023
d2ba649
release.yml: Disable broken image builds
theCalcaholic Jan 20, 2023
a5f777a
000ncp: Fix copying of new config files to persistent config
theCalcaholic Jan 20, 2023
f121aac
library.sh: Simplify clear_opcache
theCalcaholic Jan 20, 2023
b9acc8a
Dockerfile: Disable branch pinning as it has no effect during build
theCalcaholic Jan 20, 2023
d5fcc40
build-sd-images.yml: Fix aborted tests before retries are reached
theCalcaholic Jan 21, 2023
39c915d
library.sh: Simplify clear_opcache
theCalcaholic Jan 21, 2023
e8352bd
ncp-restore: Make sure to clear opcache before executing ncc commands
theCalcaholic Jan 21, 2023
cfc4d57
opcache.ini.sh: Disable opcache for cli
theCalcaholic Jan 21, 2023
07689a4
Revert "library.sh: Simplify clear_opcache"
theCalcaholic Jan 21, 2023
88ec3a8
library.sh: Fix opcache path
theCalcaholic Jan 21, 2023
362c828
Remove unnecessary clear_opcache calls, as opcache is now disabled fo…
theCalcaholic Jan 21, 2023
33af0ed
1.51.0.sh: Make sure, Changes to opcache.ini are in effect
theCalcaholic Jan 21, 2023
cdf99f6
Update changelog.md
theCalcaholic Jan 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 186 additions & 17 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
branches:
- master
- devel
- release/*

jobs:
build:
Expand Down Expand Up @@ -57,12 +58,17 @@ jobs:
./build/build-docker.sh "${ARCH?}"
docker tag "ownyourbits/nextcloudpi-${ARCH?}:latest" "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}"
testing_image="ownyourbits/nextcloudpi-${ARCH?}:latest"
[[ "${ARCH?}" == "arm64" ]] && testing_image="ownyourbits/ncp-qemu-fix-${ARCH?}:latest"
[[ "${ARCH?}" == "x86" ]] || testing_image="ownyourbits/ncp-qemu-fix-${ARCH?}:latest"
docker tag "${testing_image}" "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing"
docker push "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}"
docker push "thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing"

update-test:
# TODO: Fix update-test for armhf
# The issues are originating in a seemingly bug in apache2 that only occurs in the GH action and only
# if a docker volume or directory is mounted to /data.
# In this configuration, apache will serve the default placeholder page instead of the sites configured in ncp.
if: ${{ inputs.arch != 'armhf' }}
needs:
- build
runs-on: ubuntu-latest
Expand All @@ -87,16 +93,16 @@ jobs:
shell: bash
run: |
set -ex
if [[ -n "${{ github.base_ref }}" ]]
then
version="${{ github.base_ref }}"
elif [[ "${{ env.VERSION }}" == "refs/heads/devel" ]]
if [[ "${{ env.VERSION }}" == "refs/heads/devel" ]]
then
version="latest"
else
ref="${{ github.base_ref }}"
[[ -n "$ref" ]] || ref="${{ github.ref }}"
git checkout "$ref"
if [[ "${{ github.ref_type }}" != "tag" ]] || ! git describe --tags > /dev/null
then
git fetch -fu --tags origin ${{ env.VERSION }}:${{ env.VERSION }}
git fetch -fu --tags origin "${ref}:${ref}"
fi
version="$(git describe --tags || true)"
[[ "$version" =~ .*-.*-.* ]] || {
Expand Down Expand Up @@ -149,6 +155,44 @@ jobs:
- name: Setup Selenium
run: pip install selenium

- name: Wait for container startup
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &

attempt=0
stage=0
success=false
for attempt in {1..30}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$stage" == "0" ]] && docker logs nextcloudpi 2> /dev/null | grep '^Init done'
then
stage=1
elif [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready \
&& curl -k https://localhost:8443/activate/ > /dev/null
then
success=true
echo -e "${LOG_CICD} Startup successful"
break
fi

attempt=$((attempt + 1))
sleep 5
done

[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} Timeout reached."
exit 1
}

- name: Activate container
working-directory: ./tests
run: |
Expand All @@ -160,13 +204,13 @@ jobs:
[[ "${ARCH?}" == "x86" ]] || { sleep 60; cmd+=(--timeout 300); }

success=false
for attempt in {1..5}
for attempt in {1..10}
do
echo ":: Activation Tests (attempt $attempt/5) ::"
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/10) =="
"${cmd[@]}" |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} Activation test (attempt $attempt/5) failed!"
echo -e "${LOG_CICD} Activation test (attempt $attempt/10) failed!"
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
cat /proc/sys/fs/binfmt_misc/qemu-aarch64 |& awk "{ print \"${LOG_DIAG} (qemu-aarch64) \" \$0 }" || true
cat /proc/sys/fs/binfmt_misc/qemu-arm |& awk "{ print \"${LOG_DIAG} (qemu-arm) \" \$0 }" || true
Expand All @@ -187,7 +231,97 @@ jobs:
- name: Start new container
run: |
docker stop nextcloudpi
docker run -d -v ncdata:/data --rm -p 8443:443 -p 4443:4443 --name nextcloudpi thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing localhost
docker run -d -v ncdata:/data --rm -p 8443:443 -p 4443:4443 -e NOBACKUP=true --name nextcloudpi thecalcaholic/ncp-internal-${ARCH?}:${{ github.run_id }}-testing localhost
- name: Wait for container startup
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &

attempt=0
stage=0
for attempt in {1..200}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$stage" == "0" ]] && docker logs nextcloudpi 2> /dev/null | grep '^Init done' > /dev/null
then
stage=1
elif [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready \
&& curl -k https://localhost:8443/activate/
then
echo -e "${LOG_CICD} Startup successful"
break
elif [[ "$attempt" -ge 30 ]]
then
echo -e "${LOG_CICD} Timeout reached."
exit 1
fi

attempt=$((attempt + 1))
sleep 5
done

echo "Wait one more minute..."
sleep 60
- name: Update Nextcloud
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &

current_nc_version="$(docker exec nextcloudpi ncc status | grep "version:" | awk '{ print $3 }')"
latest_nc_version="$(docker exec nextcloudpi cat /usr/local/etc/ncp.cfg | jq -r '.nextcloud_version')"

if [[ "$current_nc_version" == "$latest_nc_version".* ]]
then
echo -e "${LOG_CICD} Nextcloud is up to date - skipping NC update test."
else
docker exec nextcloudpi bash -c "DBG=x ncp-update-nc ${latest_nc_version?}" |& awk "{ print \"${LOG_DCKR} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} Nextcloud Update failed"
echo -e "${LOG_CICD} Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }"
exit 1
}
fi
- name: Wait for update completion
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &

attempt=0
for attempt in {1..30}
do
echo -e "${LOG_CICD} Waiting for update completion (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready
then
echo -e "${LOG_CICD} Startup successful"
break
elif [[ "$attempt" -ge 30 ]]
then
echo -e "${LOG_CICD} Timeout reached."
exit 1
fi

attempt=$((attempt + 1))
sleep 5
done

- name: Integration Tests
working-directory: ./tests
run: |
Expand All @@ -202,7 +336,7 @@ jobs:
success=false
for attempt in {1..5}
do
echo ":: System Tests (attempt $attempt/5) ::"
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
python system_tests.py --no-ping --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test (attempt $attempt) failed!"
Expand All @@ -214,14 +348,16 @@ jobs:
done
[[ "$success" == "true" ]] || {
echo -e "${LOG_CICD} System test failed in all attempts!"
echo -e "${LOG_CICD} Creating error report..."
docker exec nextcloudpi bash /usr/local/bin/ncp-report > error-report.txt
exit 1
}
echo -e "${LOG_CICD} System test successful"

success=false
for attempt in {1..3}
do
echo ":: Nextcloud Tests (attempt $attempt/5) ::"
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
python nextcloud_tests.py --no-gui localhost 8443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
Expand Down Expand Up @@ -285,7 +421,40 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
- name: Wait for container startup
run: |
set -e
docker logs nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }"
echo -e "${LOG_DCKR} =========="
docker logs -f nextcloudpi |& awk "{ print \"${LOG_DCKR} \" \$0 }" &

attempt=0
stage=0
for attempt in {1..200}
do
echo -e "${LOG_CICD} Waiting for container startup (attempt $attempt/30)..."
redis_pw="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"password'")"
redis_socket="$(docker exec nextcloudpi bash -c ". /usr/local/etc/library.sh; get_nc_config_value 'redis\"][\"host'")"
if [[ "$stage" == "0" ]] && docker logs nextcloudpi 2> /dev/null | grep '^Init done' > /dev/null
then
stage=1
elif [[ "$(docker exec nextcloudpi ncc maintenance:mode)" =~ .*disabled.* ]] \
&& docker exec nextcloudpi ncc status \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" set redisready yes \
&& docker exec nextcloudpi redis-cli -s "$redis_socket" -a "$redis_pw" get redisready \
&& curl -k https://localhost:8443/activate/
then
echo -e "${LOG_CICD} Startup successful"
break
elif [[ "$attempt" -ge 30 ]]
then
echo -e "${LOG_CICD} Timeout reached."
exit 1
fi

attempt=$((attempt + 1))
sleep 5
done
- name: Integration Tests
working-directory: ./tests
run: |
Expand All @@ -297,13 +466,13 @@ jobs:
[[ "${ARCH?}" == "x86" ]] || { sleep 60; cmd+=(--timeout 300); }

success=false
for attempt in {1..5}
for attempt in {1..10}
do
echo ":: Activation Tests (attempt $attempt/5) ::"
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/10) =="
"${cmd[@]}" |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
echo -e "${LOG_CICD} Activation test (attempt $attempt/3) failed!"
echo -e "${LOG_CICD} Activation test (attempt $attempt/10) failed!"
docker exec nextcloudpi bash /usr/local/bin/ncp-diag |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
sleep 12
continue
Expand All @@ -320,7 +489,7 @@ jobs:
success=false
for attempt in {1..5}
do
echo ":: System Tests (attempt $attempt/5) ::"
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
python system_tests.py --no-ping --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
echo -e "${LOG_CICD} System test (attempt $attempt) failed!"
Expand All @@ -339,7 +508,7 @@ jobs:
success=false
for attempt in {1..5}
do
echo ":: Nextcloud Tests (attempt $attempt/5) ::"
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
python nextcloud_tests.py --no-gui localhost 8443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-lxd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ on:
- "**"
pull_request:
branches:
- "master"
- "devel"
- master
- devel
- release/*

jobs:
build-current:
Expand Down
Loading