Skip to content

Commit

Permalink
Merge pull request #182 from whywaita/feat/job-management-hooks
Browse files Browse the repository at this point in the history
Support job management hooks
  • Loading branch information
whywaita authored Nov 10, 2023
2 parents cce5387 + 3c17c82 commit c1a49c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/01_02_for_admin_tips.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Tips for myshoes admin

## Job management hooks for self-hosted runners

You can use job management hooks for self-hosted runners.
Please set script file to your runner image.

- `ACTIONS_RUNNER_HOOK_JOB_STARTED`: `/myshoes-actions-runner-hook-job-started.sh`
- `ACTIONS_RUNNER_HOOK_JOB_COMPLETED`: `/myshoes-actions-runner-hook-job-completed.sh`
12 changes: 12 additions & 0 deletions pkg/starter/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@ cat << 'EOF' > ./bin/RunnerService.js
{{.RunnerServiceJS}}
EOF
#---------------------------------------
# Configure run commands
#---------------------------------------
# Configure job management hooks if script files exist
if [ -e "/myshoes-actions-runner-hook-job-started.sh" ]; then
export ACTIONS_RUNNER_HOOK_JOB_STARTED="/myshoes-actions-runner-hook-job-started.sh"
fi
if [ -e "/myshoes-actions-runner-hook-job-completed.sh" ]; then
export ACTIONS_RUNNER_HOOK_JOB_COMPLETED="/myshoes-actions-runner-hook-job-completed.sh"
fi
#---------------------------------------
# run!
#---------------------------------------
Expand Down

0 comments on commit c1a49c2

Please sign in to comment.