mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-03 13:41:25 +00:00
Rework entrypoints (#3269)
Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> Co-authored-by: 6543 <m.huber@kithara.com>
This commit is contained in:
@@ -18,21 +18,19 @@ import (
|
||||
"encoding/base64"
|
||||
)
|
||||
|
||||
func GenerateContainerConf(commands []string, goos string) (env map[string]string, entry []string, cmd string) {
|
||||
func GenerateContainerConf(commands []string, goos string) (env map[string]string, entry []string) {
|
||||
env = make(map[string]string)
|
||||
if goos == "windows" {
|
||||
env["CI_SCRIPT"] = base64.StdEncoding.EncodeToString([]byte(generateScriptWindows(commands)))
|
||||
env["HOME"] = "c:\\root"
|
||||
env["SHELL"] = "powershell.exe"
|
||||
entry = []string{"powershell", "-noprofile", "-noninteractive", "-command"}
|
||||
cmd = "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Env:CI_SCRIPT)) | iex"
|
||||
entry = []string{"powershell", "-noprofile", "-noninteractive", "-command", "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Env:CI_SCRIPT)) | iex"}
|
||||
} else {
|
||||
env["CI_SCRIPT"] = base64.StdEncoding.EncodeToString([]byte(generateScriptPosix(commands)))
|
||||
env["HOME"] = "/root"
|
||||
env["SHELL"] = "/bin/sh"
|
||||
entry = []string{"/bin/sh", "-c"}
|
||||
cmd = "echo $CI_SCRIPT | base64 -d | /bin/sh -e"
|
||||
entry = []string{"/bin/sh", "-c", "echo $CI_SCRIPT | base64 -d | /bin/sh -e"}
|
||||
}
|
||||
|
||||
return env, entry, cmd
|
||||
return env, entry
|
||||
}
|
||||
|
Reference in New Issue
Block a user