Add option to allow files/directories in .gitignore
to be copied to container (#537)
* disable gitignore for actions * feat: Add option to allow/disallow paths specified in .gitignore Co-authored-by: Alan Birtles <alan.birtles@eu.sony.com>
This commit is contained in:
@@ -129,7 +129,7 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
||||
rc.stopJobContainer(),
|
||||
rc.JobContainer.Create(),
|
||||
rc.JobContainer.Start(false),
|
||||
rc.JobContainer.CopyDir(copyToPath, rc.Config.Workdir+string(filepath.Separator)+".").IfBool(copyWorkspace),
|
||||
rc.JobContainer.CopyDir(copyToPath, rc.Config.Workdir+string(filepath.Separator)+".", rc.Config.UseGitIgnore).IfBool(copyWorkspace),
|
||||
rc.JobContainer.Copy(filepath.Dir(rc.Config.Workdir), &container.FileEntry{
|
||||
Name: "workflow/event.json",
|
||||
Mode: 0644,
|
||||
|
@@ -33,6 +33,7 @@ type Config struct {
|
||||
Privileged bool // use privileged mode
|
||||
UsernsMode string // user namespace to use
|
||||
ContainerArchitecture string // Desired OS/architecture platform for running containers
|
||||
UseGitIgnore bool // controls if paths in .gitignore should not be copied into container, default true
|
||||
}
|
||||
|
||||
type runnerImpl struct {
|
||||
|
@@ -415,7 +415,7 @@ func (sc *StepContext) runAction(actionDir string, actionPath string) common.Exe
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = rc.JobContainer.CopyDir(containerActionDir+"/", actionDir)(ctx)
|
||||
err = rc.JobContainer.CopyDir(containerActionDir+"/", actionDir, rc.Config.UseGitIgnore)(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user