Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

50%
+0 −0
Q&A Run pipeline in the background from git hook

Use nohup(1), and redirect stdout and stderr to /dev/null The following works as expected, not having to wait until the PDF is generated. #!/bin/sh test "$1" = "refs/heads/main" || exit 0; ...

posted 6mo ago by alx‭  ·  edited 6mo ago by alx‭

Answer
#2: Post edited by user avatar alx‭ · 2023-11-26T09:53:04Z (6 months ago)
  • ### Use nohup(1), and redirect stdout and stderr to /dev/null
  • The following works as expected, not having to wait until the PDF is generated.
  • ```sh
  • #!/bin/sh
  • test "$1" = "refs/heads/main" || exit 0;
  • cd /srv/src/alx/linux/man-pages/man-pages/;
  • unset $(git rev-parse --local-env-vars);
  • git fetch srv >/dev/null;
  • git reset srv/main --hard >/dev/null;
  • nohup sh <<__EOF__ >/dev/null 2>&1 &
  • </dev/null \
  • scripts/LinuxManBook/build.sh 2>/dev/null \
  • | sponge /srv/www/share/dist/man-pages/git/HEAD/man-pages-HEAD.pdf;
  • __EOF__
  • ```
  • ### Use nohup(1), and redirect stdout and stderr to /dev/null
  • The following works as expected, not having to wait until the PDF is generated.
  • ```sh
  • #!/bin/sh
  • test "$1" = "refs/heads/main" || exit 0;
  • cd /srv/src/alx/linux/man-pages/man-pages/;
  • unset $(git rev-parse --local-env-vars);
  • git fetch srv >/dev/null;
  • git reset srv/main --hard >/dev/null;
  • nohup sh <<__EOF__ >/dev/null 2>&1 &
  • scripts/LinuxManBook/build.sh 2>/dev/null \
  • | sponge /srv/www/share/dist/man-pages/git/HEAD/man-pages-HEAD.pdf;
  • __EOF__
  • ```
#1: Initial revision by user avatar alx‭ · 2023-11-26T09:51:49Z (6 months ago)
### Use nohup(1), and redirect stdout and stderr to /dev/null

The following works as expected, not having to wait until the PDF is generated.

```sh
#!/bin/sh

test "$1" = "refs/heads/main" || exit 0;

cd /srv/src/alx/linux/man-pages/man-pages/;

unset $(git rev-parse --local-env-vars);
git fetch srv			>/dev/null;
git reset srv/main --hard	>/dev/null;

nohup sh <<__EOF__ >/dev/null 2>&1 &
	</dev/null \
	scripts/LinuxManBook/build.sh 2>/dev/null \
	| sponge /srv/www/share/dist/man-pages/git/HEAD/man-pages-HEAD.pdf;
__EOF__
```