1
0

Handle exit codes correctly

This commit is contained in:
dump_stack() 2023-05-12 12:07:42 +00:00
parent e8554e7c4a
commit 593c152798
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -41,7 +41,7 @@ jobs:
ssh root@$IP git clone https://github.com/out-of-tree/out-of-tree 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 "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=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" 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 ssh root@$IP systemctl start images-debian --no-block
sleep 1h while ! ssh root@$IP systemctl show images-debian -p SubState --value | grep -E '(failed|exited)'
do
while ssh root@$IP systemctl status images-debian; [[ $ret == 3 ]]; do sleep 1s
sleep 1m
done done
scp root@$IP:/var/log/images-debian.log . scp root@$IP:/var/log/images-debian.log .
ssh root@$IP systemctl is-active images-debian
- name: Archive logs - name: Archive logs
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3