Skip to content

Commit

Permalink
1.53.1.sh: Make sure, notify_push service is updated
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Knöppler <[email protected]>
  • Loading branch information
theCalcaholic committed Jan 31, 2024
1 parent bd9d73c commit 548676f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/build-lxd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,32 @@ jobs:
ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
- name: Activate and Test LXD Image
working-directory: ./tests
run: |
lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
echo "Activation test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
echo "================"
echo "ncp.log: "
lxc exec ncp -- "tail -n20 /var/log/ncp.log"
exit 1
}
python system_tests.py --non-interactive || {
echo "System test failed!"
exit 1
}
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
echo "Nextcloud test failed!"
echo "Geckodriver logs:"
tail -n 20 geckodriver.log >&2 || true
echo "================"
echo "ncp.log: "
lxc exec ncp -- "tail -n20 /var/log/ncp.log"
exit 1
}
- name: Update ncp
run: |
Expand All @@ -230,6 +256,7 @@ jobs:
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
lxc exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
sleep 30
lxc exec ncp -- /usr/local/bin/ncc status
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
Expand All @@ -240,14 +267,12 @@ jobs:
fi
lxc stop ncp
lxc publish -q ncp -f --alias "ncp/updated"
- name: Relaunch container
run: |
set -x
lxc delete -q -f ncp || true
systemd-run --user --scope -p "Delegate=yes" lxc launch -q "ncp/updated" ncp
systemd-run --user --scope -p "Delegate=yes" lxc start ncp
lxc exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
sleep 30
sleep 60
ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
ip="${ip/% *}"
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
Expand All @@ -257,6 +282,8 @@ jobs:
lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
python system_tests.py --non-interactive || {
echo "System test failed!"
lxc exec ncp -- ncc status
lxc exec ncp -- ncc notify_push:self-test
exit 1
}
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/vm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ jobs:
echo "==========================================="
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /var/log/ncp.log;
echo "==========================================="
echo "notify_push diag:"
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" ncc status
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" ncc notify_push:self-test
exit 1
}
Expand Down
7 changes: 5 additions & 2 deletions updates/1.53.1.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env bash
set -e
set -ex

source /usr/local/etc/library.sh

install_template apache2/ncp.conf.sh /etc/apache2/sites-available/ncp.conf --defaults
a2dissite nextcloud
mv /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-available/001-nextcloud.conf
a2ensite 001-nextcloud
bash -c "sleep 2 && service apache2 reload" &>/dev/null &
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
systemctl daemon-reload
url="$(ncc config:system:get overwrite.cli.url)"
bash -c "sleep 2 && systemctl reload apache2 && systemctl restart notify_push && sleep 5 && ncc notify_push:setup '${url}/push'"

0 comments on commit 548676f

Please sign in to comment.