3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #151881 from max-wittig/gitlab-runner-14-6-0

gitlab-runner: 14.5.2 -> 14.6.0
This commit is contained in:
Jonas Chevalier 2021-12-23 14:20:07 +01:00 committed by GitHub
commit 8b3fbab072
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View file

@ -1,7 +1,7 @@
{ lib, buildGoPackage, fetchFromGitLab, fetchurl }:
let
version = "14.5.2";
version = "14.6.0";
in
buildGoPackage rec {
inherit version;
@ -19,7 +19,7 @@ buildGoPackage rec {
owner = "gitlab-org";
repo = "gitlab-runner";
rev = "v${version}";
sha256 = "07mr9w1rp3rnrlixmqziin1gw78s3gncg47b4z9h9zzpy3acy3xd";
sha256 = "1sgz8gri51i2pxnzzkcvwx5ncw1rjz7ain82hlcx6f3874qfsniy";
};
patches = [

View file

@ -1,28 +1,25 @@
diff --git a/shells/bash.go b/shells/bash.go
index 673f4765..a58cc5e2 100644
index bd99eca1a..9873dff6b 100644
--- a/shells/bash.go
+++ b/shells/bash.go
@@ -5,6 +5,7 @@ import (
@@ -3,6 +3,7 @@ package shells
import (
"bytes"
"fmt"
"io"
+ "os/exec"
"path"
"runtime"
"strconv"
@@ -225,7 +226,11 @@ func (b *BashShell) GetConfiguration(info common.ShellScriptInfo) (script *commo
@@ -300,7 +301,11 @@ func (b *BashShell) GetConfiguration(info common.ShellScriptInfo) (*common.Shell
if info.User != "" {
script.Command = "su"
if runtime.GOOS == "linux" {
- script.Arguments = append(script.Arguments, "-s", "/bin/"+b.Shell)
+ shellPath, err := exec.LookPath(b.Shell)
+ if err != nil {
+ shellPath = "/bin/"+b.Shell
+ shellPath = "/bin/" + b.Shell
+ }
+ script.Arguments = append(script.Arguments, "-s", shellPath)
}
script.Arguments = append(script.Arguments, info.User)
script.Arguments = append(script.Arguments, "-c", shellCommand)
--
2.18.0
script.Arguments = append(
script.Arguments,