From 291485f7b76bfce5ac0597d964af55bc388b26c7 Mon Sep 17 00:00:00 2001 From: supphakitd <67319010028@technictrang.ac.th> Date: Mon, 24 Nov 2025 15:34:03 +0700 Subject: [PATCH] Workflow: added execpipe/hostpipe from micro-service-api Signed-off-by: supphakitd <67319010028@technictrang.ac.th> --- .gitea/workflows/build-image.yml | 12 ++++++------ listen-pipe.sh | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 listen-pipe.sh diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index e2aa8a6..5fd07a7 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -31,10 +31,10 @@ jobs: set -e docker image rm -f accounting-frontend:latest docker build . -t accounting-frontend:latest - # restart compose - - name: Restart compose + Restart Docker Compose: + runs-on: host + steps: + - name: Restart compose project run: | - curl -X POST http://host.docker.internal:3000/run \ - -H "Content-Type: application/json" \ - -H "X-SECRET: ${{ secrets.EXPRESS_SECRET }}" \ - -d '{"command": "cd $HOME/frontend-development-kickstarter && ddd && ddud"}' \ No newline at end of file + echo '(cd frontend-development-kickstarter && ddd && ddd && ddud)' > /hostpipe + \ No newline at end of file diff --git a/listen-pipe.sh b/listen-pipe.sh new file mode 100644 index 0000000..cba1ee8 --- /dev/null +++ b/listen-pipe.sh @@ -0,0 +1,6 @@ +#!/bin/bash +trap "rm -f $HOME/execpipe" EXIT +trap "rm -f $HOME/execpipe" ERR + +mkfifo $HOME/execpipe +while true; do eval "$(cat $HOME/execpipe)"; done \ No newline at end of file