From 536aa3a1f4b96abc4ca34489bf2cbe503afcded7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 30 Jan 2020 15:09:15 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/update/README.md | 2 +- doc/update/mysql_to_postgresql.md | 32 ++++++++++++------------ doc/update/patch_versions.md | 20 +++++++-------- doc/update/upgrading_from_ce_to_ee.md | 18 +++++++------- doc/update/upgrading_from_source.md | 46 +++++++++++++++++------------------ 5 files changed, 59 insertions(+), 59 deletions(-) (limited to 'doc/update') diff --git a/doc/update/README.md b/doc/update/README.md index 255abc7b523..9762ecffc6d 100644 --- a/doc/update/README.md +++ b/doc/update/README.md @@ -115,7 +115,7 @@ following command: **For Omnibus installations** -```bash +```shell sudo gitlab-rails runner -e production 'puts Sidekiq::Queue.new("background_migration").size' ``` diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md index 7f6162cca88..08794b8a101 100644 --- a/doc/update/mysql_to_postgresql.md +++ b/doc/update/mysql_to_postgresql.md @@ -20,19 +20,19 @@ Debian/Ubuntu: 1. Search for the version: - ```bash + ```shell apt-cache madison pgloader ``` 1. If the version is 3.4.1+, install it with: - ```bash + ```shell sudo apt-get install pgloader ``` If your distribution's version is too old, use PostgreSQL's repository: - ```bash + ```shell # Add repository sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' @@ -72,7 +72,7 @@ need to enable the bundled PostgreSQL: 1. Stop GitLab: - ```bash + ```shell sudo gitlab-ctl stop ``` @@ -91,20 +91,20 @@ need to enable the bundled PostgreSQL: for the changes to take effect. 1. Start Unicorn and PostgreSQL so that we can prepare the schema: - ```bash + ```shell sudo gitlab-ctl start unicorn sudo gitlab-ctl start postgresql ``` 1. Run the following commands to prepare the schema: - ```bash + ```shell sudo gitlab-rake db:create db:migrate ``` 1. Stop Unicorn to prevent other database access from interfering with the loading of data: - ```bash + ```shell sudo gitlab-ctl stop unicorn ``` @@ -136,7 +136,7 @@ new PostgreSQL one: 1. Start the migration: - ```bash + ```shell sudo -u gitlab-psql pgloader commands.load ``` @@ -168,7 +168,7 @@ new PostgreSQL one: 1. Start GitLab: - ```bash + ```shell sudo gitlab-ctl start ``` @@ -183,13 +183,13 @@ After the database is created, go on with the following steps: 1. Stop GitLab: - ```bash + ```shell sudo service gitlab stop ``` 1. Switch database from MySQL to PostgreSQL - ```bash + ```shell cd /home/git/gitlab sudo -u git mv config/database.yml config/database.yml.bak sudo -u git cp config/database.yml.postgresql config/database.yml @@ -198,14 +198,14 @@ After the database is created, go on with the following steps: 1. Install Gems related to PostgreSQL - ```bash + ```shell sudo -u git -H rm .bundle/config sudo -u git -H bundle install --deployment --without development test mysql aws kerberos ``` 1. Run the following commands to prepare the schema: - ```bash + ```shell sudo -u git -H bundle exec rake db:create db:migrate RAILS_ENV=production ``` @@ -237,7 +237,7 @@ new PostgreSQL one: 1. Start the migration: - ```bash + ```shell sudo -u postgres pgloader commands.load ``` @@ -269,7 +269,7 @@ new PostgreSQL one: 1. Start GitLab: - ```bash + ```shell sudo service gitlab start ``` @@ -297,7 +297,7 @@ debugger invoked on a CL-POSTGRES-ERROR:INSUFFICIENT-PRIVILEGE in thread If you experience 500 errors after the migration, try to clear the cache: -```bash +```shell # Omnibus GitLab sudo gitlab-rake cache:clear diff --git a/doc/update/patch_versions.md b/doc/update/patch_versions.md index 5aa97d82fd1..ac7aee779c0 100644 --- a/doc/update/patch_versions.md +++ b/doc/update/patch_versions.md @@ -16,7 +16,7 @@ It's useful to make a backup just in case things go south. Depending on the inst ### 1. Stop server -```bash +```shell sudo service gitlab stop ``` @@ -27,7 +27,7 @@ to update to, for example `v8.0.3`. Use `git tag -l 'v*.[0-9]' --sort='v:refname to see a list of all tags. Make sure to update patch versions only (check your current version with `cat VERSION`). -```bash +```shell cd /home/git/gitlab sudo -u git -H git fetch --all @@ -37,7 +37,7 @@ sudo -u git -H git checkout LATEST_TAG -b LATEST_TAG ### 3. Install libs, migrations, etc -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle install --without development test mysql --deployment @@ -60,7 +60,7 @@ sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:c ### 4. Update GitLab Workhorse to the corresponding version -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production @@ -68,7 +68,7 @@ sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workh ### 5. Update Gitaly to the corresponding version -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake "gitlab:gitaly:install[/home/git/gitaly,/home/git/repositories]" RAILS_ENV=production @@ -76,7 +76,7 @@ sudo -u git -H bundle exec rake "gitlab:gitaly:install[/home/git/gitaly,/home/gi ### 6. Update GitLab Shell to the corresponding version -```bash +```shell cd /home/git/gitlab-shell sudo -u git -H git fetch --all --tags @@ -86,7 +86,7 @@ sudo -u git -H make build ### 7. Update GitLab Pages to the corresponding version (skip if not using pages) -```bash +```shell cd /home/git/gitlab-pages sudo -u git -H git fetch --all --tags @@ -100,7 +100,7 @@ Please follow the [install instruction](../integration/elasticsearch.md#installa ### 9. Start application -```bash +```shell sudo service gitlab start sudo service nginx restart ``` @@ -109,7 +109,7 @@ sudo service nginx restart Check if GitLab and its environment are configured correctly: -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production @@ -117,7 +117,7 @@ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production To make sure you didn't miss anything run a more thorough check with: -```bash +```shell sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production ``` diff --git a/doc/update/upgrading_from_ce_to_ee.md b/doc/update/upgrading_from_ce_to_ee.md index d1853466e30..5c395ddba70 100644 --- a/doc/update/upgrading_from_ce_to_ee.md +++ b/doc/update/upgrading_from_ce_to_ee.md @@ -32,7 +32,7 @@ use the following branches: Make a backup just in case something goes wrong: -```sh +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production ``` @@ -42,13 +42,13 @@ privileges to the GitLab user on the database version. ### 1. Stop server -```sh +```shell sudo service gitlab stop ``` ### 2. Get the EE code -```sh +```shell cd /home/git/gitlab sudo -u git -H git remote add -f ee https://gitlab.com/gitlab-org/gitlab.git sudo -u git -H git checkout EE_BRANCH @@ -56,7 +56,7 @@ sudo -u git -H git checkout EE_BRANCH ### 3. Install libs, migrations, etc -```sh +```shell cd /home/git/gitlab sudo -u git -H bundle install --deployment --without development test mysql aws kerberos @@ -83,7 +83,7 @@ Please follow the [install instruction](../integration/elasticsearch.md#installa ### 5. Start application -```sh +```shell sudo service gitlab start sudo service nginx restart ``` @@ -92,13 +92,13 @@ sudo service nginx restart Check if GitLab and its environment are configured correctly: -```sh +```shell sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production ``` To make sure you didn't miss anything run a more thorough check with: -```sh +```shell sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production ``` @@ -108,14 +108,14 @@ If all items are green, then congratulations upgrade complete! ### 1. Revert the code to the previous version -```sh +```shell cd /home/git/gitlab sudo -u git -H git checkout CE_BRANCH ``` ### 2. Restore from the backup -```sh +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production ``` diff --git a/doc/update/upgrading_from_source.md b/doc/update/upgrading_from_source.md index 48f8052cbb8..661f3eef832 100644 --- a/doc/update/upgrading_from_source.md +++ b/doc/update/upgrading_from_source.md @@ -44,7 +44,7 @@ specific guidelines (should there be any) are covered separately. NOTE: If you installed GitLab from source, make sure `rsync` is installed. -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production @@ -52,7 +52,7 @@ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production ### 2. Stop server -```bash +```shell sudo service gitlab stop ``` @@ -65,7 +65,7 @@ You can check which version you are running with `ruby -v`. Download Ruby and compile it: -```bash +```shell mkdir /tmp/ruby && cd /tmp/ruby curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.gz echo '1416ce288fb8bfeae07a12b608540318c9cace71 ruby-2.6.5.tar.gz' | shasum -c - && tar xzf ruby-2.6.5.tar.gz @@ -78,7 +78,7 @@ sudo make install Install Bundler: -```bash +```shell sudo gem install bundler --no-document --version '< 2' ``` @@ -91,7 +91,7 @@ dependencies. In Debian or Ubuntu: -```bash +```shell curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update @@ -108,7 +108,7 @@ You can check which version you are running with `go version`. Download and install Go (for Linux, 64-bit): -```bash +```shell # Remove former Go installation folder sudo rm -rf /usr/local/go @@ -126,7 +126,7 @@ NOTE: To check the minimum required Git version, see [Git versions](../install/r In Debian or Ubuntu: -```bash +```shell # Make sure Git is version 2.21.0 or higher git --version @@ -161,7 +161,7 @@ sudo make prefix=/usr/local install ### 7. Get latest code -```bash +```shell cd /home/git/gitlab sudo -u git -H git fetch --all --prune @@ -171,7 +171,7 @@ sudo -u git -H git checkout -- locale For GitLab Community Edition: -```bash +```shell cd /home/git/gitlab sudo -u git -H git checkout BRANCH @@ -181,7 +181,7 @@ OR For GitLab Enterprise Edition: -```bash +```shell cd /home/git/gitlab sudo -u git -H git checkout BRANCH-ee @@ -189,7 +189,7 @@ sudo -u git -H git checkout BRANCH-ee ### 8. Update GitLab Shell -```bash +```shell cd /home/git/gitlab-shell sudo -u git -H git fetch --all --tags --prune @@ -204,7 +204,7 @@ Install and compile GitLab Workhorse. GitLab Workhorse uses If you are not using Linux you may have to run `gmake` instead of `make` below. -```bash +```shell cd /home/git/gitlab-workhorse sudo -u git -H git fetch --all --tags --prune @@ -232,7 +232,7 @@ Install and compile GitLab Pages. GitLab Pages uses If you are not using Linux you may have to run `gmake` instead of `make` below. -```bash +```shell cd /home/git/gitlab-pages sudo -u git -H git fetch --all --tags --prune @@ -247,7 +247,7 @@ sudo -u git -H make There might be configuration options available for [`gitlab.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/config/gitlab.yml.example)). View them with the command below and apply them manually to your current `gitlab.yml`: -```sh +```shell cd /home/git/gitlab git diff origin/PREVIOUS_BRANCH:config/gitlab.yml.example origin/BRANCH:config/gitlab.yml.example @@ -257,7 +257,7 @@ git diff origin/PREVIOUS_BRANCH:config/gitlab.yml.example origin/BRANCH:config/g Ensure you're still up-to-date with the latest NGINX configuration changes: -```sh +```shell cd /home/git/gitlab # For HTTPS configurations @@ -293,7 +293,7 @@ There might be new configuration options available for [`gitlab.default.example`](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/support/init.d/gitlab.default.example). View them with the command below and apply them manually to your current `/etc/default/gitlab`: -```sh +```shell cd /home/git/gitlab git diff origin/PREVIOUS_BRANCH:lib/support/init.d/gitlab.default.example origin/BRANCH:lib/support/init.d/gitlab.default.example @@ -301,7 +301,7 @@ git diff origin/PREVIOUS_BRANCH:lib/support/init.d/gitlab.default.example origin Ensure you're still up-to-date with the latest init script changes: -```bash +```shell cd /home/git/gitlab sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab @@ -309,13 +309,13 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab For Ubuntu 16.04.1 LTS: -```bash +```shell sudo systemctl daemon-reload ``` ### 13. Install libs, migrations, etc -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle install --deployment --without development test mysql aws kerberos @@ -339,7 +339,7 @@ sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production ### 14. Start application -```bash +```shell sudo service gitlab start sudo service nginx restart ``` @@ -348,7 +348,7 @@ sudo service nginx restart Check if GitLab and its environment are configured correctly: -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production @@ -356,7 +356,7 @@ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production To make sure you didn't miss anything run a more thorough check: -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production @@ -394,7 +394,7 @@ backup has already been migrated to the previous version. ### 2. Restore from the backup -```bash +```shell cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -- cgit v1.2.3