Skip to content

Commit 548676f

Browse files
committed
1.53.1.sh: Make sure, notify_push service is updated
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
1 parent bd9d73c commit 548676f

3 files changed

Lines changed: 39 additions & 6 deletions

File tree

.github/workflows/build-lxd.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,32 @@ jobs:
211211
ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
212212
ip="${ip/% *}"
213213
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
214+
- name: Activate and Test LXD Image
215+
working-directory: ./tests
216+
run: |
217+
lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
218+
python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
219+
echo "Activation test failed!"
220+
echo "Geckodriver logs:"
221+
tail -n 20 geckodriver.log >&2 || true
222+
echo "================"
223+
echo "ncp.log: "
224+
lxc exec ncp -- "tail -n20 /var/log/ncp.log"
225+
exit 1
226+
}
227+
python system_tests.py --non-interactive || {
228+
echo "System test failed!"
229+
exit 1
230+
}
231+
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
232+
echo "Nextcloud test failed!"
233+
echo "Geckodriver logs:"
234+
tail -n 20 geckodriver.log >&2 || true
235+
echo "================"
236+
echo "ncp.log: "
237+
lxc exec ncp -- "tail -n20 /var/log/ncp.log"
238+
exit 1
239+
}
214240
215241
- name: Update ncp
216242
run: |
@@ -230,6 +256,7 @@ jobs:
230256
latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
231257
232258
lxc exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
259+
sleep 30
233260
lxc exec ncp -- /usr/local/bin/ncc status
234261
235262
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
@@ -240,14 +267,12 @@ jobs:
240267
fi
241268
242269
lxc stop ncp
243-
lxc publish -q ncp -f --alias "ncp/updated"
244270
- name: Relaunch container
245271
run: |
246272
set -x
247-
lxc delete -q -f ncp || true
248-
systemd-run --user --scope -p "Delegate=yes" lxc launch -q "ncp/updated" ncp
273+
systemd-run --user --scope -p "Delegate=yes" lxc start ncp
249274
lxc exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
250-
sleep 30
275+
sleep 60
251276
ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
252277
ip="${ip/% *}"
253278
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
@@ -257,6 +282,8 @@ jobs:
257282
lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
258283
python system_tests.py --non-interactive || {
259284
echo "System test failed!"
285+
lxc exec ncp -- ncc status
286+
lxc exec ncp -- ncc notify_push:self-test
260287
exit 1
261288
}
262289
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {

.github/workflows/vm-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ jobs:
229229
echo "==========================================="
230230
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" tail /var/log/ncp.log;
231231
echo "==========================================="
232+
echo "notify_push diag:"
233+
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" ncc status
234+
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" ncc notify_push:self-test
232235
exit 1
233236
}
234237

updates/1.53.1.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/usr/bin/env bash
2-
set -e
2+
set -ex
33

44
source /usr/local/etc/library.sh
55

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

0 commit comments

Comments
 (0)