Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boardfish/call_jenkins_builds_from_ruby
Call Jenkins builds from a Ruby process
https://github.com/boardfish/call_jenkins_builds_from_ruby
Last synced: 30 days ago
JSON representation
Call Jenkins builds from a Ruby process
- Host: GitHub
- URL: https://github.com/boardfish/call_jenkins_builds_from_ruby
- Owner: boardfish
- Created: 2019-01-03T14:45:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-16T22:23:13.000Z (about 2 years ago)
- Last Synced: 2024-10-22T08:27:44.160Z (3 months ago)
- Language: JavaScript
- Size: 78.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 31
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Call Jenkins build from Ruby
This small container environment gives you a Jenkins instance you can configure, and allows you to run builds by calling Ruby methods. It's backed by the [jenkins_api_client](https://github.com/arangamani/jenkins_api_client) gem by [@arangamani](https://github.com/arangamani). Please visit their repo for more information on how to apply the gem.
## Setup
Bring up the environment with `docker-compose up -d`. Open `http://localhost:11037` in your browser. After Jenkins takes its time to set up, you'll be asked to log in. Use the username `admin` and supply a password stored on the Jenkins container. Quickly retrieve this with `docker-compose exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword | pbcopy`. (Use `xclip -sel clip` over `pbcopy` on Linux.) The password will be on your clipboard, ready to paste in.
Once Jenkins is ready, there should be a pipeline named `hello-world`.
The pipeline script is defined with the following code:
```groovy
pipeline {
agent any
stages {
stage('Build') {
steps {
println 'hello world'
println foo
}
}
}
}
```## Testing
You should be able to run the following to run the tests:
```
docker-compose build; docker-compose run --rm ruby rspec jenkins_api_caller_spec.rb
```Your `hello-world` pipeline should now have a successful build.