gentoo:gitlab-ce
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
gentoo:gitlab-ce [2019/10/05 09:15] – [Upgrade the container] barrachi | gentoo:gitlab-ce [2024/05/01 16:57] (actual) – [Upgrade the container] barrachi | ||
---|---|---|---|
Línea 1: | Línea 1: | ||
====== GitLab Community Edition installation (using docker) ====== | ====== GitLab Community Edition installation (using docker) ====== | ||
- | Although it is possible to [[https:// | + | Although it is possible to [[https:// |
===== Install and run docker on Gentoo ===== | ===== Install and run docker on Gentoo ===== | ||
Línea 54: | Línea 54: | ||
</ | </ | ||
- | To see the logs of the gitlab | + | To see the logs of a container while it is starting: |
+ | <code bash> | ||
+ | docker logs -f CONTAINER_ID | ||
+ | </ | ||
+ | |||
+ | To see the logs of the gitlab | ||
<code bash> | <code bash> | ||
docker exec gitlab gitlab-ctl tail | docker exec gitlab gitlab-ctl tail | ||
</ | </ | ||
- | To execute a bash inside the gitlab | + | To execute a bash inside the gitlab |
<code bash> | <code bash> | ||
docker exec -it gitlab /bin/bash | docker exec -it gitlab /bin/bash | ||
</ | </ | ||
- | + | To enter the gitlab-rails console: | |
- | ===== NFS caveats ===== | + | |
- | + | ||
- | The NFS server and client can be fine tuned following | + | |
- | + | ||
- | If '''/ | + | |
- | + | ||
- | This change can be made permanent, patching ''/ | + | |
- | + | ||
- | <code diff> | + | |
- | --- / | + | |
- | +++ / | + | |
- | @@ -45,6 +45,11 @@ | + | |
- | | + | |
- | end | + | |
- | + | ||
- | +directory "/ | + | |
- | + owner " | + | |
- | + action :create | + | |
- | +end | + | |
- | + | + | |
- | | + | |
- | path "/ | + | |
- | owner " | + | |
- | </ | + | |
- | + | ||
- | The '''/ | + | |
<code bash> | <code bash> | ||
- | docker exec gitlab | + | docker exec -it gitlab |
</ | </ | ||
+ | More GitLab maintenance options in https:// | ||
===== Upgrade the container ===== | ===== Upgrade the container ===== | ||
- | 1. Check the digest number of the current version | + | 1. Check the current |
- | <code bash> | ||
- | docker images --digests | grep gitlab-ce | grep latest | grep sha256: | ||
- | </ | ||
- | 2. Compare the first digits of the digest number with those of the lastes version in: <https:// | + | 2a. If it says that there is an update available, go to https:// |
- | 3. Stop and delete | + | 2b. Instead of going by one, check the migration path in https:// |
+ | |||
+ | |||
+ | 3. Copy the pull command an execute it: | ||
<code bash> | <code bash> | ||
- | docker stop gitlab | + | docker pull gitlab/ |
- | docker rm gitlab | + | |
- | docker pull gitlab/ | + | |
</ | </ | ||
- | 4. If an NFS mount point is used and the '''/ | + | 4. Optionally, tag the retrieved image as 'my-gitlab-ce' |
<code bash> | <code bash> | ||
- | # Run the image once using bash as entry point: | + | docker |
- | docker | + | |
- | # Apply the previous patch on default.rb: | + | |
- | nano / | + | |
- | # Create new image from ID (it appears in the prompt, e.g. root@9ffa2bafe2bb:/# | + | |
- | docker commit 9ffa2bafe2bb | + | |
</ | </ | ||
- | 5. Run the image | + | |
+ | 5. Stop and delete | ||
<code bash> | <code bash> | ||
+ | docker stop gitlab | ||
+ | docker rm gitlab | ||
docker run --detach \ | docker run --detach \ | ||
[...] | [...] | ||
Línea 135: | Línea 111: | ||
--volume / | --volume / | ||
--volume / | --volume / | ||
- | | + | |
</ | </ | ||
- | 5. Cleanup | + | 6. Check that everything went Ok and monitor on the web interface the background migrations. **When all the background migrations have finished**, go to the Dashboard and check if there is a newer version available. If this is the caso, go again to the second step. |
+ | |||
+ | |||
+ | 7. Cleanup | ||
<code bash> | <code bash> | ||
- | docker | + | docker |
</ | </ | ||
- | ===== Backup | + | 7. Check that the backup procedure is working with the new version an delete the previous versions backups. |
+ | |||
+ | |||
+ | ===== PostgreSQL update ===== | ||
+ | |||
+ | The PostgreSQL version is updated only on some versions of Gitlab. To check which version should be used to perform the PostgreSQL update, please check: https:// | ||
+ | |||
+ | The tagged docker Gitlab versions can be seen in: https:// | ||
+ | |||
+ | |||
+ | ===== Backup ===== | ||
The backup strategy described next generates a backup file with a fixed name that will be incrementally backed up using an external tool. The container name is assumed to be '' | The backup strategy described next generates a backup file with a fixed name that will be incrementally backed up using an external tool. The container name is assumed to be '' | ||
Línea 161: | Línea 150: | ||
</ | </ | ||
- | To restore a given backup, restore the previous | + | ===== Restore ===== |
+ | |||
+ | To restore a given backup, restore the previously backed up dirs and follow the instructions in [[https:// | ||
+ | * You have installed the exact same version and type (CE/EE) of GitLab Omnibus with which the backup was created. | ||
+ | * You have run '' | ||
+ | * GitLab is running. If not, start it using '' | ||
+ | |||
+ | First make sure your backup tar file is in the backup directory (''/ | ||
+ | |||
+ | <code bash> | ||
+ | cp gitlab-ce-12.3.4_gitlab_backup.tar / | ||
+ | docker exec -it gitlab bash | ||
+ | chown git.git / | ||
+ | </ | ||
+ | |||
+ | Stop the processes that are connected to the database. Leave the rest of GitLab running: | ||
+ | |||
+ | <code bash> | ||
+ | gitlab-ctl stop unicorn | ||
+ | gitlab-ctl stop sidekiq | ||
+ | # Verify | ||
+ | gitlab-ctl status | ||
+ | </ | ||
+ | |||
+ | Next, restore the backup, specifying the **name part** of the backup you wish to restore: | ||
+ | |||
+ | <code bash> | ||
+ | # This command will overwrite the contents of your GitLab database! | ||
+ | gitlab-backup restore BACKUP=gitlab-ce-12.3.4 | ||
+ | </ | ||
+ | |||
+ | Next, restore / | ||
+ | |||
+ | Reconfigure, | ||
+ | |||
+ | < | ||
+ | gitlab-ctl reconfigure | ||
+ | gitlab-ctl restart | ||
+ | gitlab-rake gitlab: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== NFS caveats ===== | ||
+ | |||
+ | **DO NOT USE NFS WITH GITLAB-CE CONTAINER** | ||
+ | |||
+ | If there are permission problems with your NFS configuration, | ||
+ | |||
+ | **DO NOT USE NFS WITH GITLAB-CE CONTAINER** | ||
+ | |||
+ | The NFS server and client can be fine tuned following the [[https:// | ||
+ | |||
+ | If '''/ | ||
+ | |||
+ | This change can be made permanent, patching ''/ | ||
+ | |||
+ | <code diff> | ||
+ | --- / | ||
+ | +++ / | ||
+ | @@ -45,6 +45,11 @@ | ||
+ | | ||
+ | end | ||
+ | |||
+ | +directory "/ | ||
+ | + owner " | ||
+ | + action :create | ||
+ | +end | ||
+ | + | ||
+ | | ||
+ | path "/ | ||
+ | owner " | ||
+ | </ | ||
+ | |||
+ | The '''/ | ||
+ | <code bash> | ||
+ | docker exec gitlab su - git -c "[ -w / | ||
+ | </ | ||
+ | |||
+ | If an NFS mount point is used and the '''/ | ||
+ | |||
+ | <code bash> | ||
+ | # Run the image once using bash as entry point: | ||
+ | docker run -it --entrypoint bash gitlab/ | ||
+ | # Apply the previous patch on default.rb: | ||
+ | nano / | ||
+ | # Exit the image | ||
+ | exit | ||
+ | # Create new image from ID (it appears in the prompt, e.g. root@9ffa2bafe2bb:/# | ||
+ | docker commit 9ffa2bafe2bb my-gitlab-ce | ||
+ | </ | ||
gentoo/gitlab-ce.1570266943.txt.gz · Última modificación: 2019/10/05 09:15 por barrachi