feat: Add support for service on Windows, Linux, and macOS #430

Open
cachito-worker wants to merge 2 commits from cachito-worker/main into main
cachito-worker commented 2023-11-28 01:48:52 +00:00 (Migrated from gitea.com)

Summary

This pull request introduces support for running the act_runner daemon as a service on Windows, Linux, and macOS. It also includes the option to set a custom working directory using the --working-directory flag.

Changes Made

  • Added the capability to install and enable the daemon as a service with act_runner daemon install.
  • Implemented functionality to stop and uninstall the service using act_runner daemon uninstall.
  • Default working directory is set to the directory containing the act_runner executable.
  • The installation process checks for the presence of .runner and config.yaml files in the same directory and loads them into the service configuration.

Additional Information

Before running act_runner daemon install, it is crucial to register act_runner using the act_runner register command to generate the required .runner file.

$ ./act_runner daemon -h
Run as a runner daemon

Usage:
  act_runner daemon [flags]
  act_runner daemon [command]

Available Commands:
  install     Install the daemon
  uninstall   Uninstall the daemon

Flags:
  -h, --help   help for daemon

Global Flags:
  -c, --config string              Config file path
  -u, --user string                Specify user-name to run the daemon service as (default "ec_user")
  -d, --working-directory string   Specify custom root directory where all data are stored (default "/home/ec_user/Desktop/t/act_runner")

Use "act_runner daemon [command] --help" for more information about a command.
## Summary This pull request introduces support for running the `act_runner` daemon as a service on Windows, Linux, and macOS. It also includes the option to set a custom working directory using the `--working-directory` flag. ## Changes Made - Added the capability to install and enable the daemon as a service with `act_runner daemon install`. - Implemented functionality to stop and uninstall the service using `act_runner daemon uninstall`. - Default working directory is set to the directory containing the `act_runner` executable. - The installation process checks for the presence of `.runner` and `config.yaml` files in the same directory and loads them into the service configuration. ## Additional Information Before running `act_runner daemon install`, it is crucial to register `act_runner` using the `act_runner register` command to generate the required `.runner` file. ``` $ ./act_runner daemon -h Run as a runner daemon Usage: act_runner daemon [flags] act_runner daemon [command] Available Commands: install Install the daemon uninstall Uninstall the daemon Flags: -h, --help help for daemon Global Flags: -c, --config string Config file path -u, --user string Specify user-name to run the daemon service as (default "ec_user") -d, --working-directory string Specify custom root directory where all data are stored (default "/home/ec_user/Desktop/t/act_runner") Use "act_runner daemon [command] --help" for more information about a command. ```
allen.cai commented 2024-07-22 08:00:17 +00:00 (Migrated from gitea.com)

Has there been any progress?

Has there been any progress?
This pull request has changes conflicting with the target branch.
  • go.sum
  • internal/app/cmd/cmd.go
  • internal/app/cmd/daemon.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin cachito-worker/main:cachito-worker/main
git checkout cachito-worker/main
Sign in to join this conversation.