Renamed procs/jobs to steps in code (#1331)

Renamed `procs` to `steps` in code for the issue #1288

Co-authored-by: Harikesh Prajapati <harikesh.prajapati@druva.com>
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Harikesh00
2022-10-28 21:08:53 +05:30
committed by GitHub
parent b44e895017
commit 36e42914fa
109 changed files with 1474 additions and 1364 deletions

View File

@@ -84,33 +84,33 @@ func (e *ssh) Load() error {
}
// Setup the pipeline environment.
func (e *ssh) Setup(ctx context.Context, proc *types.Config) error {
func (e *ssh) Setup(ctx context.Context, config *types.Config) error {
return nil
}
// Exec the pipeline step.
func (e *ssh) Exec(ctx context.Context, proc *types.Step) error {
func (e *ssh) Exec(ctx context.Context, step *types.Step) error {
// Get environment variables
Command := []string{}
for a, b := range proc.Environment {
for a, b := range step.Environment {
if a != "HOME" && a != "SHELL" { // Don't override $HOME and $SHELL
Command = append(Command, a+"="+b)
}
}
if proc.Image == constant.DefaultCloneImage {
if step.Image == constant.DefaultCloneImage {
// Default clone step
Command = append(Command, "CI_WORKSPACE="+e.workingdir+"/"+proc.Environment["CI_REPO"])
Command = append(Command, "CI_WORKSPACE="+e.workingdir+"/"+step.Environment["CI_REPO"])
Command = append(Command, "plugin-git")
} else {
// Use "image name" as run command
Command = append(Command, proc.Image)
Command = append(Command, step.Image)
Command = append(Command, "-c")
// Decode script and delete initial lines
// Deleting the initial lines removes netrc support but adds compatibility for more shells like fish
Script, _ := base64.RawStdEncoding.DecodeString(proc.Environment["CI_SCRIPT"])
Command = append(Command, "cd "+e.workingdir+"/"+proc.Environment["CI_REPO"]+" && "+string(Script)[strings.Index(string(Script), "\n\n")+2:])
Script, _ := base64.RawStdEncoding.DecodeString(step.Environment["CI_SCRIPT"])
Command = append(Command, "cd "+e.workingdir+"/"+step.Environment["CI_REPO"]+" && "+string(Script)[strings.Index(string(Script), "\n\n")+2:])
}
// Prepare command