Closed hxkenneth closed 1 year ago
I’ve noticed the same thing. My initial deployments all failed to run the post-deploy script, but subsequent releases with smaller changesets have been fine.
I haven’t tested it, but since this seems to be tied to output length perhaps a quieter rsync config would help (e.g. removing -i
).
That makes sense, I'll give it a go. Currently I have it configured to ignore many folders which contain rarely changed assets which is a pain as you can imagine when the files do end up changing.
Thanks for checking.
I've added a limit to RSYNC_STDOUT
which is passed to the script.
Not sure what limit to take, for now I've used 10000 chars. Let me know if it's still breaking.
I've just faced a similar issue. I've tested my SCRIPT_AFTER (manual copy paste of each command works), but it doesn't get executed despite the log showing the following:
✅ [DIR] /home/runner/work/***vue/***vue dir exist
[FILE] writing /home/runner/work/***vue/***vue/local_ssh_script-after-767d8910-4a9e-4eae-b221-65546015fca9.sh file ... 165
Executing remote script: ssh -i /home/runner/.ssh/deploy_key_***_1701055218186 ***@***
I was not taking advantage of rsync before and was deleting my target directory in SCRIPT_BEFORE, which resulted in a long rsync. Not deleting it (and thefore reducing rsync time/output) led to SCRIPT_AFTER being executed (the log continues after the above snippet and outputs the sdout of the script).
Any idea why this is happening and how to make this Action more robust?
It seems like the script-after shell script is created correctly but not running. I know it did not run because the script is supposed to take my app out of maintenance mode as well as update permissions on some dirs, all of which are not done.
This only happens sometimes, in particular when there are a large number of files to update through rsync.