summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-08-22 11:42:43 +0200
committermakefu <github@syntax-fehler.de>2017-08-22 11:42:43 +0200
commit52b30c4a74e331c10585f19d4c1f38b24e32c5fa (patch)
treee7b7235c45b2f4baa49ccb70b07e810232306eed
parent9a834c1b9749dddebabd317daa518267c6bf55d8 (diff)
parent1623c03f12ce175d934e5b2b0d9577e1eeaf1abe (diff)
Merge branch 'gitlab-ci'
-rw-r--r--.gitlab-ci.yml5
-rw-r--r--krebs/1systems/hotdog/config.nix1
-rw-r--r--krebs/2configs/gitlab-runner-shackspace.nix34
-rw-r--r--krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix1
4 files changed, 41 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..3f2f28d65
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,5 @@
+nix-shell test:
+ script:
+ - env
+ - nix-shell --pure --command 'true' -p stdenv && echo success
+ - nix-shell --pure --command 'false' -p stdenv || echo success
diff --git a/krebs/1systems/hotdog/config.nix b/krebs/1systems/hotdog/config.nix
index 4807307ff..2ad22f49c 100644
--- a/krebs/1systems/hotdog/config.nix
+++ b/krebs/1systems/hotdog/config.nix
@@ -10,6 +10,7 @@
<stockholm/krebs/2configs>
<stockholm/krebs/2configs/buildbot-all.nix>
+ <stockholm/krebs/2configs/gitlab-runner-shackspace.nix>
<stockholm/krebs/2configs/binary-cache/nixos.nix>
];
diff --git a/krebs/2configs/gitlab-runner-shackspace.nix b/krebs/2configs/gitlab-runner-shackspace.nix
new file mode 100644
index 000000000..d9b4cd589
--- /dev/null
+++ b/krebs/2configs/gitlab-runner-shackspace.nix
@@ -0,0 +1,34 @@
+{ config, ... }:
+let
+ url = "https://git.shackspace.de/";
+ # generate token from CI-token via:
+ ## gitlab-runner register
+ ## cat /etc/gitlab-runner/config.toml
+ token = import <secrets/shackspace-gitlab-ci-token.nix> ;
+in {
+ systemd.services.gitlab-runner.path = [
+ "/run/wrappers" # /run/wrappers/bin/su
+ "/" # /bin/sh
+ ];
+ systemd.services.gitlab-runner.serviceConfig.PrivateTmp = true;
+ virtualisation.docker.enable = true;
+ services.gitlab-runner = {
+ enable = true;
+ # configFile, configOptions and gracefulTimeout not yet in stable
+ # gracefulTimeout = "120min";
+ configText = ''
+ concurrent = 1
+ check_interval = 0
+
+ [[runners]]
+ name = "krebs-shell"
+ url = "${url}"
+ token = "${token}"
+ executor = "shell"
+ shell = "sh"
+ environment = ["PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"]
+ [runners.cache]
+
+ '';
+ };
+}
diff --git a/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix
new file mode 100644
index 000000000..963e6db8b
--- /dev/null
+++ b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix
@@ -0,0 +1 @@
+"lol"