fixed issue with windows using bash script

This commit is contained in:
Brad Rydzewski
2019-11-01 09:28:42 -07:00
parent fcfc72f508
commit 2e1fc1a142
6 changed files with 57 additions and 12 deletions

View File

@@ -310,7 +310,7 @@ func (c *Compiler) Compile(ctx context.Context, args Args) *engine.Spec {
dst.Envs = environ.Combine(envs, dst.Envs)
dst.Volumes = append(dst.Volumes, mount)
dst.Labels = labels
setupScript(src, dst, full)
setupScript(src, dst, os)
setupWorkdir(src, dst, full)
spec.Steps = append(spec.Steps, dst)

View File

@@ -28,8 +28,9 @@ func setupScript(src *resource.Step, dst *engine.Step, os string) {
// windows operating system.
func setupScriptWindows(src *resource.Step, dst *engine.Step) {
dst.Entrypoint = []string{"powershell", "-noprofile", "-noninteractive", "-command"}
dst.Command = []string{"echo $DRONE_SCRIPT | iex"}
dst.Command = []string{"echo $Env:DRONE_SCRIPT | iex"}
dst.Envs["DRONE_SCRIPT"] = powershell.Script(src.Commands)
dst.Envs["SHELL"] = "powershell.exe"
}
// helper function configures the pipeline script for the