add exec command flag
This commit is contained in:
parent
35596a182b
commit
109ae5f2c1
1 changed files with 3 additions and 1 deletions
|
@ -57,6 +57,7 @@ type executeArgs struct {
|
|||
dryrun bool
|
||||
image string
|
||||
cacheHandler *artifactcache.Handler
|
||||
network string
|
||||
}
|
||||
|
||||
// WorkflowsPath returns path to workflow file(s)
|
||||
|
@ -385,7 +386,7 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||
// EventJSON: string(eventJSON),
|
||||
ContainerNamePrefix: fmt.Sprintf("GITEA-ACTIONS-TASK-%s", eventName),
|
||||
ContainerMaxLifetime: maxLifetime,
|
||||
ContainerNetworkMode: container.NetworkMode("bridge"),
|
||||
ContainerNetworkMode: container.NetworkMode(execArgs.network),
|
||||
DefaultActionInstance: execArgs.defaultActionsUrl,
|
||||
PlatformPicker: func(_ []string) string {
|
||||
return execArgs.image
|
||||
|
@ -464,6 +465,7 @@ func loadExecCmd(ctx context.Context) *cobra.Command {
|
|||
execCmd.PersistentFlags().BoolVarP(&execArg.debug, "debug", "d", false, "enable debug log")
|
||||
execCmd.PersistentFlags().BoolVarP(&execArg.dryrun, "dryrun", "n", false, "dryrun mode")
|
||||
execCmd.PersistentFlags().StringVarP(&execArg.image, "image", "i", "node:16-bullseye", "docker image to use")
|
||||
execCmd.PersistentFlags().StringVarP(&execArg.network, "network", "", "", "specify the network")
|
||||
|
||||
return execCmd
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue