1
0
Fork 0

Handle exit codes correctly

master
dump_stack() 2023-05-12 12:07:42 +00:00
parent e8554e7c4a
commit 593c152798
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 6 additions and 5 deletions

View File

@ -41,7 +41,7 @@ jobs:
ssh root@$IP git clone https://github.com/out-of-tree/out-of-tree
ssh root@$IP "cd out-of-tree && git checkout $GITHUB_SHA"
ssh root@$IP "echo -e '[Unit]\nDescription=Debian image generator and uploader\n[Service]\nStandardError=append:/var/log/images-debian.log\nStandardOutput=append:/var/log/images-debian.log\nType=oneshot' >> /etc/systemd/system/images-debian.service"
ssh root@$IP "echo -e '[Unit]\nDescription=Debian image generator and uploader\n[Service]\nRemainAfterExit=yes\nStandardError=append:/var/log/images-debian.log\nStandardOutput=append:/var/log/images-debian.log\nType=oneshot' >> /etc/systemd/system/images-debian.service"
ssh root@$IP "echo Environment=HOST=fra1.digitaloceanspaces.com >> /etc/systemd/system/images-debian.service"
ssh root@$IP "echo Environment=HOST_BUCKET=out-of-tree.fra1.digitaloceanspaces.com >> /etc/systemd/system/images-debian.service"
@ -58,14 +58,15 @@ jobs:
ssh root@$IP systemctl start images-debian --no-block
sleep 1h
while ssh root@$IP systemctl status images-debian; [[ $ret == 3 ]]; do
sleep 1m
while ! ssh root@$IP systemctl show images-debian -p SubState --value | grep -E '(failed|exited)'
do
sleep 1s
done
scp root@$IP:/var/log/images-debian.log .
ssh root@$IP systemctl is-active images-debian
- name: Archive logs
if: always()
uses: actions/upload-artifact@v3