Commit e927234c authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Add all options in admin maven packages configuration

parent d5aad336
# GitLab private Maven repository administration # GitLab Maven repository administration
> **Notes:** >
- [Introduced][ee-5811] in GitLab 11.3. [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/5811)
- This document is about the admin guide. Learn how to use GitLab Maven in GitLab 11.3. To learn how to use
repository from [user documentation](../user/project/maven_packages.md).
When enabled, every project in GitLab will have its own space to store When the GitLab Maven repository is enabled, every project in GitLab will have
[Maven](https://maven.apache.org/) packages. its own space to store [Maven](https://maven.apache.org/) packages.
## Enabling the Maven repository To learn how to use it, see the [user documentation](../user/project/maven_packages.md).
## Enabling the Packages repository
NOTE: **Note:** NOTE: **Note:**
Once enabled, newly created projects will have the Packages feature enabled by Once enabled, newly created projects will have the Packages feature enabled by
default. Existing projects will need to default. Existing projects will need to
[explicitly enabled it](../user/project/maven_packages.md#enabling-the-packages-repository). [explicitly enabled it](../user/project/maven_packages.md#enabling-the-packages-repository).
To enable the Packages repository:
**Omnibus GitLab installations** **Omnibus GitLab installations**
1. Edit `/etc/gitlab/gitlab.rb` and add the following line: 1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
...@@ -27,8 +30,6 @@ default. Existing projects will need to ...@@ -27,8 +30,6 @@ default. Existing projects will need to
**Installations from source** **Installations from source**
If you have installed GitLab from source:
1. After the installation is complete, you will have to configure the `packages` 1. After the installation is complete, you will have to configure the `packages`
section in `config/gitlab.yml`. Set to `true` to enable it: section in `config/gitlab.yml`. Set to `true` to enable it:
...@@ -38,6 +39,115 @@ If you have installed GitLab from source: ...@@ -38,6 +39,115 @@ If you have installed GitLab from source:
``` ```
1. [Restart GitLab] for the changes to take effect. 1. [Restart GitLab] for the changes to take effect.
## Changing the storage path
By default, the packages are stored locally, but you can change the default
local location or even use object storage.
### Changing the local storage path
The packages for Omnibus GitLab installations are stored under
`/var/opt/gitlab/gitlab-rails/shared/packages/` and for source
installations under `shared/packages/` (relative to the git homedir).
To change the local storage path:
**Omnibus GitLab installations**
1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby
gitlab_rails['packages_storage_path'] = "/mnt/maven"
```
1. Save the file and [reconfigure GitLab][] for the changes to take effect.
**Installations from source**
1. Edit the `packages` section in `config/gitlab.yml`:
```yaml
packages:
enabled: true
storage_path: shared/packages
```
1. [Restart GitLab] for the changes to take effect.
### Using object storage
Instead of relying on the local storage, you can use an object storage to
upload the maven packages:
**Omnibus GitLab installations**
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
necessary):
```ruby
gitlab_rails['packages_enabled'] = true
gitlab_rails['packages_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/packages"
gitlab_rails['packages_object_store_enabled'] = true
gitlab_rails['packages_object_store_remote_directory'] = "packages" # The bucket name
gitlab_rails['packages_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false)
gitlab_rails['packages_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true)
gitlab_rails['packages_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage
gitlab_rails['packages_object_store_connection'] = {
##
## If the provider is AWS S3, uncomment the following
##
#'provider' => 'AWS',
#'region' => 'eu-west-1',
#'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
#'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
##
## If the provider is other than AWS (an S3-compatible one), uncomment the following
##
#'host' => 's3.amazonaws.com',
#'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
#'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces
#'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'
}
```
1. Save the file and [reconfigure GitLab][] for the changes to take effect.
**Installations from source**
1. Edit the `packages` section in `config/gitlab.yml`:
```yaml
packages:
enabled: true
##
## The location where build packages are stored (default: shared/packages).
##
#storage_path: shared/packages
object_store:
enabled: false
remote_directory: packages # The bucket name
#direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false)
#background_upload: true # Temporary option to limit automatic upload (Default: true)
#proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage
connection:
##
## If the provider is AWS S3, uncomment the following
##
#provider: AWS
#region: us-east-1
#aws_access_key_id: AWS_ACCESS_KEY_ID
#aws_secret_access_key: AWS_SECRET_ACCESS_KEY
##
## If the provider is other than AWS (an S3-compatible one), uncomment the following
##
#host: 's3.amazonaws.com' # default: s3.amazonaws.com
#endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces
#path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'
```
1. [Restart GitLab] for the changes to take effect.
[reconfigure gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab" [reconfigure gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
[restart gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab" [restart gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
[ee-5811]: https://gitlab.com/gitlab-org/gitlab-ee/issues/5811
...@@ -12,16 +12,17 @@ This option is available only if your GitLab administrator has ...@@ -12,16 +12,17 @@ This option is available only if your GitLab administrator has
[enabled the Packages repository](../../administration/maven_packages.md). [enabled the Packages repository](../../administration/maven_packages.md).
In order to use the GitLab Maven Packages repository, you must enable the In order to use the GitLab Maven Packages repository, you must enable the
general Packages repository. To enable (or disable) it: Packages repository. To enable (or disable) it:
1. Navigate to your project's **Settings > General > Permissions**. 1. Navigate to your project's **Settings > General > Permissions**.
1. Find the "Packages" feature and enable it. 1. Find the "Packages" feature and enable it.
1. Click on **Save changes** for the changes to take effect. 1. Click on **Save changes** for the changes to take effect.
You should then be able to see the **Packages** section on the left sidebar. You should then be able to see the **Packages** section on the left sidebar.
Next, you must configure your project to authorize with the Maven repository. Next, you must configure your project to authorize with the GitLab Maven
repository.
## Authorizing with the Maven repository ## Authorizing with the GitLab Maven repository
If a project is private or you want to upload Maven artifacts to GitLab, If a project is private or you want to upload Maven artifacts to GitLab,
credentials will need to be provided for authorization: credentials will need to be provided for authorization:
...@@ -90,7 +91,7 @@ on the home page of your project. ...@@ -90,7 +91,7 @@ on the home page of your project.
If you have a private GitLab installation, replace `gitlab.com` with your If you have a private GitLab installation, replace `gitlab.com` with your
domain name. domain name.
## Creating maven packages with GitLab CI/CD ## Creating Maven packages with GitLab CI/CD
Once you have your repository configured to use the GitLab Maven Packages repository, Once you have your repository configured to use the GitLab Maven Packages repository,
you can configure GitLab CI/CD to build new packages automatically. The example below you can configure GitLab CI/CD to build new packages automatically. The example below
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment