diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /doc/user/packages/rubygems_registry/index.md | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'doc/user/packages/rubygems_registry/index.md')
-rw-r--r-- | doc/user/packages/rubygems_registry/index.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/user/packages/rubygems_registry/index.md b/doc/user/packages/rubygems_registry/index.md index aa50bc6c2bc..e4d297ac1d8 100644 --- a/doc/user/packages/rubygems_registry/index.md +++ b/doc/user/packages/rubygems_registry/index.md @@ -44,7 +44,7 @@ Feature.enable(:rubygem_packages, Project.find(1)) Feature.disable(:rubygem_packages, Project.find(2)) ``` -## Create a Ruby Gem +## Create a Ruby gem If you need help creating a Ruby gem, see the [RubyGems documentation](https://guides.rubygems.org/make-your-own-gem/). @@ -80,10 +80,19 @@ you can use `CI_JOB_TOKEN` instead of a personal access token or deploy token. For example: ```yaml -image: ruby:latest +# assuming a my_gem.gemspec file is present in the repository with the version currently set to 0.0.1 +image: ruby run: + before_script: + - mkdir ~/.gem + - echo "---" > ~/.gem/credentials + - | + echo "https://gitlab.example.com/api/v4/projects/${CI_PROJECT_ID}/packages/rubygems: '${CI_JOB_TOKEN}'" >> ~/.gem/credentials + - chmod 0600 ~/.gem/credentials # rubygems requires 0600 permissions on the credentials file script: + - gem build my_gem + - gem push my_gem-0.0.1.gem --host https://gitlab.example.com/api/v4/projects/${CI_PROJECT_ID}/packages/rubygems ``` You can also use `CI_JOB_TOKEN` in a `~/.gem/credentials` file that you check in to |