mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-15 19:42:06 +00:00
Allow to override location of action cache dir (#65)
Adds an explicit config option to specify the directory below which action contents will be cached. If left empty the previous location at `$XDG_CACHE_HOME/act` or `$HOME/.cache/act` will be used respectively. Required to resolve gitea/act_runner#235 Co-authored-by: Marius Zwicker <marius@mlba-team.de> Reviewed-on: https://gitea.com/gitea/act/pulls/65 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Marius Zwicker <emzeat@noreply.gitea.com> Co-committed-by: Marius Zwicker <emzeat@noreply.gitea.com>
This commit is contained in:
parent
b6b329d4b5
commit
23bd1ecde2
4 changed files with 7 additions and 0 deletions
|
@ -94,6 +94,7 @@ func Execute(ctx context.Context, version string) {
|
|||
rootCmd.PersistentFlags().StringVarP(&input.cacheServerPath, "cache-server-path", "", filepath.Join(CacheHomeDir, "actcache"), "Defines the path where the cache server stores caches.")
|
||||
rootCmd.PersistentFlags().StringVarP(&input.cacheServerAddr, "cache-server-addr", "", common.GetOutboundIP().String(), "Defines the address to which the cache server binds.")
|
||||
rootCmd.PersistentFlags().Uint16VarP(&input.cacheServerPort, "cache-server-port", "", 0, "Defines the port where the artifact server listens. 0 means a randomly available port.")
|
||||
rootCmd.PersistentFlags().StringVarP(&input.actionCachePath, "action-cache-path", "", filepath.Join(CacheHomeDir, "act"), "Defines the path where the actions get cached and host workspaces created.")
|
||||
rootCmd.SetArgs(args())
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
|
@ -580,6 +581,7 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
|
|||
ForceRebuild: input.forceRebuild,
|
||||
ReuseContainers: input.reuseContainers,
|
||||
Workdir: input.Workdir(),
|
||||
ActionCacheDir: input.actionCachePath,
|
||||
BindWorkdir: input.bindWorkdir,
|
||||
LogOutput: !input.noOutput,
|
||||
JSONLogger: input.jsonLogger,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue