Closed robertoandrade closed 8 years ago
Ok, I was able to workaround it like I mentioned in the description by appending ./
to the path of the script and had to add a folder to the ignore list that my script was modifying contents for. I guess this goes back to the known issue described in the README?
Additionally, is there a way to see the output of the shell script as it builds it instead of only after it's done executing? i.e.: one of my scripts executes: docker logs -f container
Ok, I was able to workaround it like I mentioned in the description by appending ./ to the path of the script and had to add a folder to the ignore list that my script was modifying contents for
This sounds like the endless loop caveat listed on the readme. If your script is modifying something in the path that snag
is watching then it will trigger a rebuild and loop.
When I try by appending ./ as a prefix to the script name it seems to work but no output of the script is shown and I end up getting an error after a bit:
|In Progress| bash -c ./build.sh|In Progress| bash -c ./build.sh |Failed | bash -c ./build.sh open /dev/null: too many open files
I've reproduced this a few times on OSX when using snag on a directly that has a large number of files. If you look at the known issues there's a link to bump up the number of files that your shell can have open to support projects with a lot of files.
Unfortunately, there is no way to see the progress of a command. We started off with an implementation that had streaming support but it ended up with some odd behavior at the time and decided to leave it on the back burner. @Tonkpils any thoughts on have a way to streaming command output?
Do you get the same error if you try and run a simple shell script like:
#!/bin/bash -ex
echo "Hello World
?
Stream support would actually be very useful, however I do remember the issues we ran into when attempting to re-start the build. The process itself would keep writing to stdout. It might e good to re-visit this and attempt to find a fix for it. As for the shell script, I'll look into what might be the issue unless you get to it first @zabawaba99
Let's move the discussion of stream support over to https://github.com/Tonkpils/snag/issues/41.
As far as the shell scripting, have at it. I won't be able to get to it for a while.
@robertoandrade So what this issues related more to not being able to see the output of the script while it's running?
I ran the binary against this project and got a successful build.
It looks like it only works if you have the shebangs shenanigans on the shell script, otherwise it throws out an error:
|Failed | ./deploy.sh
fork/exec ./deploy.sh: exec format error
I think I would consider more of a caveat than a bug itself. If you don't specify the shebang on a script then it would be the user's responsibility to make sure the file is being fed into the shell of choice.
script:
- bash deploy.sh
Let's go ahead and write a caveat section to mention these.
I'm having issues trying to execute shell scripts as a consequence of the build, it seems not to be able to find the scripts either if I execute them directly or via a shell:
or
don't work.
When I try by appending
./
as a prefix to the script name it seems to work but no output of the script is shown and I end up getting an error after a bit: