Working with RubyGems
Publish RubyGems Package
Edit
$HOME/.gem/credentials
to add a source:---
https://onedev.example.com/<project path>/~rubygems: Bearer <onedev_access_token>Param Explanation <project path> path of a project with package management enabled <onedev_access_token> OneDev access token with package write permission over the project Run below command to prevent the file from reading by others
chmod 0600 $HOME/.gem/credentials
Push desired gem to the source
gem push --host https://onedev.example.com/<project path>/~rubygems /path/to/<package>-<version>.gem
Param Explanation <project path> same as above For CI/CD job, run below to add source via command step
mkdir -p $HOME/.gem
# Use job token to tell OneDev the build publishing the package
# Job secret 'access-token' should be defined in project build setting as an access token with package write permission
cat << EOF > $HOME/.gem/credentials
---
https://onedev.example.com/<project path>/~rubygems: Bearer @job_token@:@secret:access-token@
EOF
chmod 0600 $HOME/.gem/credentialsParam Explanation <project path> same as above
Consume Published RubyGems Package
The package detail page contains instructions on how to consume published image.