mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 05:09:46 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user