mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
feat!: remove support for using an artifact server via CLI (#740)
The exec --artifact-server-* options are removed. It is required to run a workflow from within a Forgejo server to upload and download artifacts. It is assumed to be rarely (if at all) used and supporting it in any meaningful way would require a duplication of effort. Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/740 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
996609293e
commit
e27d70f254
2 changed files with 5 additions and 34 deletions
|
@ -1,5 +1,9 @@
|
|||
# Release Notes
|
||||
|
||||
## 9.0.0 (not yet published)
|
||||
|
||||
* Breaking change: forgejo-runner exec --artifact-server-* options are deprecated.
|
||||
|
||||
## 8.0.1
|
||||
|
||||
* [tolerate strings for fail-fast, max-parallel, timeout-minutes, cancel-timeout-minutes](https://code.forgejo.org/forgejo/act/pulls/203).
|
||||
|
|
|
@ -7,7 +7,6 @@ package cmd
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -17,7 +16,6 @@ import (
|
|||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/nektos/act/pkg/artifactcache"
|
||||
"github.com/nektos/act/pkg/artifacts"
|
||||
"github.com/nektos/act/pkg/common"
|
||||
"github.com/nektos/act/pkg/model"
|
||||
"github.com/nektos/act/pkg/runner"
|
||||
|
@ -51,9 +49,6 @@ type executeArgs struct {
|
|||
containerCapAdd []string
|
||||
containerCapDrop []string
|
||||
containerOptions string
|
||||
artifactServerPath string
|
||||
artifactServerAddr net.IP
|
||||
artifactServerPort uint16
|
||||
noSkipCheckout bool
|
||||
debug bool
|
||||
dryrun bool
|
||||
|
@ -377,20 +372,6 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||
log.Infof("cache handler listens on: %v", handler.ExternalURL())
|
||||
execArgs.cacheHandler = handler
|
||||
|
||||
if execArgs.artifactServerAddr == nil {
|
||||
return fmt.Errorf("unable to determine outbound IP address")
|
||||
}
|
||||
|
||||
if len(execArgs.artifactServerPath) == 0 {
|
||||
tempDir, err := os.MkdirTemp("", "forgejo-runner-")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
defer os.RemoveAll(tempDir)
|
||||
|
||||
execArgs.artifactServerPath = tempDir
|
||||
}
|
||||
|
||||
// run the plan
|
||||
config := &runner.Config{
|
||||
Workdir: execArgs.Workdir(),
|
||||
|
@ -414,9 +395,6 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||
ContainerCapDrop: execArgs.containerCapDrop,
|
||||
ContainerOptions: execArgs.containerOptions,
|
||||
AutoRemove: true,
|
||||
ArtifactServerPath: execArgs.artifactServerPath,
|
||||
ArtifactServerAddr: execArgs.artifactServerAddr.String(),
|
||||
ArtifactServerPort: strconv.FormatUint(uint64(execArgs.artifactServerPort), 10),
|
||||
NoSkipCheckout: execArgs.noSkipCheckout,
|
||||
// PresetGitHubContext: preset,
|
||||
// EventJSON: string(eventJSON),
|
||||
|
@ -451,16 +429,8 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||
return err
|
||||
}
|
||||
|
||||
artifactCancel := artifacts.Serve(ctx, config.ArtifactServerPath, config.ArtifactServerAddr, config.ArtifactServerPort)
|
||||
log.Debugf("artifacts server started at http://%s",
|
||||
net.JoinHostPort(config.ArtifactServerAddr, config.ArtifactServerPort),
|
||||
)
|
||||
|
||||
ctx = common.WithDryrun(ctx, execArgs.dryrun)
|
||||
executor := r.NewPlanExecutor(plan).Finally(func(ctx context.Context) error {
|
||||
artifactCancel()
|
||||
return nil
|
||||
})
|
||||
executor := r.NewPlanExecutor(plan)
|
||||
|
||||
return executor(ctx)
|
||||
}
|
||||
|
@ -499,9 +469,6 @@ func loadExecCmd(ctx context.Context) *cobra.Command {
|
|||
execCmd.Flags().StringArrayVarP(&execArg.containerCapAdd, "container-cap-add", "", []string{}, "kernel capabilities to add to the workflow containers (e.g. --container-cap-add SYS_PTRACE)")
|
||||
execCmd.Flags().StringArrayVarP(&execArg.containerCapDrop, "container-cap-drop", "", []string{}, "kernel capabilities to remove from the workflow containers (e.g. --container-cap-drop SYS_PTRACE)")
|
||||
execCmd.Flags().StringVarP(&execArg.containerOptions, "container-opts", "", "", "container options")
|
||||
execCmd.PersistentFlags().StringVarP(&execArg.artifactServerPath, "artifact-server-path", "", ".", "Defines the path where the artifact server stores uploads and retrieves downloads from. If not specified the artifact server will not start.")
|
||||
execCmd.PersistentFlags().IPVarP(&execArg.artifactServerAddr, "artifact-server-addr", "", common.GetOutboundIP(), "Defines the address where the artifact server listens")
|
||||
execCmd.PersistentFlags().Uint16VarP(&execArg.artifactServerPort, "artifact-server-port", "", 34567, "Defines the port where the artifact server listens (will only bind to localhost).")
|
||||
execCmd.PersistentFlags().StringVarP(&execArg.defaultActionsURL, "default-actions-url", "", "https://code.forgejo.org", "Defines the default base url of the action.")
|
||||
execCmd.PersistentFlags().BoolVarP(&execArg.noSkipCheckout, "no-skip-checkout", "", false, "Do not skip actions/checkout")
|
||||
execCmd.PersistentFlags().BoolVarP(&execArg.debug, "debug", "d", false, "enable debug log")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue