From d8fd06641ac9b7ce131afd5eaa626d60c8645b21 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Thu, 4 Aug 2016 02:08:26 +0200 Subject: 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. --- nixos/doc/manual/release-notes/rl-1609.xml | 7 ++++++- nixos/modules/services/misc/gitlab.nix | 18 ++++++++++-------- nixos/modules/services/misc/gitlab.xml | 14 +++++++------- 3 files changed, 23 insertions(+), 16 deletions(-) (limited to 'nixos') diff --git a/nixos/doc/manual/release-notes/rl-1609.xml b/nixos/doc/manual/release-notes/rl-1609.xml index 8dbf03ee42b4..7a85d5cd5cbc 100644 --- a/nixos/doc/manual/release-notes/rl-1609.xml +++ b/nixos/doc/manual/release-notes/rl-1609.xml @@ -42,10 +42,15 @@ following incompatible changes: - Redis now binds to 127.0.0.1 only instead of listening to all network interfaces. This is the default + Redis now binds to 127.0.0.1 only instead of listening to all network interfaces. This is the default behavior of Redis 3.2 + + Gitlab's maintainence script gitlab-runner was removed and split up into the more clearer + gitlab-run and gitlab-rake scripts because gitlab-runner is a component of Gitlab CI. + + diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 46af78d58a17..ac2e94c25c33 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -106,20 +106,22 @@ let unicornConfig = builtins.readFile ./defaultUnicornConfig.rb; - gitlab-runner = pkgs.stdenv.mkDerivation rec { - name = "gitlab-runner"; + gitlab-rake = pkgs.stdenv.mkDerivation rec { + name = "gitlab-rake"; buildInputs = [ cfg.packages.gitlab cfg.packages.gitlab.env pkgs.makeWrapper ]; phases = "installPhase fixupPhase"; buildPhase = ""; installPhase = '' mkdir -p $out/bin - makeWrapper ${cfg.packages.gitlab.env}/bin/bundle $out/bin/gitlab-runner \ + makeWrapper ${cfg.packages.gitlab.env}/bin/bundle $out/bin/gitlab-bundle \ ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \ --set GITLAB_CONFIG_PATH '${cfg.statePath}/config' \ --set PATH '${pkgs.nodejs}/bin:${pkgs.gzip}/bin:${config.services.postgresql.package}/bin:$PATH' \ --set RAKEOPT '-f ${cfg.packages.gitlab}/share/gitlab/Rakefile' \ --run 'cd ${cfg.packages.gitlab}/share/gitlab' - ''; + makeWrapper $out/bin/gitlab-bundle $out/bin/gitlab-rake \ + --add-flags "exec rake" + ''; }; smtpSettings = pkgs.writeText "gitlab-smtp-settings.rb" '' @@ -331,7 +333,7 @@ in { config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.git gitlab-runner cfg.packages.gitlab-shell ]; + environment.systemPackages = [ pkgs.git gitlab-rake cfg.packages.gitlab-shell ]; assertions = [ { assertion = cfg.databasePassword != ""; @@ -480,14 +482,14 @@ in { touch "${cfg.statePath}/db-created" # The gitlab:setup task is horribly broken somehow, these two tasks will do the same for setting up the initial database - ${gitlab-runner}/bin/gitlab-runner exec rake db:migrate RAILS_ENV=production - ${gitlab-runner}/bin/gitlab-runner exec rake db:seed_fu RAILS_ENV=production \ + ${gitlab-rake}/bin/gitlab-rake db:migrate RAILS_ENV=production + ${gitlab-rake}/bin/gitlab-rake db:seed_fu RAILS_ENV=production \ GITLAB_ROOT_PASSWORD="${cfg.initialRootPassword}" GITLAB_ROOT_EMAIL="${cfg.initialRootEmail}"; fi fi # Always do the db migrations just to be sure the database is up-to-date - ${gitlab-runner}/bin/gitlab-runner exec rake db:migrate RAILS_ENV=production + ${gitlab-rake}/bin/gitlab-rake db:migrate RAILS_ENV=production # Change permissions in the last step because some of the # intermediary scripts like to create directories as root. diff --git a/nixos/modules/services/misc/gitlab.xml b/nixos/modules/services/misc/gitlab.xml index b630fe421130..30bc39d25683 100644 --- a/nixos/modules/services/misc/gitlab.xml +++ b/nixos/modules/services/misc/gitlab.xml @@ -80,21 +80,21 @@ options for the services.gitlab module.
Maintenance -You can run all Gitlab related commands like rake tasks with -gitlab-runner which will be available on the system -when gitlab is enabled. You will have to run the commands as the user that -you configured to run gitlab. +You can run Gitlab's rake tasks with gitlab-rake +which will be available on the system when gitlab is enabled. You will +have to run the command as the user that you configured to run gitlab +with. -For instance, to backup a Gitlab instance: +For example, to backup a Gitlab instance: -$ sudo -u git -H gitlab-runner exec rake gitlab:backup:create +$ sudo -u git -H gitlab-rake gitlab:backup:create A list of all availabe rake tasks can be obtained by running: -$ sudo -u git -H gitlab-runner exec rake -T +$ sudo -u git -H gitlab-rake -T -- cgit 1.4.1