From da6f5e3b77529ad4bc4c2e8ca40792ac8a7af9f9 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Mon, 22 May 2017 23:26:15 +0200 Subject: [PATCH 1/4] gitlab-runner: add patch for shell from v1 to latest version --- .../tools/continuous-integration/gitlab-runner/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix index d7f13de1d26b..b27ec45ec80a 100644 --- a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix +++ b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix @@ -32,6 +32,8 @@ buildGoPackage rec { sha256 = "0n8hcj2b1pb95x4bd7fb9ri43vgc4h2dj2v3iiziw2imqjyphfx4"; }; + patches = [ ./v1-fix-shell-path.patch ]; + buildInputs = [ go-bindata ]; preBuild = '' From aea157a1ec0f77186a39645522c02c616d48543c Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Mon, 22 May 2017 23:26:39 +0200 Subject: [PATCH 2/4] gitlab-runner_1_11: 1.11.2 -> 1.11.4 --- .../tools/continuous-integration/gitlab-runner/v1.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix index e0c3854740ab..1ef0d41f3640 100644 --- a/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix +++ b/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix @@ -1,16 +1,16 @@ { lib, buildGoPackage, fetchFromGitLab, fetchurl, go-bindata }: let - version = "1.11.2"; + version = "1.11.4"; # Gitlab runner embeds some docker images these are prebuilt for arm and x86_64 docker_x86_64 = fetchurl { url = "https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-x86_64.tar.xz"; - sha256 = "08lacd2p7915y7yjnwkj2k0b0x4qj9kc53p7qgvmq8kdi31xnh4z"; + sha256 = "1ijkzn8jkzx1dzxhkf17987ligyf758xzas6ysix5b781jnkdm8z"; }; docker_arm = fetchurl { url = "https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-arm.tar.xz"; - sha256 = "0lzvx3jfy8493q8zkbs7kgm5a3jgsi3f2x25jwg4lx7agcwwsygw"; + sha256 = "0sq2nndnkzqv2yjljg08xwa3ppddn6vqcivhfh43zwwmansvb9ha"; }; in buildGoPackage rec { @@ -29,7 +29,7 @@ buildGoPackage rec { owner = "gitlab-org"; repo = "gitlab-ci-multi-runner"; rev = "v${version}"; - sha256 = "1sjvlb5981ykc8hr4kp1ibh9jw2wdjjp9zs2nqs9lpsav4nda5fr"; + sha256 = "1pm88546cijmrrcvvrajp2g6rsrzxhy83cwwwky8jjkl5w4hhmz4"; }; patches = [ ./v1-fix-shell-path.patch ]; From 86e714095c4446466fafa47f1a546d0da4410530 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Mon, 22 May 2017 23:26:53 +0200 Subject: [PATCH 3/4] gitlab-runner: 9.1.0 -> 9.2.0 --- .../continuous-integration/gitlab-runner/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix index b27ec45ec80a..5b2ddf1f1028 100644 --- a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix +++ b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix @@ -1,16 +1,16 @@ { lib, buildGoPackage, fetchFromGitLab, fetchurl, go-bindata }: let - version = "9.1.0"; + version = "9.2.0"; # Gitlab runner embeds some docker images these are prebuilt for arm and x86_64 docker_x86_64 = fetchurl { url = "https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-x86_64.tar.xz"; - sha256 = "1mdcw755fygnf30v0gr13mx20zjqmxg5w2kj3k2jgcsh3gyrvymr"; + sha256 = "0x6pwh3wjq2czvzb8rl8npa8a58snwf1f9dwr6rbbxijaf886jfc"; }; docker_arm = fetchurl { url = "https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-arm.tar.xz"; - sha256 = "1m5p6mlhy3xf0chrjlfpdyp24pv32b61s8iryh6a617i91vpzjg6"; + sha256 = "1y6i5dn1l1qlwyg95qw4sff2y9zypxwmvsw4mb0555vf157h88kg"; }; in buildGoPackage rec { @@ -29,7 +29,7 @@ buildGoPackage rec { owner = "gitlab-org"; repo = "gitlab-ci-multi-runner"; rev = "v${version}"; - sha256 = "0n8hcj2b1pb95x4bd7fb9ri43vgc4h2dj2v3iiziw2imqjyphfx4"; + sha256 = "0gz6byjnnfn9acy40hcbyzdql4199xn0yvjx2cfjjjzd9kryjrxp"; }; patches = [ ./v1-fix-shell-path.patch ]; From 335865b9437cc5b382ac0498fb1e688569ff77b6 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Tue, 23 May 2017 22:34:22 +0200 Subject: [PATCH 4/4] gitlab-runner, gitlab-runner_1_11: change path fix patch to work on non NixOS It now tries to find the shell via path first and then falls back to the original behavior. --- .../gitlab-runner/default.nix | 2 +- .../gitlab-runner/fix-shell-path.patch | 25 +++++++++++++++++++ .../gitlab-runner/v1-fix-shell-path.patch | 13 ---------- .../gitlab-runner/v1.nix | 2 +- 4 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 pkgs/development/tools/continuous-integration/gitlab-runner/fix-shell-path.patch delete mode 100644 pkgs/development/tools/continuous-integration/gitlab-runner/v1-fix-shell-path.patch diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix index 5b2ddf1f1028..a87ea5ae5c70 100644 --- a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix +++ b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix @@ -32,7 +32,7 @@ buildGoPackage rec { sha256 = "0gz6byjnnfn9acy40hcbyzdql4199xn0yvjx2cfjjjzd9kryjrxp"; }; - patches = [ ./v1-fix-shell-path.patch ]; + patches = [ ./fix-shell-path.patch ]; buildInputs = [ go-bindata ]; diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/fix-shell-path.patch b/pkgs/development/tools/continuous-integration/gitlab-runner/fix-shell-path.patch new file mode 100644 index 000000000000..8f71f9ed630c --- /dev/null +++ b/pkgs/development/tools/continuous-integration/gitlab-runner/fix-shell-path.patch @@ -0,0 +1,25 @@ +diff --git a/shells/bash.go b/shells/bash.go +index 839b7781..2b478e1e 100644 +--- a/shells/bash.go ++++ b/shells/bash.go +@@ -7,6 +7,7 @@ import ( + "gitlab.com/gitlab-org/gitlab-ci-multi-runner/common" + "gitlab.com/gitlab-org/gitlab-ci-multi-runner/helpers" + "io" ++ "os/exec" + "path" + "runtime" + "strconv" +@@ -208,7 +209,11 @@ func (b *BashShell) GetConfiguration(info common.ShellScriptInfo) (script *commo + 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 ++ } ++ script.Arguments = append(script.Arguments, "-s", shellPath) + } + script.Arguments = append(script.Arguments, info.User) + script.Arguments = append(script.Arguments, "-c", shellCommand) \ No newline at end of file diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/v1-fix-shell-path.patch b/pkgs/development/tools/continuous-integration/gitlab-runner/v1-fix-shell-path.patch deleted file mode 100644 index 612c9a51f281..000000000000 --- a/pkgs/development/tools/continuous-integration/gitlab-runner/v1-fix-shell-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/shells/bash.go b/shells/bash.go -index c9c8b68..c97dbb5 100644 ---- a/shells/bash.go -+++ b/shells/bash.go -@@ -208,7 +208,7 @@ func (b *BashShell) GetConfiguration(info common.ShellScriptInfo) (script *commo - if info.User != "" { - script.Command = "su" - if runtime.GOOS == "linux" { -- script.Arguments = append(script.Arguments, "-s", "/bin/"+b.Shell) -+ script.Arguments = append(script.Arguments, "-s", "/run/current-system/sw/bin/"+b.Shell) - } - script.Arguments = append(script.Arguments, info.User) - script.Arguments = append(script.Arguments, "-c", shellCommand) diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix index 1ef0d41f3640..d51a32705923 100644 --- a/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix +++ b/pkgs/development/tools/continuous-integration/gitlab-runner/v1.nix @@ -32,7 +32,7 @@ buildGoPackage rec { sha256 = "1pm88546cijmrrcvvrajp2g6rsrzxhy83cwwwky8jjkl5w4hhmz4"; }; - patches = [ ./v1-fix-shell-path.patch ]; + patches = [ ./fix-shell-path.patch ]; buildInputs = [ go-bindata ];