git.iko.soy/typeable/nixpkgs
on master help sign in
gitlab module: split up gitlab-runner script

The name gitlab-runner clashes with a component of Gitlab CI with the same name and only confuses people. It's now called gitlab-bundle and a convenience-script gitlab-rake for easier invocation of rake tasks was added. This was the primary use case of gitlab-runner.

commitd8fd06641ac9b7ce131afd5eaa626d60c8645b21 authorFranz Pletz <fpletz@fnordicwalking.de> dateThu 4 Aug 2016, 02:08 (10 years ago) parentc39b602
3 files changed+23−16
nixos/doc/manual/release-notes/rl-1609.xml+6−1 nixos/modules/services/misc/gitlab.nix+10−8 nixos/modules/services/misc/gitlab.xml+7−7
nixos/doc/manual/release-notes/rl-1609.xml+6−1
@@ -42,10 +42,15 @@ following incompatible changes:</para>
4242 </listitem>
4343
4444 <listitem>
45− <para>Redis now binds to 127.0.0.1 only instead of listening to all network interfaces. This is the default
45+ <para>Redis now binds to 127.0.0.1 only instead of listening to all network interfaces. This is the default
4646 behavior of Redis 3.2</para>
4747 </listitem>
4848
49+ <listitem>
50+ <para>Gitlab's maintainence script gitlab-runner was removed and split up into the more clearer
51+ gitlab-run and gitlab-rake scripts because gitlab-runner is a component of Gitlab CI.</para>
52+ </listitem>
53+
4954</itemizedlist>
5055
5156
nixos/modules/services/misc/gitlab.nix+10−8
@@ -106,20 +106,22 @@ let
106106
107107 unicornConfig = builtins.readFile ./defaultUnicornConfig.rb;
108108
109− gitlab-runner = pkgs.stdenv.mkDerivation rec {
110− name = "gitlab-runner";
109+ gitlab-rake = pkgs.stdenv.mkDerivation rec {
110+ name = "gitlab-rake";
111111 buildInputs = [ cfg.packages.gitlab cfg.packages.gitlab.env pkgs.makeWrapper ];
112112 phases = "installPhase fixupPhase";
113113 buildPhase = "";
114114 installPhase = ''
115115 mkdir -p $out/bin
116− makeWrapper ${cfg.packages.gitlab.env}/bin/bundle $out/bin/gitlab-runner \
116+ makeWrapper ${cfg.packages.gitlab.env}/bin/bundle $out/bin/gitlab-bundle \
117117 ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \
118118 --set GITLAB_CONFIG_PATH '${cfg.statePath}/config' \
119119 --set PATH '${pkgs.nodejs}/bin:${pkgs.gzip}/bin:${config.services.postgresql.package}/bin:$PATH' \
120120 --set RAKEOPT '-f ${cfg.packages.gitlab}/share/gitlab/Rakefile' \
121121 --run 'cd ${cfg.packages.gitlab}/share/gitlab'
122− '';
122+ makeWrapper $out/bin/gitlab-bundle $out/bin/gitlab-rake \
123+ --add-flags "exec rake"
124+ '';
123125 };
124126
125127 smtpSettings = pkgs.writeText "gitlab-smtp-settings.rb" ''
@@ -331,7 +333,7 @@ in {
331333
332334 config = mkIf cfg.enable {
333335
334− environment.systemPackages = [ pkgs.git gitlab-runner cfg.packages.gitlab-shell ];
336+ environment.systemPackages = [ pkgs.git gitlab-rake cfg.packages.gitlab-shell ];
335337
336338 assertions = [
337339 { assertion = cfg.databasePassword != "";
@@ -480,14 +482,14 @@ in {
480482 touch "${cfg.statePath}/db-created"
481483
482484 # The gitlab:setup task is horribly broken somehow, these two tasks will do the same for setting up the initial database
483− ${gitlab-runner}/bin/gitlab-runner exec rake db:migrate RAILS_ENV=production
484− ${gitlab-runner}/bin/gitlab-runner exec rake db:seed_fu RAILS_ENV=production \
485+ ${gitlab-rake}/bin/gitlab-rake db:migrate RAILS_ENV=production
486+ ${gitlab-rake}/bin/gitlab-rake db:seed_fu RAILS_ENV=production \
485487 GITLAB_ROOT_PASSWORD="${cfg.initialRootPassword}" GITLAB_ROOT_EMAIL="${cfg.initialRootEmail}";
486488 fi
487489 fi
488490
489491 # Always do the db migrations just to be sure the database is up-to-date
490− ${gitlab-runner}/bin/gitlab-runner exec rake db:migrate RAILS_ENV=production
492+ ${gitlab-rake}/bin/gitlab-rake db:migrate RAILS_ENV=production
491493
492494 # Change permissions in the last step because some of the
493495 # intermediary scripts like to create directories as root.
nixos/modules/services/misc/gitlab.xml+7−7
@@ -80,21 +80,21 @@ options for the <literal>services.gitlab</literal> module.</para>
8080
8181<section><title>Maintenance</title>
8282
83−<para>You can run all Gitlab related commands like rake tasks with
84−<literal>gitlab-runner</literal> which will be available on the system
85−when gitlab is enabled. You will have to run the commands as the user that
86−you configured to run gitlab.</para>
83+<para>You can run Gitlab's rake tasks with <literal>gitlab-rake</literal>
84+which will be available on the system when gitlab is enabled. You will
85+have to run the command as the user that you configured to run gitlab
86+with.</para>
8787
88−<para>For instance, to backup a Gitlab instance:
88+<para>For example, to backup a Gitlab instance:
8989
9090<programlisting>
91−$ sudo -u git -H gitlab-runner exec rake gitlab:backup:create
91+$ sudo -u git -H gitlab-rake gitlab:backup:create
9292</programlisting>
9393
9494A list of all availabe rake tasks can be obtained by running:
9595
9696<programlisting>
97−$ sudo -u git -H gitlab-runner exec rake -T
97+$ sudo -u git -H gitlab-rake -T
9898</programlisting>
9999</para>
100100