diff options
Diffstat (limited to 'doc/raketasks')
-rw-r--r-- | doc/raketasks/backup_restore.md | 44 | ||||
-rw-r--r-- | doc/raketasks/import.md | 4 | ||||
-rw-r--r-- | doc/raketasks/user_management.md | 10 | ||||
-rw-r--r-- | doc/raketasks/web_hooks.md | 12 |
4 files changed, 35 insertions, 35 deletions
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index 2d2f5409c15..78d634b7795 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -21,7 +21,7 @@ If you installed GitLab: - Using the Omnibus package, you're all set. - From source, make sure `rsync` is installed: - ```sh + ```shell # Debian/Ubuntu sudo apt-get install rsync @@ -35,7 +35,7 @@ Backup and restore tasks use `tar` under the hood to create and extract archives. Ensure you have version 1.30 or above of `tar` available in your system. To check the version, run: -```sh +```shell tar --version ``` @@ -76,7 +76,7 @@ You are highly advised to [read about storing configuration files](#storing-conf Use this command if you've installed GitLab with the Omnibus package: -```sh +```shell sudo gitlab-backup create ``` @@ -85,13 +85,13 @@ For GitLab 12.1 and earlier, use `gitlab-rake gitlab:backup:create`. Use this if you've installed GitLab from source: -```sh +```shell sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production ``` If you are running GitLab within a Docker container, you can run the backup from the host: -```sh +```shell docker exec -t <container name> gitlab-backup create ``` @@ -102,7 +102,7 @@ If you are using the [GitLab Helm chart](https://gitlab.com/gitlab-org/charts/gi Kubernetes cluster, you can run the backup task using `backup-utility` script on the GitLab task runner pod via `kubectl`. Refer to [backing up a GitLab installation](https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/backup-restore/backup.md#backing-up-a-gitlab-installation) for more details: -```sh +```shell kubectl exec -it <gitlab task-runner pod> backup-utility ``` @@ -204,7 +204,7 @@ installations. This is why the `copy` strategy is not the default in 8.17. To use the `copy` strategy instead of the default streaming strategy, specify `STRATEGY=copy` in the Rake task command. For example: -```sh +```shell sudo gitlab-backup create STRATEGY=copy ``` @@ -215,7 +215,7 @@ For GitLab 12.1 and earlier, use `gitlab-rake gitlab:backup:create`. By default a backup file is created according to the specification in [the Backup timestamp](#backup-timestamp) section above. You can however override the `[TIMESTAMP]` part of the filename by setting the `BACKUP` environment variable. For example: -```sh +```shell sudo gitlab-backup create BACKUP=dump ``` @@ -230,7 +230,7 @@ To make sure the generated archive is intelligently transferable by rsync, the ` Note that the `--rsyncable` option in `gzip` is not guaranteed to be available on all distributions. To verify that it is available in your distribution you can run `gzip --help` or consult the man pages. -```sh +```shell sudo gitlab-backup create BACKUP=dump GZIP_RSYNCABLE=yes ``` @@ -258,7 +258,7 @@ will be skipped during a backup. For Omnibus GitLab packages: -```sh +```shell sudo gitlab-backup create SKIP=db,uploads ``` @@ -267,7 +267,7 @@ For GitLab 12.1 and earlier, use `gitlab-rake gitlab:backup:create`. For installations from source: -```sh +```shell sudo -u git -H bundle exec rake gitlab:backup:create SKIP=db,uploads RAILS_ENV=production ``` @@ -579,7 +579,7 @@ policy as described here](https://stackoverflow.com/questions/37553070/gitlab-om To schedule a cron job that backs up your repositories and GitLab metadata, use the root user: -```sh +```shell sudo su - crontab -e ``` @@ -608,7 +608,7 @@ For installations from source: 1. [Restart GitLab] for the changes to take effect. -```sh +```shell sudo -u git crontab -e # Edit the crontab for the git user ``` @@ -796,7 +796,7 @@ backup location (default location is `/var/opt/gitlab/backups`). For docker installations, the restore task can be run from host: -```sh +```shell docker exec -it <name of container> gitlab-backup restore ``` @@ -906,13 +906,13 @@ backup beforehand. For Omnibus GitLab packages: - ```sh + ```shell sudo gitlab-rails dbconsole ``` For installations from source: - ```sh + ```shell sudo -u git -H bundle exec rails dbconsole RAILS_ENV=production ``` @@ -941,13 +941,13 @@ backup beforehand. For Omnibus GitLab packages: - ```sh + ```shell sudo gitlab-rails dbconsole ``` For installations from source: - ```sh + ```shell sudo -u git -H bundle exec rails dbconsole RAILS_ENV=production ``` @@ -974,13 +974,13 @@ backup beforehand. For Omnibus GitLab packages: - ```sh + ```shell sudo gitlab-rails dbconsole ``` For installations from source: - ```sh + ```shell sudo -u git -H bundle exec rails dbconsole RAILS_ENV=production ``` @@ -1017,7 +1017,7 @@ unable to assign the correct ownership to the registry files during the restore To get your registry working again: -```bash +```shell sudo chown -R registry:registry /var/opt/gitlab/gitlab-rails/shared/registry/docker ``` @@ -1033,7 +1033,7 @@ want to run the `chown` against your custom location instead of While running the backup, you may receive a gzip error: -```sh +```shell sudo /opt/gitlab/bin/gitlab-backup create ... Dumping ... diff --git a/doc/raketasks/import.md b/doc/raketasks/import.md index 5f11af0213d..d50272174ab 100644 --- a/doc/raketasks/import.md +++ b/doc/raketasks/import.md @@ -42,7 +42,7 @@ If you are using an installation from source, replace `/var/opt/gitlab/` with `/ #### Omnibus Installation -```sh +```shell sudo gitlab-rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-<date>'] ``` @@ -50,7 +50,7 @@ sudo gitlab-rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import Before running this command you need to change the directory to where your GitLab installation is located: -```sh +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-<date>'] RAILS_ENV=production ``` diff --git a/doc/raketasks/user_management.md b/doc/raketasks/user_management.md index 571e784e530..04f8ad59153 100644 --- a/doc/raketasks/user_management.md +++ b/doc/raketasks/user_management.md @@ -2,7 +2,7 @@ ## Add user as a developer to all projects -```bash +```shell # omnibus-gitlab sudo gitlab-rake gitlab:import:user_to_projects[username@domain.tld] @@ -16,7 +16,7 @@ Notes: - admin users are added as maintainers -```bash +```shell # omnibus-gitlab sudo gitlab-rake gitlab:import:all_users_to_all_projects @@ -26,7 +26,7 @@ bundle exec rake gitlab:import:all_users_to_all_projects RAILS_ENV=production ## Add user as a developer to all groups -```bash +```shell # omnibus-gitlab sudo gitlab-rake gitlab:import:user_to_groups[username@domain.tld] @@ -40,7 +40,7 @@ Notes: - admin users are added as owners so they can add additional users to the group -```bash +```shell # omnibus-gitlab sudo gitlab-rake gitlab:import:all_users_to_all_groups @@ -62,7 +62,7 @@ This task will disable 2FA for all users that have it enabled. This can be useful if GitLab's `config/secrets.yml` file has been lost and users are unable to login, for example. -```bash +```shell # omnibus-gitlab sudo gitlab-rake gitlab:two_factor:disable_for_all_users diff --git a/doc/raketasks/web_hooks.md b/doc/raketasks/web_hooks.md index d9a042ec8fe..22084c862ba 100644 --- a/doc/raketasks/web_hooks.md +++ b/doc/raketasks/web_hooks.md @@ -2,7 +2,7 @@ ## Add a webhook for **ALL** projects -```sh +```shell # omnibus-gitlab sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook" # source installations @@ -11,7 +11,7 @@ bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" RAILS_ENV=pro ## Add a webhook for projects in a given **NAMESPACE** -```sh +```shell # omnibus-gitlab sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=acme # source installations @@ -20,7 +20,7 @@ bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=acm ## Remove a webhook from **ALL** projects using -```sh +```shell # omnibus-gitlab sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook" # source installations @@ -29,7 +29,7 @@ bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" RAILS_ENV=prod ## Remove a webhook from projects in a given **NAMESPACE** -```sh +```shell # omnibus-gitlab sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=acme # source installations @@ -38,7 +38,7 @@ bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=acme ## List **ALL** webhooks -```sh +```shell # omnibus-gitlab sudo gitlab-rake gitlab:web_hook:list # source installations @@ -47,7 +47,7 @@ bundle exec rake gitlab:web_hook:list RAILS_ENV=production ## List the webhooks from projects in a given **NAMESPACE** -```sh +```shell # omnibus-gitlab sudo gitlab-rake gitlab:web_hook:list NAMESPACE=acme # source installations |